@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@semaphore-protocol/proof",
3
- "version": "4.12.1",
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.12.1",
51
- "@semaphore-protocol/identity": "4.12.1"
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.12.1",
55
- "@zk-kit/artifacts": "1.8.0",
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.4"
58
+ "snarkjs": "0.7.5"
59
59
  }
60
60
  }
@@ -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
- merkleProofIndices,
106
+ merkleProofIndex: merkleProof.index,
111
107
  merkleProofSiblings,
112
108
  scope: hash(scope),
113
109
  message: hash(message)