From eab5b7a761e7501b4d8c093cdc302ab34c4a70f0 Mon Sep 17 00:00:00 2001 From: Artem Storozhuk Date: Thu, 20 Jul 2023 19:30:17 +0300 Subject: [PATCH] Apply formatting --- src/NovaVerifierContract.sol | 11 ++++++++--- src/blocks/EqPolynomial.sol | 7 ++++++- src/verifier/Step3.sol | 16 +++++++--------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/NovaVerifierContract.sol b/src/NovaVerifierContract.sol index ed6d570..c500a89 100644 --- a/src/NovaVerifierContract.sol +++ b/src/NovaVerifierContract.sol @@ -92,13 +92,18 @@ contract NovaVerifierContract { uint256 taus_bound_r_sat = EqPolinomialLib.evaluate(tau, r_sat, Pallas.P_MOD, Pallas.negateBase); uint256 rand_eq_bound_r_sat = EqPolinomialLib.evaluate(rand_eq, r_sat, Pallas.P_MOD, Pallas.negateBase); - uint256 claim_mem_final = Step3Lib.compute_claim_mem_final(proof, coeffs, rand_eq_bound_r_sat, Pallas.P_MOD, Pallas.negateBase); + uint256 claim_mem_final = + Step3Lib.compute_claim_mem_final(proof, coeffs, rand_eq_bound_r_sat, Pallas.P_MOD, Pallas.negateBase); - uint256 claim_outer_final = Step3Lib.compute_claim_outer_final(proof, f_U_secondary_u, coeffs, taus_bound_r_sat, Pallas.P_MOD, Pallas.negateBase); + uint256 claim_outer_final = Step3Lib.compute_claim_outer_final( + proof, f_U_secondary_u, coeffs, taus_bound_r_sat, Pallas.P_MOD, Pallas.negateBase + ); uint256 claim_inner_final = Step3Lib.compute_claim_inner_final(proof, c_inner, coeffs, Pallas.P_MOD); - return Step3Lib.final_verification(claim_mem_final, claim_outer_final, claim_inner_final, claim_sat_final, Pallas.P_MOD); + return Step3Lib.final_verification( + claim_mem_final, claim_outer_final, claim_inner_final, claim_sat_final, Pallas.P_MOD + ); } function verifyStep3PrecomputeSecondary() diff --git a/src/blocks/EqPolynomial.sol b/src/blocks/EqPolynomial.sol index a167c82..6ff3685 100644 --- a/src/blocks/EqPolynomial.sol +++ b/src/blocks/EqPolynomial.sol @@ -5,7 +5,12 @@ import "src/pasta/Vesta.sol"; import "src/pasta/Pallas.sol"; library EqPolinomialLib { - function evaluate(uint256[] memory r, uint256[] memory rx, uint256 modulus, function (uint256) returns (uint256) negateBase) internal returns (uint256) { + function evaluate( + uint256[] memory r, + uint256[] memory rx, + uint256 modulus, + function (uint256) returns (uint256) negateBase + ) internal returns (uint256) { require(r.length == rx.length, "[EqPolinomialLib.evaluatePallas] wrong input data length"); uint256 resultIter = 0; diff --git a/src/verifier/Step3.sol b/src/verifier/Step3.sol index 55376d7..bc89f24 100644 --- a/src/verifier/Step3.sol +++ b/src/verifier/Step3.sol @@ -21,9 +21,7 @@ library Step3Lib { uint256 modulus ) public view returns (bool) { uint256 actual = addmod( - addmod(claim_mem_final_expected, claim_outer_final_expected, modulus), - claim_inner_final_expected, - modulus + addmod(claim_mem_final_expected, claim_outer_final_expected, modulus), claim_inner_final_expected, modulus ); if (actual != claim_sat_final) { @@ -386,7 +384,8 @@ library Step3Lib { view returns (Vesta.VestaAffinePoint memory, Vesta.VestaAffinePoint memory, uint256[] memory, uint256) { - (uint256[] memory elementsToHash, Vesta.VestaAffinePoint memory comm_T) = prepareElementsToHashSecondary(proof, vk); + (uint256[] memory elementsToHash, Vesta.VestaAffinePoint memory comm_T) = + prepareElementsToHashSecondary(proof, vk); return foldInstanceSecondary( Abstractions.RelaxedR1CSInstance( @@ -414,11 +413,10 @@ library Step3Lib { return output[0] & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff; } - function prepareElementsToHashSecondary(Abstractions.CompressedSnark calldata proof, Abstractions.VerifierKey calldata vk) - private - view - returns (uint256[] memory, Vesta.VestaAffinePoint memory) - { + function prepareElementsToHashSecondary( + Abstractions.CompressedSnark calldata proof, + Abstractions.VerifierKey calldata vk + ) private view returns (uint256[] memory, Vesta.VestaAffinePoint memory) { uint256 counter = 0; uint256[] memory elementsToHash = new uint256[](NUM_FE_FOR_RO); elementsToHash[counter] = vk.digest;