Skip to content

Commit 2a14fc5

Browse files
Arvoleararitkulova1KitCat1
authored
Dev (#15)
* Added zk cryptography (#14) * Add hash functions * Add zk cryptography * fix deps * fix test runner * linted and reorganised hash functions; switched all files to one pragma circom version * linted wasm-test * updated hardhat-zkit package version * linted zk cryptography circom files * cleaned up wasm-test js files * renamed functions to camel case * removed double spaces; added spaces between operators; linting * refactored comments, corrected typos * linting * updated dependencies * rewrote tests from wasm to hardhat: bigInt folder * rewrote tests from wasm to hardhat: bitify folder * rewrote tests from wasm to hardhat: hasher folder * rewrote tests from wasm to hardhat: int folder * transfered common functions to helperFunctions file * fixed typos: ellipic -> elliptic ADDERS_NUMBER -> ADDRES_NUMBER * allowed UnlimitedContractSize for verifiers contracts * updated hardhat-zkit version * rewrote tests from wasm to hardhat: matrix folder * fixed typos * switched to same order of inputs in sig folder * rewrote tests from wasm to hardhat: signature folder * rewrote tests from wasm to hardhat: ec folder * fixed typos * trying to fix compile in ci * trying to adjust ram in case its github limit * refactored possibly undefined vars in tests * checking a pipeline without 4 biggest circuits * fixed tests for brainloop: automatically generated verifier names were too long, so corresponding contracts were not generated; fixed by creating verifiers dirrectly whithin the tests * refactored assertion checks in tests * updated zkit hardhat version * let -> const in tests * deleted wasm-test folder * trying to fix ci * trying to fix ci command * disabled ci checks * consistency in tests * added missing BigSubNonEqual test * cleaned up * mock directory renamed to main; mock is for tests now * moved mgf1.circom to utils * fixed typo in Pippenger * fixed paths (renamed mock to main) * switched to local circuits instead of circomlib's * renamed utils to mask * CommitmentVerifier -> Commitment SparseMerkleTreeVerifier -> SparseMerkleTree * updated dependencies * updated tests * fixed package-lock * linting * removed unnecessary dependencies * returned chai deps --------- Co-authored-by: 1KitCat1 <[email protected]> Co-authored-by: Artem Chystiakov <[email protected]> * update readme * update readme --------- Co-authored-by: Yuliia Aritkulova <[email protected]> Co-authored-by: 1KitCat1 <[email protected]>
1 parent 42d462c commit 2a14fc5

File tree

168 files changed

+811647
-263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+811647
-263
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ insert_final_newline = true
66
[*.ts]
77
indent_size = 2
88
max_line_length = 120
9+
[*.js]
10+
indent_size = 2
11+
max_line_length = 120
912
[*.sol]
1013
indent_size = 4
1114
max_line_length = 99

.github/workflows/checks.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

README.md

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,46 @@
44

55
The library consists of circom circuits that extend the capabilities of [solarity/solidity-lib](https://github.com/dl-solarity/solidity-lib) to be used in magnificent ZK applications.
66

7-
- Versatile commitment / nullifier circuit.
8-
- Optimized Sparse Merkle Tree (SMT) data structure.
7+
```md
8+
circuits
9+
├── bigInt
10+
│ ├── bigInt - "BigInt implementation with chunking"
11+
│ ├── bigIntOverflow — "BigInt implementation with chunk overflow"
12+
│ ├── bigIntFunc — "Additional functions to accommodate BigInt"
13+
│ └── karatsuba — "Karatsuba multiplication for BigInt"
14+
├── bitify
15+
│ ├── bitGates — "Multiple binary gates"
16+
│ ├── bitify — "Convert numbers to bits and vice versa"
17+
│ ├── comparators - "Compare signals in binary representation"
18+
│ └── operations — "Binary sum of multiple elements"
19+
├── blinders
20+
│ └── Commitment — "Commit/reveal scheme implementation"
21+
├── data-structures
22+
│ └── SparseMerkleTree — "SMT Merkle inclusion/exclusion proofs verification"
23+
├── ec
24+
│ ├── curve — "Elliptic curve operations (secp256r1, secp256k1, brainpoolP256r1, brainpoolP384r1, secp384r1)"
25+
│ ├── get - "Generator point getters for supported elliptic curves"
26+
│ └── powers — "Precompute tables for supported elliptic curves"
27+
├── hasher
28+
│ ├── hash — "Hash functions (sha1, sha224, sha256, sha384, sha512, poseidon)"
29+
│ ├── poseidon - "Poseidon hash function implementation"
30+
│ ├── sha1 — "SHA1 hash function implementation"
31+
│ └── sha2 — "SHA2 hash functions family implementations"
32+
├── int
33+
│ └── arithmetic - "Arithmetic operations over integers"
34+
├── matrix
35+
│ └── matrix — "Common operations for NxM matrices"
36+
├── signatures
37+
│ ├── ecdsa - "ECDSA verification over supported curves"
38+
│ ├── rsa — "RSA-PKCS#1 v1.5 signature verification"
39+
│ ├── rsaPss — "RSASSA-PSS with MGF1 signature verification"
40+
│ └── mask - "Mask generation functions implementation"
41+
├── utils
42+
│ ├── aliascheck — "Check the number fits the scalar field size"
43+
│ └── compconstant — "Compare a number with a template parameter in a binary form"
44+
├── main - "Main components for testing purposes"
45+
└── mock - "Mocks (logs) for testing purposes"
46+
```
947

1048
Powered by [hardhat-zkit](https://github.com/dl-solarity/hardhat-zkit) circom environment.
1149

@@ -28,14 +66,6 @@ You can compile the circuits in the project by executing the following command:
2866
$ npm run zkit-compile
2967
```
3068

31-
### Create verifier contracts for the circuits
32-
33-
Run the following command in order to generate the solidity verifier contracts:
34-
35-
```console
36-
$ npm run zkit-verifiers
37-
```
38-
3969
## License
4070

4171
The library is released under the MIT License.

0 commit comments

Comments
 (0)