@@ -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 ( ) ,
@@ -516,14 +511,14 @@ mod tests {
516511 fn test_semaphore_js_proof ( ) {
517512 let points = [
518513 // Proof generated from `Semaphore-js`
519- "12803714274658725282520630356048215594611199462892068647123162130999777821470 " ,
520- "14790427909013880978103423555540996578520237818660256715698081866578524307407 " ,
521- "3103638479093034897036418556462341694689838452017242207620861422678426008987 " ,
522- "13727581952519649861097277152692845564872363841132502933894854130976607522628 " ,
523- "9411534790044921634269896122419705846815252106674427620586249081562203834159 " ,
524- "10009619289272081097084761045154085973406496068797344071367935854823051916935 " ,
525- "19672409605818107675150930119466509196235828486217699330399295338263828234556 " ,
526- "15472461797587690185190826432462453505284546376663377924961837387512711582919 " ,
514+ "2448901300518098096993075752654536134313649038239216706400667219963346227679 " ,
515+ "11383357624181217239434984412545229801919536849542936327488167664579097021171 " ,
516+ "4740704242184999702574958393302343834384154042177684026319208048433986938524 " ,
517+ "2103898499672759617084297744151588687300569178309824227315704845907524437637 " ,
518+ "18126651739688030584140960766793516019865850111238360168731489534891060767936 " ,
519+ "13293264290162772264887787723520088518667325866686508255341288441681546077334 " ,
520+ "13860303418198054644271827809984867757526756615344099647083475463061491185143 " ,
521+ "7750331146056656453454308267328134694500438800080743301030181391570997944788 " ,
527522 ]
528523 . iter ( )
529524 . map ( |& p| BigUint :: from_str ( p) . unwrap ( ) )
0 commit comments