File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed
Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ tokio = { version = "1", features = ["full"] }
1919ark-ec = { version = " =0.5.0" , default-features = false }
2020ark-ed-on-bn254 = { version = " =0.5.0" , default-features = false }
2121ark-ff = { version = " =0.5.0" , default-features = false }
22- # ark-bn254 = "0.5.0"
2322
2423# zk-kit
2524zk-kit-lean-imt = { git = " https://github.com/brech1/zk-kit.rust" , package = " zk-kit-lean-imt" , branch = " feat/generic-tree" }
Original file line number Diff line number Diff line change @@ -62,14 +62,14 @@ impl Proof {
6262 merkle_tree_depth : u16 ,
6363 ) -> Result < SemaphoreProof > {
6464 // check tree depth
65- if merkle_tree_depth < MIN_TREE_DEPTH || merkle_tree_depth > MAX_TREE_DEPTH {
65+ if ! ( MIN_TREE_DEPTH ..= MAX_TREE_DEPTH ) . contains ( & merkle_tree_depth ) {
6666 bail ! ( format!(
6767 "The tree depth must be a number between {} and {}" ,
6868 MIN_TREE_DEPTH , MAX_TREE_DEPTH
6969 ) ) ;
7070 }
7171
72- let merkle_proof = group. merkle_proof ( & to_element ( identity. commitment ( ) . clone ( ) ) ) ;
72+ let merkle_proof = group. merkle_proof ( & to_element ( * identity. commitment ( ) ) ) ;
7373 let merkle_proof_length = merkle_proof. siblings . len ( ) ;
7474
7575 // The index must be converted to a list of indices, 1 for each tree level.
@@ -80,7 +80,7 @@ impl Proof {
8080 merkle_proof_indices. push ( ( merkle_proof. index >> i) & 1 ) ;
8181
8282 if let Some ( sibling) = merkle_proof. siblings . get ( i as usize ) {
83- merkle_proof_siblings. push ( sibling. clone ( ) ) ;
83+ merkle_proof_siblings. push ( * sibling) ;
8484 } else {
8585 merkle_proof_siblings. push ( EMPTY_ELEMENT ) ;
8686 }
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ pub fn to_big_uint(str: &String) -> BigUint {
2222 let bytes = str. as_bytes ( ) ;
2323 assert ! ( bytes. len( ) <= 32 , "BigUint too large: exceeds 32 bytes" ) ;
2424 let mut fixed_bytes = [ 0u8 ; 32 ] ;
25- fixed_bytes[ 0 ..bytes. len ( ) ] . copy_from_slice ( & bytes) ;
25+ fixed_bytes[ 0 ..bytes. len ( ) ] . copy_from_slice ( bytes) ;
2626 BigUint :: from_bytes_be ( & fixed_bytes)
2727}
2828
You can’t perform that action at this time.
0 commit comments