mirror of
https://github.com/arnaucube/gnark-plonky2-verifier.git
synced 2026-01-12 09:01:32 +01:00
fix for V-SCT-VUL-022
This commit is contained in:
@@ -128,13 +128,15 @@ func (f *Chip) verifyMerkleProofToCapWithCapIndex(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const NUM_LEAF_LOOKUPS = 4
|
const NUM_LEAF_LOOKUPS = 4
|
||||||
|
// Each lookup gadget will connect to 4 merkleCap entries
|
||||||
|
const STRIDE_LENGTH = 4
|
||||||
var leafLookups [NUM_LEAF_LOOKUPS]poseidon.BN254HashOut
|
var leafLookups [NUM_LEAF_LOOKUPS]poseidon.BN254HashOut
|
||||||
// First create the "leaf" lookup2 circuits
|
// First create the "leaf" lookup2 circuits
|
||||||
// The will use the least significant bits of the capIndexBits array
|
// This will use the least significant bits of the capIndexBits array
|
||||||
for i := 0; i < NUM_LEAF_LOOKUPS; i++ {
|
for i := 0; i < NUM_LEAF_LOOKUPS; i++ {
|
||||||
leafLookups[i] = f.api.Lookup2(
|
leafLookups[i] = f.api.Lookup2(
|
||||||
capIndexBits[0], capIndexBits[1],
|
capIndexBits[0], capIndexBits[1],
|
||||||
merkleCap[i*NUM_LEAF_LOOKUPS], merkleCap[i*NUM_LEAF_LOOKUPS+1], merkleCap[i*NUM_LEAF_LOOKUPS+2], merkleCap[i*NUM_LEAF_LOOKUPS+3],
|
merkleCap[i*STRIDE_LENGTH], merkleCap[i*STRIDE_LENGTH+1], merkleCap[i*STRIDE_LENGTH+2], merkleCap[i*STRIDE_LENGTH+3],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user