Skip to content

Commit c2a795f

Browse files
committed
perf: optimize pvs injection
1 parent 98346d8 commit c2a795f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/OpenVmHalo2Verifier.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ contract OpenVmHalo2Verifier is Halo2Verifier {
124124

125125
// Copy each byte of the guestPvs into the proof. It copies the
126126
// most significant bytes of guestPvs first.
127-
let guestPvsMemOffset := add(proofPtr, 0x1c0)
128-
for { let i := 0 } lt(i, GUEST_PVS_LENGTH) { i := add(i, 1) } {
129-
calldatacopy(add(guestPvsMemOffset, add(shl(5, i), 0x1f)), add(guestPvs.offset, i), 0x01)
127+
let guestPvsMemOffset := add(add(proofPtr, 0x1c0), 0x1f)
128+
for { let i := 0 } iszero(eq(i, GUEST_PVS_LENGTH)) { i := add(i, 1) } {
129+
calldatacopy(add(guestPvsMemOffset, shl(5, i)), add(guestPvs.offset, i), 0x01)
130130
}
131131
}
132132
}

0 commit comments

Comments
 (0)