@semaphore-protocol/proof 4.12.1 → 4.13.0-beta.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.
- package/dist/index.browser.js +451 -454
- package/dist/index.node.cjs +451 -454
- package/dist/index.node.js +451 -454
- package/package.json +6 -6
- package/src/generate-proof.ts +2 -6
- package/src/verification-keys.json +448 -448
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semaphore-protocol/proof",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.0-beta.1",
|
|
4
4
|
"description": "A library to generate and verify Semaphore proofs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
"rollup-plugin-cleanup": "^3.2.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@semaphore-protocol/group": "4.
|
|
51
|
-
"@semaphore-protocol/identity": "4.
|
|
50
|
+
"@semaphore-protocol/group": "4.13.0-beta.1",
|
|
51
|
+
"@semaphore-protocol/identity": "4.13.0-beta.1"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@semaphore-protocol/utils": "4.
|
|
55
|
-
"@zk-kit/artifacts": "
|
|
54
|
+
"@semaphore-protocol/utils": "4.13.0-beta.1",
|
|
55
|
+
"@zk-kit/artifacts": "2.0.1",
|
|
56
56
|
"@zk-kit/utils": "1.3.0",
|
|
57
57
|
"ethers": "6.13.4",
|
|
58
|
-
"snarkjs": "0.7.
|
|
58
|
+
"snarkjs": "0.7.5"
|
|
59
59
|
}
|
|
60
60
|
}
|
package/src/generate-proof.ts
CHANGED
|
@@ -86,18 +86,14 @@ export default async function generateProof(
|
|
|
86
86
|
// If the Snark artifacts are not defined they will be automatically downloaded.
|
|
87
87
|
snarkArtifacts ??= await maybeGetSnarkArtifacts(Project.SEMAPHORE, {
|
|
88
88
|
parameters: [merkleTreeDepth],
|
|
89
|
-
version: "4.0.0"
|
|
89
|
+
version: "4.13.0-beta.0"
|
|
90
90
|
})
|
|
91
91
|
const { wasm, zkey } = snarkArtifacts
|
|
92
92
|
|
|
93
|
-
// The index must be converted to a list of indices, 1 for each tree level.
|
|
94
93
|
// The missing siblings can be set to 0, as they won't be used in the circuit.
|
|
95
|
-
const merkleProofIndices = []
|
|
96
94
|
const merkleProofSiblings = merkleProof.siblings
|
|
97
95
|
|
|
98
96
|
for (let i = 0; i < merkleTreeDepth; i += 1) {
|
|
99
|
-
merkleProofIndices.push((merkleProof.index >> i) & 1)
|
|
100
|
-
|
|
101
97
|
if (merkleProofSiblings[i] === undefined) {
|
|
102
98
|
merkleProofSiblings[i] = 0n
|
|
103
99
|
}
|
|
@@ -107,7 +103,7 @@ export default async function generateProof(
|
|
|
107
103
|
{
|
|
108
104
|
secret: identity.secretScalar,
|
|
109
105
|
merkleProofLength,
|
|
110
|
-
|
|
106
|
+
merkleProofIndex: merkleProof.index,
|
|
111
107
|
merkleProofSiblings,
|
|
112
108
|
scope: hash(scope),
|
|
113
109
|
message: hash(message)
|