Skip to content

Commit 7e7d364

Browse files
committed
chore: address renamings
1 parent 10676dd commit 7e7d364

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/OpenVmHalo2Verifier.sol

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,20 @@ contract OpenVmHalo2Verifier is Halo2Verifier, IOpenVmHalo2Verifier {
4747
/// proof[14 * 32..(14 + GUEST_PVS_LENGTH) * 32]: guestPvs[0..GUEST_PVS_LENGTH]
4848
/// proof[(14 + GUEST_PVS_LENGTH) * 32..]: Guest PVs Suffix
4949
///
50-
/// @param guestPvs The PVs revealed by the OpenVM guest program.
51-
/// @param partialProof All components of the proof except the Guest PVs,
50+
/// @param publicValues The PVs revealed by the OpenVM guest program.
51+
/// @param proofData All components of the proof except the Guest PVs,
5252
/// leaf and app exe commits. The expected format is:
5353
/// `abi.encodePacked(kzgAccumulators, proofSuffix)`
5454
/// @param appExeCommit The commitment to the OpenVM application executable whose execution
5555
/// is being verified.
56-
function verify(bytes calldata guestPvs, bytes calldata partialProof, bytes32 appExeCommit) external view {
57-
if (guestPvs.length != GUEST_PVS_LENGTH) revert InvalidGuestPvsLength();
58-
if (partialProof.length != PARTIAL_PROOF_LENGTH) revert InvalidPartialProofLength();
56+
function verify(bytes calldata publicValues, bytes calldata proofData, bytes32 appExeCommit) external view {
57+
if (publicValues.length != GUEST_PVS_LENGTH) revert InvalidGuestPvsLength();
58+
if (proofData.length != PARTIAL_PROOF_LENGTH) revert InvalidPartialProofLength();
5959

6060
// We will format the public values and construct the full proof payload
6161
// below.
6262

63-
MemoryPointer proofPtr = _constructProof(guestPvs, partialProof, appExeCommit);
63+
MemoryPointer proofPtr = _constructProof(publicValues, proofData, appExeCommit);
6464

6565
uint256 fullProofLength = FULL_PROOF_LENGTH;
6666

@@ -86,12 +86,12 @@ contract OpenVmHalo2Verifier is Halo2Verifier, IOpenVmHalo2Verifier {
8686
/// `guestPvs` separated into its own `bytes32` word.
8787
///
8888
/// This function does not clean the memory it allocates. Since it is the
89-
/// only memory allocation that occurs in the call frame, we know that the
90-
/// memory was not written to before.
89+
/// only memory allocation that occurs in the call frame, so we know that
90+
/// the memory region was not written to before.
9191
///
9292
/// @return proofPtr Memory pointer to the beginning of the constructed
9393
/// proof.
94-
function _constructProof(bytes calldata guestPvs, bytes calldata partialProof, bytes32 appExeCommit)
94+
function _constructProof(bytes calldata publicValues, bytes calldata proofData, bytes32 appExeCommit)
9595
internal
9696
pure
9797
returns (MemoryPointer proofPtr)
@@ -115,7 +115,7 @@ contract OpenVmHalo2Verifier is Halo2Verifier, IOpenVmHalo2Verifier {
115115

116116
// Copy the KZG accumulators (length 0x180) into the beginning of
117117
// the memory buffer
118-
calldatacopy(proofPtr, partialProof.offset, 0x180)
118+
calldatacopy(proofPtr, proofData.offset, 0x180)
119119

120120
// Copy the App Exe Commit and Leaf Exe Commit into the memory buffer
121121
mstore(add(proofPtr, 0x180), appExeCommit)
@@ -128,13 +128,13 @@ contract OpenVmHalo2Verifier is Halo2Verifier, IOpenVmHalo2Verifier {
128128
// Begin copying from the end of the KZG accumulators in the
129129
// calldata buffer (0x180)
130130
let suffixProofOffset := add(0x1c0, shl(5, GUEST_PVS_LENGTH))
131-
calldatacopy(add(proofPtr, suffixProofOffset), add(partialProof.offset, 0x180), 0x560)
131+
calldatacopy(add(proofPtr, suffixProofOffset), add(proofData.offset, 0x180), 0x560)
132132

133133
// Copy each byte of the guestPvs into the proof. It copies the
134134
// most significant bytes of guestPvs first.
135135
let guestPvsMemOffset := add(add(proofPtr, 0x1c0), 0x1f)
136136
for { let i := 0 } iszero(eq(i, GUEST_PVS_LENGTH)) { i := add(i, 1) } {
137-
calldatacopy(add(guestPvsMemOffset, shl(5, i)), add(guestPvs.offset, i), 0x01)
137+
calldatacopy(add(guestPvsMemOffset, shl(5, i)), add(publicValues.offset, i), 0x01)
138138
}
139139
}
140140
}

src/interfaces/IOpenVmHalo2Verifier.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
pragma solidity ^0.8.19;
33

44
interface IOpenVmHalo2Verifier {
5-
function verify(bytes calldata guestPvs, bytes calldata partialProof, bytes32 appExeCommit) external view;
5+
function verify(bytes calldata publicValues, bytes calldata proofData, bytes32 appExeCommit) external view;
66
}

test/OpenVmHalo2Verifier.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ contract OpenVmHalo2VerifierTest is Test, OpenVmHalo2Verifier {
9393
function checkProofFormat(bytes calldata proof) external view {
9494
bytes memory partialProofExpected = partialProof;
9595

96-
bytes memory kzgAccumulators = proof[0:0x180];
96+
bytes memory _kzgAccumulators = proof[0:0x180];
9797
bytes memory guestPvsSuffix = proof[0x5c0:];
98-
bytes memory _partialProof = abi.encodePacked(kzgAccumulators, guestPvsSuffix);
98+
bytes memory _partialProof = abi.encodePacked(_kzgAccumulators, guestPvsSuffix);
9999
require(keccak256(_partialProof) == keccak256(partialProofExpected), "Partial proof mismatch");
100100

101101
bytes memory _appExeCommit = proof[0x180:0x1a0];

0 commit comments

Comments
 (0)