Skip to content

Commit

Permalink
cleanup, remove unwanted changes
Browse files Browse the repository at this point in the history
  • Loading branch information
maramihali committed Feb 4, 2025
1 parent 35fa5c4 commit a950578
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,6 @@ library ZKTranscriptLib {
}
}
function bytesToFr(bytes calldata proofSection) pure returns (Fr scalar) {
scalar = FrLib.fromBytes32(bytes32(proofSection));
}
Expand Down Expand Up @@ -1578,13 +1577,13 @@ interface IVerifier {
proof.sumcheckEvaluations, tp.relationParameters, tp.alphas, powPartialEvaluation
);
Fr evaluation = ONE;
for (uint256 i = 2; i < LOG_N; i++) {
evaluation = evaluation * tp.sumCheckUChallenges[i];
}
Fr evaluation = ONE;
for (uint256 i = 2; i < LOG_N; i++) {
evaluation = evaluation * tp.sumCheckUChallenges[i];
}
grandHonkRelationSum = grandHonkRelationSum * (ONE - evaluation) + proof.libraEvaluation * tp.libraChallenge;
verified = (grandHonkRelationSum == roundTargetSum);
grandHonkRelationSum = grandHonkRelationSum * (ONE - evaluation) + proof.libraEvaluation * tp.libraChallenge;
verified = (grandHonkRelationSum == roundTargetSum);
}
// Return the new target sum for the next sumcheck round
Expand Down
4 changes: 2 additions & 2 deletions barretenberg/sol/src/honk/utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ uint256 constant Q = 21888242871839275222246405745257275088696311157297823662689
import "forge-std/console.sol";
import "forge-std/console2.sol";

error ProofLengthWrong();

function bytes32ToString(bytes32 value) pure returns (string memory result) {
bytes memory alphabet = "0123456789abcdef";

Expand Down Expand Up @@ -66,6 +64,7 @@ function logFr(string memory name, uint256 i, Fr value) pure {
// Fr utility

function bytesToFr(bytes calldata proofSection) pure returns (Fr scalar) {
require(proofSection.length == 0x20, "invalid number of bytes to construct Fr scalar");
scalar = FrLib.fromBytes32(bytes32(proofSection));
}

Expand All @@ -76,6 +75,7 @@ function convertProofPoint(Honk.G1ProofPoint memory input) pure returns (Honk.G1
}

function bytesToG1ProofPoint(bytes calldata proofSection) pure returns (Honk.G1ProofPoint memory point) {
require(proofSection.length == 0x80, "invalid number of bytes to construct a G1 point");
point = Honk.G1ProofPoint({
x_0: uint256(bytes32(proofSection[0x00:0x20])),
x_1: uint256(bytes32(proofSection[0x20:0x40])),
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/sol/test/honk/Add2ZK.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contract Add2HonkZKTest is TestBaseHonkZK {
inputs[0] = uint256(input1);
inputs[1] = uint256(input2);
inputs[2] = inputs[0] + inputs[1];
console.log("here");

bytes memory proofData = fuzzer.with_inputs(inputs).generate_proof();

(bytes32[] memory publicInputs, bytes memory proof) = splitProofHonk(proofData, PUBLIC_INPUT_COUNT);
Expand Down

0 comments on commit a950578

Please sign in to comment.