Skip to content

Commit

Permalink
Apply formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
storojs72 committed Jul 20, 2023
1 parent 1fd2801 commit eab5b7a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
11 changes: 8 additions & 3 deletions src/NovaVerifierContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 6 additions & 1 deletion src/blocks/EqPolynomial.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 7 additions & 9 deletions src/verifier/Step3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit eab5b7a

Please sign in to comment.