Skip to content

Commit cab10e9

Browse files
committed
refactor: update semaphore artifacts
1 parent ad1c878 commit cab10e9

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/proof.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,8 @@ impl Proof {
124124
let merkle_proof = group.merkle_proof(&to_element(*identity.commitment()));
125125
let merkle_proof_length = merkle_proof.siblings.len();
126126

127-
// The index must be converted to a list of indices, 1 for each tree level.
128-
// The missing siblings can be set to 0, as they won"t be used in the circuit.
129-
let mut merkle_proof_indices = Vec::new();
130127
let mut merkle_proof_siblings = Vec::<Element>::new();
131128
for i in 0..merkle_tree_depth {
132-
merkle_proof_indices.push((merkle_proof.index >> i) & 1);
133-
134129
if let Some(sibling) = merkle_proof.siblings.get(i as usize) {
135130
merkle_proof_siblings.push(*sibling);
136131
} else {
@@ -150,8 +145,8 @@ impl Proof {
150145
vec![merkle_proof_length.to_string()],
151146
),
152147
(
153-
"merkleProofIndices".to_string(),
154-
merkle_proof_indices.iter().map(|i| i.to_string()).collect(),
148+
"merkleProofIndex".to_string(),
149+
vec![merkle_proof.index.to_string()],
155150
),
156151
(
157152
"merkleProofSiblings".to_string(),

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub fn to_element(value: Fq) -> Element {
4040

4141
/// Download zkey from artifacts: https://snark-artifacts.pse.dev/
4242
pub fn download_zkey(depth: u16) -> Result<String, Box<dyn Error>> {
43-
let version = "4.0.0";
43+
let version = "4.13.0";
4444
let base_url = format!("https://snark-artifacts.pse.dev/semaphore/{version}/");
4545
let filename = format!("semaphore-{depth}.zkey");
4646
let dest_filename = format!("semaphore-{version}-{depth}.zkey");

0 commit comments

Comments
 (0)