46 Commits

Author SHA1 Message Date
Sergey Kaunov
3798b4d3d2 Solve #120 (#126)
* rescue <javascript> `v2` and change the paths in <test> to the rescued thing

* reflect the changed paths in the instruction
2025-05-27 23:33:59 +03:00
Divide-By-0
5bd0bf01d2 fix #15 2024-02-05 23:54:15 -05:00
skaunov
93e8844881 prettier lint 2023-12-02 02:38:22 +03:00
skaunov
94fd5b5e97 Solve #13
I had an idea to just hardcode the binary array, but it seems that
to actually constrait the circuit to it it's beneficial to use the
`component`.
```
bit_length_binary <== [0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ];
```
2023-12-02 02:25:40 +03:00
Anton
79c602670b chore: clean up (#74)
* chore: clean up

- [x] Add checks for ci actions
- [x] Run prettier, clippy, fmt commands for all the files
- [x] Move circom circuits to a circom folder
- [x] Get rid of js var statements

* chore: add resolver version for cargo.toml

* chore: add circom tests

* chore: optimize check triggers

* chore: remove `check` command

* chore: use only `pnpm`

* chore: update readme

---------

Co-authored-by: 0xmad <0xmad@users.noreply.github.com>
2023-11-18 20:48:24 +03:00
Sergey Kaunov
d4cda5b503 Merge branch 'main' into 22_resolveConflict_ 2023-10-26 18:38:20 +03:00
skaunov
d8fb1b8b08 Fix merging, JS lock files update 2023-10-20 20:26:26 +03:00
skaunov
da9f5fb288 All modules naming is aligned. + refactoring&tests
[Discussion] results are incorporated. Naming groomed repository wide. \
Fun fact: I already was confused by that "hash2" naming, lol.

Note that `fn verify_signals` barely [benefit]
from renaming at all currently.

[Discussion]: 251fba6902 (commitcomment-130400727)
[benefit]: https://github.com/plume-sig/zk-nullifier-sig/issues/61
2023-10-20 17:59:39 +03:00
dependabot[bot]
3e0d219ea3 Bump @babel/traverse from 7.21.2 to 7.23.2 in /circuits
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.21.2 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-20 11:55:50 +00:00
Sergey Kaunov
f4b53bc183 Fix: array signals (#65)
Co-authored-by: RajeshRk18 <kannar432@gmail.com>
2023-10-20 14:55:14 +03:00
dependabot[bot]
10ef5f8639 Bump get-func-name from 2.0.0 to 2.0.2 in /circuits
Bumps [get-func-name](https://github.com/chaijs/get-func-name) from 2.0.0 to 2.0.2.
- [Release notes](https://github.com/chaijs/get-func-name/releases)
- [Commits](https://github.com/chaijs/get-func-name/commits/v2.0.2)

---
updated-dependencies:
- dependency-name: get-func-name
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-05 21:52:38 +00:00
blakemscurr
1e7908bf0e Fix test consts for v1 and v2. 2023-04-20 14:50:30 +12:00
blakemscurr
3288b7b911 Reinstate v1 circom circuit. 2023-04-20 13:40:46 +12:00
blakemscurr
d9f68dd4d5 Revert "Remove sha256 calculation from circuit."
This reverts commit b37dbbe3927ff95ce6cce2e7f0265be4456a1d5f.
2023-04-20 13:40:46 +12:00
blakemscurr
f4a400e7f4 Fix testing error during witness comparison. 2023-04-20 13:40:46 +12:00
blakemscurr
067127b868 Make gPowR and hPowR outputs of the circuit. 2023-04-20 13:40:46 +12:00
blakemscurr
bef3f860dc Remove sha256 calculation from circuit. 2023-04-20 13:40:46 +12:00
blakemscurr
3ba74797c4 Merge branch 'main' of https://github.com/zk-nullifier-sig/zk-nullifier-sig into main 2023-03-23 13:34:42 +13:00
blakemscurr
711b66eb2f Require specific node versions, to avoid issues.
Rebuild package-lock.json to resolve consistency issues.
2023-03-14 17:05:40 +13:00
blakemscurr
a4f23bfcf3 Fix capitalisation typo.
Circom on Linux is type sensitive for includes, whereas on Mac it is not.
2023-03-14 16:34:47 +13:00
blakemscurr
0a70551822 Make flatten-deps cross compatible for mac and linux. 2023-02-22 21:53:35 +13:00
blakemscurr
f84dc171e9 Fix tests.
Only use one @noble/secp256k1 dependency to avoid type error.
Use updated hash to curve length.
Create final num2bits components before using them to avoid invalid access.
2023-02-15 17:51:43 +13:00
blakemscurr
baee84e770 Move from deprecated crypto package to built in node:crypto. 2023-02-14 13:19:16 +13:00
blakemscurr
e3ab24c0e5 Use latest hash_to_curve. 2023-02-14 13:11:50 +13:00
blakemscurr
94e1b6d46a Tidy up EOF new lines. 2023-02-14 13:11:20 +13:00
blakemscurr
b93d6ef763 Tidy up
Move register conversion functions to utils
s/to_the/pow
Index consistency
2023-02-13 16:30:24 +13:00
blakemscurr
33fac728b8 Generate correct nullifier in the circuit.
Fix final endianness issue while comparing the bits of the input c, to
the bits of c as calculated by the circuit.
2023-02-13 16:09:44 +13:00
blakemscurr
2c8182f87b Split test constants into a separate file. 2023-02-13 16:07:33 +13:00
blakemscurr
b4139edb2c Correctly calculate sha256 of 6 compressed ec points in the circuit. 2023-02-10 16:43:43 +13:00
blakemscurr
20f7a510a4 Calculate compressed value inside the circuit. 2023-02-09 15:23:42 +13:00
blakemscurr
9dd9178206 Verify elliptic curve point compression. 2023-02-09 14:39:53 +13:00
blakemscurr
279972406f Test hash_to_curve output. 2023-02-09 14:04:40 +13:00
blakemscurr
9fb2779368 Pass public key to hash_to_curve as bytes. 2023-02-06 14:39:31 +13:00
blakemscurr
b523a3114b Attempt to fix hash to curve witness generation bug WIP. 2023-02-04 18:37:47 +13:00
blakemscurr
ee5809915b Add whole circuit test. 2023-02-04 16:42:57 +13:00
blakemscurr
df0bc66c70 Test a/b^c subcircuit. 2023-02-03 16:50:16 +13:00
blakemscurr
a680f19e08 Test circuit WIP.
First equation not verifying, even outside circuit.
2023-02-02 17:13:00 +13:00
blakemscurr
108c0f7586 Install ts and jest. 2023-02-02 14:06:33 +13:00
blakemscurr
b4566bca85 Add constants for generate in 4 registers. 2023-02-01 15:02:34 +13:00
blakemscurr
8c9969ccf3 Fix compile errors. 2023-01-31 17:37:59 +13:00
blakemscurr
3b0460c1c8 Add janky fix to flatten nested dependencies. 2023-01-31 16:26:30 +13:00
blakemscurr
f272a6529e Install dependencies and fix syntax errors. 2023-01-31 15:13:32 +13:00
blakemscurr
0e9fd95409 Simplify sha256 inputs. 2023-01-30 15:19:57 +13:00
blakemscurr
1e5b6e7694 Finish circom circuit sketch. 2023-01-30 15:15:41 +13:00
blakemscurr
a18156ba31 calculate h^r 2023-01-29 13:50:50 +13:00
blakemscurr
404487e1ae Calculate g^r in circom circuit. 2023-01-29 13:35:57 +13:00