diff --git a/codex/slots/proofs/backends/circomcompat.nim b/codex/slots/proofs/backends/circomcompat.nim index 98f4cac2..4dc38aaf 100644 --- a/codex/slots/proofs/backends/circomcompat.nim +++ b/codex/slots/proofs/backends/circomcompat.nim @@ -63,6 +63,7 @@ proc prove*( var entropy = input.entropy.toBytes verifyRoot = input.verifyRoot.toBytes + slotRoot = input.slotRoot.toBytes if backend.pushInputU256Array( "entropy".cstring, entropy.addr, entropy.len.uint32) != ERR_OK: @@ -72,6 +73,10 @@ proc prove*( "dataSetRoot".cstring, verifyRoot.addr, verifyRoot.len.uint32) != ERR_OK: return failure("Failed to push data set root") + if backend.pushInputU256Array( + "slotRoot".cstring, slotRoot.addr, slotRoot.len.uint32) != ERR_OK: + return failure("Failed to push data set root") + if backend.pushInputU32( "nCellsPerSlot".cstring, input.numCells.uint32) != ERR_OK: return failure("Failed to push nCellsPerSlot") @@ -90,19 +95,19 @@ proc prove*( # arrays are always flattened if backend.pushInputU256Array( "slotProof".cstring, - slotProof.addr, - uint input.verifyProof.len) != ERR_OK: + slotProof[0].addr, + uint (32 * input.verifyProof.len)) != ERR_OK: return failure("Failed to push slot proof") for s in input.samples: var - merklePaths = s.merkleProof.mapIt( it.toBytes ).concat + merklePaths = s.merkleProof.mapIt( it.toBytes ) data = s.data if backend.pushInputU256Array( "merklePaths".cstring, merklePaths[0].addr, - uint merklePaths.len) != ERR_OK: + uint (32 * merklePaths.len)) != ERR_OK: return failure("Failed to push merkle paths") if backend.pushInputU256Array(