circomlibjs-hinkal-fork 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/.github/workflows/npm-publish.yml +21 -0
  2. package/.vscode/launch.json +40 -0
  3. package/README.md +18 -0
  4. package/badmsges.md +0 -0
  5. package/build/main.cjs +27397 -0
  6. package/hardhat.config.js +6 -0
  7. package/main.js +25 -0
  8. package/package.json +40 -0
  9. package/rollup.cjs.config.js +16 -0
  10. package/src/babyjub.js +139 -0
  11. package/src/eddsa.js +286 -0
  12. package/src/evmasm.js +209 -0
  13. package/src/mimc7.js +78 -0
  14. package/src/mimc7_gencontract.js +113 -0
  15. package/src/mimc7_print_iv.js +18 -0
  16. package/src/mimc7_printconstants.js +26 -0
  17. package/src/mimc7_printcontract.js +14 -0
  18. package/src/mimcsponge.js +100 -0
  19. package/src/mimcsponge_gencontract.js +125 -0
  20. package/src/mimcsponge_printconstants.js +25 -0
  21. package/src/mimcsponge_printcontract.js +14 -0
  22. package/src/pedersen_hash.js +132 -0
  23. package/src/pedersen_printbases.js +36 -0
  24. package/src/poseidon_constants.js +207 -0
  25. package/src/poseidon_constants.json +206 -0
  26. package/src/poseidon_constants_opt.js +24806 -0
  27. package/src/poseidon_constants_opt.json +24806 -0
  28. package/src/poseidon_gencontract.js +209 -0
  29. package/src/poseidon_opt.js +119 -0
  30. package/src/poseidon_printcontract.js +14 -0
  31. package/src/poseidon_printmatrix.js +22 -0
  32. package/src/poseidon_reference.js +83 -0
  33. package/src/poseidon_wasm.js +440 -0
  34. package/src/smt.js +309 -0
  35. package/src/smt_hashes_mimc.js +16 -0
  36. package/src/smt_hashes_poseidon.js +17 -0
  37. package/src/smt_memdb.js +57 -0
  38. package/src/testblake.js +18 -0
  39. package/tools/poseidon_optimize_constants.js +301 -0
@@ -0,0 +1,21 @@
1
+ name: Publish package to NPM
2
+
3
+ on:
4
+ release:
5
+ types: [created]
6
+
7
+ jobs:
8
+ publish-npm:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - uses: actions/setup-node@v4
13
+ with:
14
+ node-version: '20.x'
15
+ registry-url: https://registry.npmjs.org/
16
+ cache: 'npm'
17
+ - run: npm ci
18
+ - run: npm run build
19
+ - run: npm publish
20
+ env:
21
+ NODE_AUTH_TOKEN: ${{secrets.IDEN3_CIRCOM_NPM_PUBLISH_TOKEN}}
@@ -0,0 +1,40 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "type": "pwa-node",
9
+ "request": "launch",
10
+ "name": "Test",
11
+ "skipFiles": [
12
+ "<node_internals>/**"
13
+ ],
14
+ "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
15
+ "args": ["test/mimc7.js"]
16
+ },
17
+ {
18
+ "type": "pwa-node",
19
+ "request": "launch",
20
+ "name": "Print Bases",
21
+ "skipFiles": [
22
+ "<node_internals>/**"
23
+ ],
24
+ "program": "${workspaceFolder}/src/pedersen_printbases.js"
25
+ },
26
+ {
27
+ "type": "pwa-node",
28
+ "request": "launch",
29
+ "name": "Test Poseidon",
30
+ "skipFiles": [
31
+ "<node_internals>/**"
32
+ ],
33
+ "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
34
+ "args": [
35
+ "${workspaceFolder}/test/poseidon.js"
36
+ ],
37
+ }
38
+
39
+ ]
40
+ }
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ #circomlibjs
2
+
3
+ It is Hinkal version of circomlibjs with global polyfills: process, Buffer
4
+
5
+ `circomlibjs` is a Javascript library that provides programs to compute the witness of several circuits of `circomlib`.
6
+ This library is used to make tests of circomlib circuits.
7
+
8
+ In the `src` directory the package includes these programs.
9
+
10
+ In the `test` directory includes its own tests and.
11
+
12
+ In the `tools` directory includes programs to precompute some needed parameters.
13
+
14
+ You can install `circomlibjs` with the following command:
15
+
16
+ ```text
17
+ npm install -g circomlibjs
18
+ ```
package/badmsges.md ADDED
File without changes