Skip to content

Commit a7e0ded

Browse files
committed
chore: merge fixes
1 parent 286b647 commit a7e0ded

File tree

2 files changed

+4
-48
lines changed

2 files changed

+4
-48
lines changed

barretenberg/cpp/src/barretenberg/dsl/acir_proofs/honk_contract.hpp

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ library FrLib {
6262
mstore(add(free, 0x20), 0x20)
6363
mstore(add(free, 0x40), 0x20)
6464
mstore(add(free, 0x60), v)
65-
mstore(add(free, 0x80), sub(MODULUS, 2))
65+
mstore(add(free, 0x80), sub(MODULUS, 2))
6666
mstore(add(free, 0xa0), MODULUS)
6767
let success := staticcall(gas(), 0x05, free, 0xc0, 0x00, 0x20)
6868
if iszero(success) {
@@ -85,7 +85,7 @@ library FrLib {
8585
mstore(add(free, 0x20), 0x20)
8686
mstore(add(free, 0x40), 0x20)
8787
mstore(add(free, 0x60), b)
88-
mstore(add(free, 0x80), v)
88+
mstore(add(free, 0x80), v)
8989
mstore(add(free, 0xa0), MODULUS)
9090
let success := staticcall(gas(), 0x05, free, 0xc0, 0x00, 0x20)
9191
if iszero(success) {
@@ -2053,7 +2053,7 @@ abstract contract BaseHonkVerifier is IVerifier {
20532053
mem.scalingFactorPos = mem.batchingChallenge * mem.posInvertedDenominator;
20542054
mem.scalingFactorNeg = mem.batchingChallenge * tp.shplonkNu * mem.negInvertedDenominator;
20552055
// [Aₗ] is multiplied by -v^{2l}/(z-r^{2^l}) - v^{2l+1} /(z+ r^{2^l})
2056-
scalars[NUMBER_OF_ENTITIES + 1 + i] = mem.scalingFactorNeg.neg() + mem.scalingFactorPos.neg();
2056+
scalars[NUMBER_UNSHIFTED + 1 + i] = mem.scalingFactorNeg.neg() + mem.scalingFactorPos.neg();
20572057
20582058
// Accumulate the const term contribution given by
20592059
// v^{2l} * Aₗ(r^{2ˡ}) /(z-r^{2^l}) + v^{2l+1} * Aₗ(-r^{2ˡ}) /(z+ r^{2^l})
@@ -2066,28 +2066,6 @@ abstract contract BaseHonkVerifier is IVerifier {
20662066
}
20672067
20682068
for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N - 1; ++i) {
2069-
bool dummy_round = i >= ($LOG_N - 1);
2070-
2071-
if (!dummy_round) {
2072-
// Update inverted denominators
2073-
mem.posInvertedDenominator = (tp.shplonkZ - powers_of_evaluation_challenge[i + 1]).invert();
2074-
mem.negInvertedDenominator = (tp.shplonkZ + powers_of_evaluation_challenge[i + 1]).invert();
2075-
2076-
// Compute the scalar multipliers for Aₗ(± r^{2ˡ}) and [Aₗ]
2077-
mem.scalingFactorPos = mem.batchingChallenge * mem.posInvertedDenominator;
2078-
mem.scalingFactorNeg = mem.batchingChallenge * tp.shplonkNu * mem.negInvertedDenominator;
2079-
// [Aₗ] is multiplied by -v^{2l}/(z-r^{2^l}) - v^{2l+1} /(z+ r^{2^l})
2080-
scalars[NUMBER_UNSHIFTED + 1 + i] = mem.scalingFactorNeg.neg() + mem.scalingFactorPos.neg();
2081-
2082-
// Accumulate the const term contribution given by
2083-
// v^{2l} * Aₗ(r^{2ˡ}) /(z-r^{2^l}) + v^{2l+1} * Aₗ(-r^{2ˡ}) /(z+ r^{2^l})
2084-
Fr accumContribution = mem.scalingFactorNeg * proof.geminiAEvaluations[i + 1];
2085-
accumContribution = accumContribution + mem.scalingFactorPos * foldPosEvaluations[i + 1];
2086-
mem.constantTermAccumulator = mem.constantTermAccumulator + accumContribution;
2087-
// Update the running power of v
2088-
mem.batchingChallenge = mem.batchingChallenge * tp.shplonkNu * tp.shplonkNu;
2089-
}
2090-
20912069
commitments[NUMBER_UNSHIFTED + 1 + i] = convertProofPoint(proof.geminiFoldComms[i]);
20922070
}
20932071

barretenberg/sol/src/honk/BaseHonkVerifier.sol

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ abstract contract BaseHonkVerifier is IVerifier {
384384
mem.scalingFactorPos = mem.batchingChallenge * mem.posInvertedDenominator;
385385
mem.scalingFactorNeg = mem.batchingChallenge * tp.shplonkNu * mem.negInvertedDenominator;
386386
// [Aₗ] is multiplied by -v^{2l}/(z-r^{2^l}) - v^{2l+1} /(z+ r^{2^l})
387-
scalars[NUMBER_OF_ENTITIES + 1 + i] = mem.scalingFactorNeg.neg() + mem.scalingFactorPos.neg();
387+
scalars[NUMBER_UNSHIFTED + 1 + i] = mem.scalingFactorNeg.neg() + mem.scalingFactorPos.neg();
388388

389389
// Accumulate the const term contribution given by
390390
// v^{2l} * Aₗ(r^{2ˡ}) /(z-r^{2^l}) + v^{2l+1} * Aₗ(-r^{2ˡ}) /(z+ r^{2^l})
@@ -397,28 +397,6 @@ abstract contract BaseHonkVerifier is IVerifier {
397397
}
398398

399399
for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N - 1; ++i) {
400-
bool dummy_round = i >= ($LOG_N - 1);
401-
402-
if (!dummy_round) {
403-
// Update inverted denominators
404-
mem.posInvertedDenominator = (tp.shplonkZ - powers_of_evaluation_challenge[i + 1]).invert();
405-
mem.negInvertedDenominator = (tp.shplonkZ + powers_of_evaluation_challenge[i + 1]).invert();
406-
407-
// Compute the scalar multipliers for Aₗ(± r^{2ˡ}) and [Aₗ]
408-
mem.scalingFactorPos = mem.batchingChallenge * mem.posInvertedDenominator;
409-
mem.scalingFactorNeg = mem.batchingChallenge * tp.shplonkNu * mem.negInvertedDenominator;
410-
// [Aₗ] is multiplied by -v^{2l}/(z-r^{2^l}) - v^{2l+1} /(z+ r^{2^l})
411-
scalars[NUMBER_UNSHIFTED + 1 + i] = mem.scalingFactorNeg.neg() + mem.scalingFactorPos.neg();
412-
413-
// Accumulate the const term contribution given by
414-
// v^{2l} * Aₗ(r^{2ˡ}) /(z-r^{2^l}) + v^{2l+1} * Aₗ(-r^{2ˡ}) /(z+ r^{2^l})
415-
Fr accumContribution = mem.scalingFactorNeg * proof.geminiAEvaluations[i + 1];
416-
accumContribution = accumContribution + mem.scalingFactorPos * foldPosEvaluations[i + 1];
417-
mem.constantTermAccumulator = mem.constantTermAccumulator + accumContribution;
418-
// Update the running power of v
419-
mem.batchingChallenge = mem.batchingChallenge * tp.shplonkNu * tp.shplonkNu;
420-
}
421-
422400
commitments[NUMBER_UNSHIFTED + 1 + i] = convertProofPoint(proof.geminiFoldComms[i]);
423401
}
424402

0 commit comments

Comments
 (0)