@semaphore-protocol/proof 4.0.0-beta.17 → 4.0.0-beta.18
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module @semaphore-protocol/proof
|
|
3
|
-
* @version 4.0.0-beta.
|
|
3
|
+
* @version 4.0.0-beta.18
|
|
4
4
|
* @file A library to generate and verify Semaphore proofs.
|
|
5
5
|
* @copyright Ethereum Foundation 2024
|
|
6
6
|
* @license MIT
|
|
@@ -54,6 +54,7 @@ function toBigInt(value) {
|
|
|
54
54
|
* If it is not defined, it will be inferred from the group or Merkle proof passed as the second parameter.
|
|
55
55
|
* Finally, the artifacts themselves can be passed manually with file paths,
|
|
56
56
|
* or they will be automatically fetched.
|
|
57
|
+
* Please keep in mind that groups with 1 member or 2 members cannot be considered anonymous.
|
|
57
58
|
* @param identity The Semaphore identity.
|
|
58
59
|
* @param groupOrMerkleProof The Semaphore group or its Merkle proof.
|
|
59
60
|
* @param message The Semaphore message.
|
|
@@ -98,7 +99,7 @@ async function generateProof(identity, groupOrMerkleProof, message, scope, merkl
|
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
else {
|
|
101
|
-
merkleTreeDepth = merkleProofLength;
|
|
102
|
+
merkleTreeDepth = merkleProofLength !== 0 ? merkleProofLength : 1;
|
|
102
103
|
}
|
|
103
104
|
// If the Snark artifacts are not defined they will be automatically downloaded.
|
|
104
105
|
snarkArtifacts ?? (snarkArtifacts = await maybeGetSnarkArtifacts(Project.SEMAPHORE, {
|
package/dist/index.node.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module @semaphore-protocol/proof
|
|
3
|
-
* @version 4.0.0-beta.
|
|
3
|
+
* @version 4.0.0-beta.18
|
|
4
4
|
* @file A library to generate and verify Semaphore proofs.
|
|
5
5
|
* @copyright Ethereum Foundation 2024
|
|
6
6
|
* @license MIT
|
|
@@ -55,6 +55,7 @@ function toBigInt(value) {
|
|
|
55
55
|
* If it is not defined, it will be inferred from the group or Merkle proof passed as the second parameter.
|
|
56
56
|
* Finally, the artifacts themselves can be passed manually with file paths,
|
|
57
57
|
* or they will be automatically fetched.
|
|
58
|
+
* Please keep in mind that groups with 1 member or 2 members cannot be considered anonymous.
|
|
58
59
|
* @param identity The Semaphore identity.
|
|
59
60
|
* @param groupOrMerkleProof The Semaphore group or its Merkle proof.
|
|
60
61
|
* @param message The Semaphore message.
|
|
@@ -99,7 +100,7 @@ async function generateProof(identity, groupOrMerkleProof, message, scope, merkl
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
else {
|
|
102
|
-
merkleTreeDepth = merkleProofLength;
|
|
103
|
+
merkleTreeDepth = merkleProofLength !== 0 ? merkleProofLength : 1;
|
|
103
104
|
}
|
|
104
105
|
// If the Snark artifacts are not defined they will be automatically downloaded.
|
|
105
106
|
snarkArtifacts ?? (snarkArtifacts = await artifacts.maybeGetSnarkArtifacts(artifacts.Project.SEMAPHORE, {
|
package/dist/index.node.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module @semaphore-protocol/proof
|
|
3
|
-
* @version 4.0.0-beta.
|
|
3
|
+
* @version 4.0.0-beta.18
|
|
4
4
|
* @file A library to generate and verify Semaphore proofs.
|
|
5
5
|
* @copyright Ethereum Foundation 2024
|
|
6
6
|
* @license MIT
|
|
@@ -54,6 +54,7 @@ function toBigInt(value) {
|
|
|
54
54
|
* If it is not defined, it will be inferred from the group or Merkle proof passed as the second parameter.
|
|
55
55
|
* Finally, the artifacts themselves can be passed manually with file paths,
|
|
56
56
|
* or they will be automatically fetched.
|
|
57
|
+
* Please keep in mind that groups with 1 member or 2 members cannot be considered anonymous.
|
|
57
58
|
* @param identity The Semaphore identity.
|
|
58
59
|
* @param groupOrMerkleProof The Semaphore group or its Merkle proof.
|
|
59
60
|
* @param message The Semaphore message.
|
|
@@ -98,7 +99,7 @@ async function generateProof(identity, groupOrMerkleProof, message, scope, merkl
|
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
else {
|
|
101
|
-
merkleTreeDepth = merkleProofLength;
|
|
102
|
+
merkleTreeDepth = merkleProofLength !== 0 ? merkleProofLength : 1;
|
|
102
103
|
}
|
|
103
104
|
// If the Snark artifacts are not defined they will be automatically downloaded.
|
|
104
105
|
snarkArtifacts ?? (snarkArtifacts = await maybeGetSnarkArtifacts(Project.SEMAPHORE, {
|
|
@@ -15,6 +15,7 @@ import type { SemaphoreProof } from "./types";
|
|
|
15
15
|
* If it is not defined, it will be inferred from the group or Merkle proof passed as the second parameter.
|
|
16
16
|
* Finally, the artifacts themselves can be passed manually with file paths,
|
|
17
17
|
* or they will be automatically fetched.
|
|
18
|
+
* Please keep in mind that groups with 1 member or 2 members cannot be considered anonymous.
|
|
18
19
|
* @param identity The Semaphore identity.
|
|
19
20
|
* @param groupOrMerkleProof The Semaphore group or its Merkle proof.
|
|
20
21
|
* @param message The Semaphore message.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semaphore-protocol/proof",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.18",
|
|
4
4
|
"description": "A library to generate and verify Semaphore proofs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"rollup-plugin-cleanup": "^3.2.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@semaphore-protocol/group": "4.0.0-beta.
|
|
52
|
-
"@semaphore-protocol/identity": "4.0.0-beta.
|
|
51
|
+
"@semaphore-protocol/group": "4.0.0-beta.18",
|
|
52
|
+
"@semaphore-protocol/identity": "4.0.0-beta.18"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@semaphore-protocol/utils": "4.0.0-beta.
|
|
55
|
+
"@semaphore-protocol/utils": "4.0.0-beta.18",
|
|
56
56
|
"@zk-kit/artifacts": "1.8.0",
|
|
57
57
|
"@zk-kit/utils": "1.0.0",
|
|
58
58
|
"ethers": "6.10.0",
|
package/src/generate-proof.ts
CHANGED
|
@@ -22,6 +22,7 @@ import type { SemaphoreProof } from "./types"
|
|
|
22
22
|
* If it is not defined, it will be inferred from the group or Merkle proof passed as the second parameter.
|
|
23
23
|
* Finally, the artifacts themselves can be passed manually with file paths,
|
|
24
24
|
* or they will be automatically fetched.
|
|
25
|
+
* Please keep in mind that groups with 1 member or 2 members cannot be considered anonymous.
|
|
25
26
|
* @param identity The Semaphore identity.
|
|
26
27
|
* @param groupOrMerkleProof The Semaphore group or its Merkle proof.
|
|
27
28
|
* @param message The Semaphore message.
|
|
@@ -79,7 +80,7 @@ export default async function generateProof(
|
|
|
79
80
|
throw new TypeError(`The tree depth must be a number between ${MIN_DEPTH} and ${MAX_DEPTH}`)
|
|
80
81
|
}
|
|
81
82
|
} else {
|
|
82
|
-
merkleTreeDepth = merkleProofLength
|
|
83
|
+
merkleTreeDepth = merkleProofLength !== 0 ? merkleProofLength : 1
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
// If the Snark artifacts are not defined they will be automatically downloaded.
|