From f45b58e7443cd5a66ef9ece7eb69174003dd2dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Fri, 15 Mar 2024 14:56:32 +0000 Subject: [PATCH] chore: bumping to 0.25.0 --- .../circuit/contract/noirstarter/plonk_vk.sol | 477 +++++++++++++----- vite-hardhat/circuit/target/noirstarter.json | 1 + .../hooks/useOffChainVerification.tsx | 2 +- vite-hardhat/hooks/useProofGeneration.tsx | 2 +- vite-hardhat/package.json | 8 +- vite-hardhat/test/index.ts | 6 +- vite-hardhat/utils/addresses.json | 2 +- vite-hardhat/yarn.lock | 71 +-- 8 files changed, 396 insertions(+), 173 deletions(-) create mode 100644 vite-hardhat/circuit/target/noirstarter.json diff --git a/vite-hardhat/circuit/contract/noirstarter/plonk_vk.sol b/vite-hardhat/circuit/contract/noirstarter/plonk_vk.sol index f1225a4..efd5bf5 100644 --- a/vite-hardhat/circuit/contract/noirstarter/plonk_vk.sol +++ b/vite-hardhat/circuit/contract/noirstarter/plonk_vk.sol @@ -1,11 +1,11 @@ -// Verification Key Hash: 3c811ff6c5e5458bef50b83d37b0058dde9b8c9b1ac1b9e0164c84fd1d52cf0b +// Verification Key Hash: 0a780b1ad37289a4ff7390b88e6b9137dfe66c4398a869c0413345f4e60705d3 // SPDX-License-Identifier: Apache-2.0 // Copyright 2022 Aztec pragma solidity >=0.8.4; library UltraVerificationKey { function verificationKeyHash() internal pure returns(bytes32) { - return 0x3c811ff6c5e5458bef50b83d37b0058dde9b8c9b1ac1b9e0164c84fd1d52cf0b; + return 0x0a780b1ad37289a4ff7390b88e6b9137dfe66c4398a869c0413345f4e60705d3; } function loadVerificationKey(uint256 _vk, uint256 _omegaInverseLoc) internal pure { @@ -38,10 +38,10 @@ library UltraVerificationKey { mstore(add(_vk, 0x320), 0x1d270bb763cb26b2438b0760dfc7fb68fc98f87155867a2cf5c4b4ba06f637a6) // vk.SIGMA1.y mstore(add(_vk, 0x340), 0x163a9c8b67447afccc64e9ccba9d9e826ba5b1d1ddd8d6bb960f01cd1321a169) // vk.SIGMA2.x mstore(add(_vk, 0x360), 0x19256311d43dbc795f746c63b209667653a773088aba5c6b1337f435188d72c4) // vk.SIGMA2.y - mstore(add(_vk, 0x380), 0x28cb3b91580744f4f4b3d78ac8311bf59c0106d185d0d7899d5f26503a95ff2f) // vk.SIGMA3.x - mstore(add(_vk, 0x3a0), 0x0f9db04f699108828d71e012463b5a7db853b8c161344a813d77791e95794b0d) // vk.SIGMA3.y - mstore(add(_vk, 0x3c0), 0x1637b200a85a4b2b47edcdf32e00388aea6432e5b9318b0c41638e0f01f57644) // vk.SIGMA4.x - mstore(add(_vk, 0x3e0), 0x05b8c63c3283af50dea5bc8f06fa17b3846260c41cf73c00ca8606afeb6c63f7) // vk.SIGMA4.y + mstore(add(_vk, 0x380), 0x1aa81f5a2a21e5f2ce127892122ad0d3c35ac30e8556f343a85b66bb0207b055) // vk.SIGMA3.x + mstore(add(_vk, 0x3a0), 0x2402d1ec00759182e950c3193c439370013802e6819544320a08b8682727f6c6) // vk.SIGMA3.y + mstore(add(_vk, 0x3c0), 0x2e6367e7e914347a3bb11215add814670b848a66aa5c015faedb4f2cef37454f) // vk.SIGMA4.x + mstore(add(_vk, 0x3e0), 0x17609c6252f021456896ab4c02adc333912c2f58020c8e55fb2e52096185a0bf) // vk.SIGMA4.y mstore(add(_vk, 0x400), 0x02c397073c8abce6d4140c9b961209dd783bff1a1cfc999bb29859cfb16c46fc) // vk.TABLE1.x mstore(add(_vk, 0x420), 0x2b7bba2d1efffce0d033f596b4d030750599be670db593af86e1923fe8a1bb18) // vk.TABLE1.y mstore(add(_vk, 0x440), 0x2c71c58b66498f903b3bbbda3d05ce8ffb571a4b3cf83533f3f71b99a04f6e6b) // vk.TABLE2.x @@ -52,12 +52,12 @@ library UltraVerificationKey { mstore(add(_vk, 0x4e0), 0x13dd7515ccac4095302d204f06f0bff2595d77bdf72e4acdb0b0b43969860d98) // vk.TABLE4.y mstore(add(_vk, 0x500), 0x16ff3501369121d410b445929239ba057fe211dad1b706e49a3b55920fac20ec) // vk.TABLE_TYPE.x mstore(add(_vk, 0x520), 0x1e190987ebd9cf480f608b82134a00eb8007673c1ed10b834a695adf0068522a) // vk.TABLE_TYPE.y - mstore(add(_vk, 0x540), 0x143131b30c289c43efe8c03ccfa57d38ea6d89d23ae31ce5714bc5daa86a768e) // vk.ID1.x - mstore(add(_vk, 0x560), 0x0dc02c788ed33da5b66872ebf9585c8d7abc1201cd6aabd351107e383f93cd19) // vk.ID1.y + mstore(add(_vk, 0x540), 0x068ae63477ca649fffc34e466c212c208b89ff7dfebff7831183169ea0cfd64d) // vk.ID1.x + mstore(add(_vk, 0x560), 0x0d44dc459b23e94ce13c419e7feeb1d4bb61991ce667557d0ecc1ee6c29b3c3b) // vk.ID1.y mstore(add(_vk, 0x580), 0x093cf3ec6e1328ec2e9963bae3f0769bd8eb45e32cb91e2435d33daf3b336ea9) // vk.ID2.x mstore(add(_vk, 0x5a0), 0x29432aa4a2a667ca8a6781517f689f573e78164764701f7190e07eeb282d7752) // vk.ID2.y - mstore(add(_vk, 0x5c0), 0x0a7fe830f1cb7a5d49d71877dd226a0083e7ab1f26781948b36d131759f7c8c9) // vk.ID3.x - mstore(add(_vk, 0x5e0), 0x2db7a5185064e6501ef61e989895a01834ecd1ce1e8e80812bdd95f960a45e57) // vk.ID3.y + mstore(add(_vk, 0x5c0), 0x211045f9f4618ac7e73d1ba72682487e558f73d6737ff3645a9824352fb90e51) // vk.ID3.x + mstore(add(_vk, 0x5e0), 0x012d9c85c11bcc8b2407f4764c4209c06e9027d21764554f5a20e9361d4d94ba) // vk.ID3.y mstore(add(_vk, 0x600), 0x2eea648c8732596b1314fe2a4d2f05363f0c994e91cecad25835338edee2294f) // vk.ID4.x mstore(add(_vk, 0x620), 0x0ab49886c2b94bd0bd3f6ed1dbbe2cb2671d2ae51d31c1210433c3972bb64578) // vk.ID4.y mstore(add(_vk, 0x640), 0x00) // vk.contains_recursive_proof @@ -284,56 +284,49 @@ abstract contract BaseUltraVerifier { uint256 internal constant PAIRING_RHS_X_LOC = 0x3220; uint256 internal constant PAIRING_RHS_Y_LOC = 0x3240; - // ### SUCCESS FLAG MEMORY LOCATIONS - uint256 internal constant GRAND_PRODUCT_SUCCESS_FLAG = 0x3300; - uint256 internal constant ARITHMETIC_TERM_SUCCESS_FLAG = 0x3020; - uint256 internal constant BATCH_OPENING_SUCCESS_FLAG = 0x3340; - uint256 internal constant OPENING_COMMITMENT_SUCCESS_FLAG = 0x3360; - uint256 internal constant PAIRING_PREAMBLE_SUCCESS_FLAG = 0x3380; - uint256 internal constant PAIRING_SUCCESS_FLAG = 0x33a0; - uint256 internal constant RESULT_FLAG = 0x33c0; - // misc stuff - uint256 internal constant OMEGA_INVERSE_LOC = 0x3400; - uint256 internal constant C_ALPHA_SQR_LOC = 0x3420; - uint256 internal constant C_ALPHA_CUBE_LOC = 0x3440; - uint256 internal constant C_ALPHA_QUAD_LOC = 0x3460; - uint256 internal constant C_ALPHA_BASE_LOC = 0x3480; + uint256 internal constant OMEGA_INVERSE_LOC = 0x3300; + uint256 internal constant C_ALPHA_SQR_LOC = 0x3320; + uint256 internal constant C_ALPHA_CUBE_LOC = 0x3340; + uint256 internal constant C_ALPHA_QUAD_LOC = 0x3360; + uint256 internal constant C_ALPHA_BASE_LOC = 0x3380; // ### RECURSION VARIABLE MEMORY LOCATIONS - uint256 internal constant RECURSIVE_P1_X_LOC = 0x3500; - uint256 internal constant RECURSIVE_P1_Y_LOC = 0x3520; - uint256 internal constant RECURSIVE_P2_X_LOC = 0x3540; - uint256 internal constant RECURSIVE_P2_Y_LOC = 0x3560; - - uint256 internal constant PUBLIC_INPUTS_HASH_LOCATION = 0x3580; + uint256 internal constant RECURSIVE_P1_X_LOC = 0x3400; + uint256 internal constant RECURSIVE_P1_Y_LOC = 0x3420; + uint256 internal constant RECURSIVE_P2_X_LOC = 0x3440; + uint256 internal constant RECURSIVE_P2_Y_LOC = 0x3460; + uint256 internal constant PUBLIC_INPUTS_HASH_LOCATION = 0x3480; // sub-identity storage - uint256 internal constant PERMUTATION_IDENTITY = 0x3600; - uint256 internal constant PLOOKUP_IDENTITY = 0x3620; - uint256 internal constant ARITHMETIC_IDENTITY = 0x3640; - uint256 internal constant SORT_IDENTITY = 0x3660; - uint256 internal constant ELLIPTIC_IDENTITY = 0x3680; - uint256 internal constant AUX_IDENTITY = 0x36a0; - uint256 internal constant AUX_NON_NATIVE_FIELD_EVALUATION = 0x36c0; - uint256 internal constant AUX_LIMB_ACCUMULATOR_EVALUATION = 0x36e0; - uint256 internal constant AUX_RAM_CONSISTENCY_EVALUATION = 0x3700; - uint256 internal constant AUX_ROM_CONSISTENCY_EVALUATION = 0x3720; - uint256 internal constant AUX_MEMORY_EVALUATION = 0x3740; - - uint256 internal constant QUOTIENT_EVAL_LOC = 0x3760; - uint256 internal constant ZERO_POLY_INVERSE_LOC = 0x3780; + uint256 internal constant PERMUTATION_IDENTITY = 0x3500; + uint256 internal constant PLOOKUP_IDENTITY = 0x3520; + uint256 internal constant ARITHMETIC_IDENTITY = 0x3540; + uint256 internal constant SORT_IDENTITY = 0x3560; + uint256 internal constant ELLIPTIC_IDENTITY = 0x3580; + uint256 internal constant AUX_IDENTITY = 0x35a0; + uint256 internal constant AUX_NON_NATIVE_FIELD_EVALUATION = 0x35c0; + uint256 internal constant AUX_LIMB_ACCUMULATOR_EVALUATION = 0x35e0; + uint256 internal constant AUX_RAM_CONSISTENCY_EVALUATION = 0x3600; + uint256 internal constant AUX_ROM_CONSISTENCY_EVALUATION = 0x3620; + uint256 internal constant AUX_MEMORY_EVALUATION = 0x3640; + + uint256 internal constant QUOTIENT_EVAL_LOC = 0x3660; + uint256 internal constant ZERO_POLY_INVERSE_LOC = 0x3680; // when hashing public inputs we use memory at NU_CHALLENGE_INPUT_LOC_A, as the hash input size is unknown at compile time - uint256 internal constant NU_CHALLENGE_INPUT_LOC_A = 0x37a0; - uint256 internal constant NU_CHALLENGE_INPUT_LOC_B = 0x37c0; - uint256 internal constant NU_CHALLENGE_INPUT_LOC_C = 0x37e0; + uint256 internal constant NU_CHALLENGE_INPUT_LOC_A = 0x36a0; + uint256 internal constant NU_CHALLENGE_INPUT_LOC_B = 0x36c0; + uint256 internal constant NU_CHALLENGE_INPUT_LOC_C = 0x36e0; + bytes4 internal constant INVALID_VERIFICATION_KEY_SELECTOR = 0x7e5769bf; + bytes4 internal constant POINT_NOT_ON_CURVE_SELECTOR = 0xa3dad654; bytes4 internal constant PUBLIC_INPUT_INVALID_BN128_G1_POINT_SELECTOR = 0xeba9f4a6; bytes4 internal constant PUBLIC_INPUT_GE_P_SELECTOR = 0x374a972f; bytes4 internal constant MOD_EXP_FAILURE_SELECTOR = 0xf894a7bc; - bytes4 internal constant EC_SCALAR_MUL_FAILURE_SELECTOR = 0xf755f369; - bytes4 internal constant PROOF_FAILURE_SELECTOR = 0x0711fcec; + bytes4 internal constant PAIRING_PREAMBLE_FAILED_SELECTOR = 0x01882d81; + bytes4 internal constant OPENING_COMMITMENT_FAILED_SELECTOR = 0x4e719763; + bytes4 internal constant PAIRING_FAILED_SELECTOR = 0xd71fd263; uint256 internal constant ETA_INPUT_LENGTH = 0xc0; // W1, W2, W3 = 6 * 0x20 bytes @@ -357,17 +350,227 @@ abstract contract BaseUltraVerifier { // y^2 = x^3 + ax + b // for Grumpkin, a = 0 and b = -17. We use b in a custom gate relation that evaluates elliptic curve arithmetic uint256 internal constant GRUMPKIN_CURVE_B_PARAMETER_NEGATED = 17; + + error INVALID_VERIFICATION_KEY(); + error POINT_NOT_ON_CURVE(); error PUBLIC_INPUT_COUNT_INVALID(uint256 expected, uint256 actual); error PUBLIC_INPUT_INVALID_BN128_G1_POINT(); error PUBLIC_INPUT_GE_P(); error MOD_EXP_FAILURE(); - error EC_SCALAR_MUL_FAILURE(); - error PROOF_FAILURE(); + error PAIRING_PREAMBLE_FAILED(); + error OPENING_COMMITMENT_FAILED(); + error PAIRING_FAILED(); function getVerificationKeyHash() public pure virtual returns (bytes32); + /** + * @dev We assume that the verification key loaded by this function is constant as we only verify it on deployment + */ function loadVerificationKey(uint256 _vk, uint256 _omegaInverseLoc) internal pure virtual; + constructor() { + loadVerificationKey(N_LOC, OMEGA_INVERSE_LOC); + + // We verify that all of the EC points in the verification key lie on the bn128 curve. + assembly { + let q := 21888242871839275222246405745257275088696311157297823662689037894645226208583 // EC group order + + let success := 1 + + // VALIDATE Q1 + { + let x := mload(Q1_X_LOC) + let y := mload(Q1_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE Q2 + { + let x := mload(Q2_X_LOC) + let y := mload(Q2_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE Q3 + { + let x := mload(Q3_X_LOC) + let y := mload(Q3_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE Q4 + { + let x := mload(Q4_X_LOC) + let y := mload(Q4_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + mstore(0x00, x) + mstore(0x20, y) + } + // VALIDATE QM + { + let x := mload(QM_X_LOC) + let y := mload(QM_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE QC + { + let x := mload(QC_X_LOC) + let y := mload(QC_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE QARITH + { + let x := mload(QARITH_X_LOC) + let y := mload(QARITH_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE QSORT + { + let x := mload(QSORT_X_LOC) + let y := mload(QSORT_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE QELLIPTIC + { + let x := mload(QELLIPTIC_X_LOC) + let y := mload(QELLIPTIC_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE QAUX + { + let x := mload(QAUX_X_LOC) + let y := mload(QAUX_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE SIGMA1 + { + let x := mload(SIGMA1_X_LOC) + let y := mload(SIGMA1_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE SIGMA2 + { + let x := mload(SIGMA2_X_LOC) + let y := mload(SIGMA2_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE SIGMA3 + { + let x := mload(SIGMA3_X_LOC) + let y := mload(SIGMA3_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE SIGMA4 + { + let x := mload(SIGMA4_X_LOC) + let y := mload(SIGMA4_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE TABLE1 + { + let x := mload(TABLE1_X_LOC) + let y := mload(TABLE1_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE TABLE2 + { + let x := mload(TABLE2_X_LOC) + let y := mload(TABLE2_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE TABLE3 + { + let x := mload(TABLE3_X_LOC) + let y := mload(TABLE3_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE TABLE4 + { + let x := mload(TABLE4_X_LOC) + let y := mload(TABLE4_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE TABLE_TYPE + { + let x := mload(TABLE_TYPE_X_LOC) + let y := mload(TABLE_TYPE_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE ID1 + { + let x := mload(ID1_X_LOC) + let y := mload(ID1_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE ID2 + { + let x := mload(ID2_X_LOC) + let y := mload(ID2_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE ID3 + { + let x := mload(ID3_X_LOC) + let y := mload(ID3_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + // VALIDATE ID4 + { + let x := mload(ID4_X_LOC) + let y := mload(ID4_Y_LOC) + let xx := mulmod(x, x, q) + // validate on curve + success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + } + + if iszero(success) { + mstore(0x0, INVALID_VERIFICATION_KEY_SELECTOR) + revert(0x00, 0x04) + } + } + } + /** * @notice Verify a Ultra Plonk proof * @param _proof - The serialized proof @@ -1786,7 +1989,10 @@ abstract contract BaseUltraVerifier { let y := mload(T1_Y_LOC) let xx := mulmod(x, x, q) // validate on curve - success := eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)) + if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) { + mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR) + revert(0x00, 0x04) + } mstore(ACCUMULATOR_X_LOC, x) mstore(add(ACCUMULATOR_X_LOC, 0x20), y) } @@ -1796,13 +2002,16 @@ abstract contract BaseUltraVerifier { let y := mload(T2_Y_LOC) // 0x1420 let xx := mulmod(x, x, q) // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) { + mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR) + revert(0x00, 0x04) + } mstore(0x00, x) mstore(0x20, y) } mstore(0x40, mload(ZETA_POW_N_LOC)) // accumulator_2 = [T2].zeta^n - success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40)) + success := staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40) // accumulator = [T1] + accumulator_2 success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40)) @@ -1812,7 +2021,10 @@ abstract contract BaseUltraVerifier { let y := mload(T3_Y_LOC) let xx := mulmod(x, x, q) // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) { + mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR) + revert(0x00, 0x04) + } mstore(0x00, x) mstore(0x20, y) } @@ -1828,7 +2040,10 @@ abstract contract BaseUltraVerifier { let y := mload(T4_Y_LOC) let xx := mulmod(x, x, q) // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) { + mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR) + revert(0x00, 0x04) + } mstore(0x00, x) mstore(0x20, y) } @@ -1844,7 +2059,10 @@ abstract contract BaseUltraVerifier { let y := mload(W1_Y_LOC) let xx := mulmod(x, x, q) // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) { + mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR) + revert(0x00, 0x04) + } mstore(0x00, x) mstore(0x20, y) } @@ -1860,7 +2078,10 @@ abstract contract BaseUltraVerifier { let y := mload(W2_Y_LOC) let xx := mulmod(x, x, q) // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) { + mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR) + revert(0x00, 0x04) + } mstore(0x00, x) mstore(0x20, y) } @@ -1876,7 +2097,10 @@ abstract contract BaseUltraVerifier { let y := mload(W3_Y_LOC) let xx := mulmod(x, x, q) // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) { + mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR) + revert(0x00, 0x04) + } mstore(0x00, x) mstore(0x20, y) } @@ -1892,7 +2116,10 @@ abstract contract BaseUltraVerifier { let y := mload(W4_Y_LOC) let xx := mulmod(x, x, q) // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) { + mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR) + revert(0x00, 0x04) + } mstore(0x00, x) mstore(0x20, y) } @@ -1908,7 +2135,10 @@ abstract contract BaseUltraVerifier { let y := mload(S_Y_LOC) let xx := mulmod(x, x, q) // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) { + mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR) + revert(0x00, 0x04) + } mstore(0x00, x) mstore(0x20, y) } @@ -1924,7 +2154,10 @@ abstract contract BaseUltraVerifier { let y := mload(Z_Y_LOC) let xx := mulmod(x, x, q) // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) { + mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR) + revert(0x00, 0x04) + } mstore(0x00, x) mstore(0x20, y) } @@ -1940,7 +2173,10 @@ abstract contract BaseUltraVerifier { let y := mload(Z_LOOKUP_Y_LOC) let xx := mulmod(x, x, q) // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) { + mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR) + revert(0x00, 0x04) + } mstore(0x00, x) mstore(0x20, y) } @@ -1955,8 +2191,7 @@ abstract contract BaseUltraVerifier { let x := mload(Q1_X_LOC) let y := mload(Q1_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -1971,8 +2206,7 @@ abstract contract BaseUltraVerifier { let x := mload(Q2_X_LOC) let y := mload(Q2_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -1987,8 +2221,7 @@ abstract contract BaseUltraVerifier { let x := mload(Q3_X_LOC) let y := mload(Q3_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2003,8 +2236,7 @@ abstract contract BaseUltraVerifier { let x := mload(Q4_X_LOC) let y := mload(Q4_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2019,8 +2251,7 @@ abstract contract BaseUltraVerifier { let x := mload(QM_X_LOC) let y := mload(QM_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2035,8 +2266,7 @@ abstract contract BaseUltraVerifier { let x := mload(QC_X_LOC) let y := mload(QC_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2051,8 +2281,7 @@ abstract contract BaseUltraVerifier { let x := mload(QARITH_X_LOC) let y := mload(QARITH_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2067,8 +2296,7 @@ abstract contract BaseUltraVerifier { let x := mload(QSORT_X_LOC) let y := mload(QSORT_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2083,8 +2311,7 @@ abstract contract BaseUltraVerifier { let x := mload(QELLIPTIC_X_LOC) let y := mload(QELLIPTIC_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2099,8 +2326,7 @@ abstract contract BaseUltraVerifier { let x := mload(QAUX_X_LOC) let y := mload(QAUX_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2115,8 +2341,7 @@ abstract contract BaseUltraVerifier { let x := mload(SIGMA1_X_LOC) let y := mload(SIGMA1_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2131,8 +2356,7 @@ abstract contract BaseUltraVerifier { let x := mload(SIGMA2_X_LOC) let y := mload(SIGMA2_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2147,8 +2371,7 @@ abstract contract BaseUltraVerifier { let x := mload(SIGMA3_X_LOC) let y := mload(SIGMA3_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2163,8 +2386,7 @@ abstract contract BaseUltraVerifier { let x := mload(SIGMA4_X_LOC) let y := mload(SIGMA4_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2179,8 +2401,7 @@ abstract contract BaseUltraVerifier { let x := mload(TABLE1_X_LOC) let y := mload(TABLE1_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2195,8 +2416,7 @@ abstract contract BaseUltraVerifier { let x := mload(TABLE2_X_LOC) let y := mload(TABLE2_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2211,8 +2431,7 @@ abstract contract BaseUltraVerifier { let x := mload(TABLE3_X_LOC) let y := mload(TABLE3_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2227,8 +2446,7 @@ abstract contract BaseUltraVerifier { let x := mload(TABLE4_X_LOC) let y := mload(TABLE4_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2243,8 +2461,7 @@ abstract contract BaseUltraVerifier { let x := mload(TABLE_TYPE_X_LOC) let y := mload(TABLE_TYPE_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2259,8 +2476,7 @@ abstract contract BaseUltraVerifier { let x := mload(ID1_X_LOC) let y := mload(ID1_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2275,8 +2491,7 @@ abstract contract BaseUltraVerifier { let x := mload(ID2_X_LOC) let y := mload(ID2_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2291,8 +2506,7 @@ abstract contract BaseUltraVerifier { let x := mload(ID3_X_LOC) let y := mload(ID3_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2307,8 +2521,7 @@ abstract contract BaseUltraVerifier { let x := mload(ID4_X_LOC) let y := mload(ID4_Y_LOC) let xx := mulmod(x, x, q) - // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + // Verification key fields verified to be on curve at contract deployment mstore(0x00, x) mstore(0x20, y) } @@ -2496,7 +2709,10 @@ abstract contract BaseUltraVerifier { // accumulator = accumulator + accumulator_2 success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40)) - mstore(OPENING_COMMITMENT_SUCCESS_FLAG, success) + if iszero(success) { + mstore(0x0, OPENING_COMMITMENT_FAILED_SELECTOR) + revert(0x00, 0x04) + } } /** @@ -2511,13 +2727,16 @@ abstract contract BaseUltraVerifier { let y := mload(PI_Z_Y_LOC) let xx := mulmod(x, x, q) // validate on curve - success := eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q)) + if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) { + mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR) + revert(0x00, 0x04) + } mstore(0x00, x) mstore(0x20, y) } // compute zeta.[PI_Z] and add into accumulator mstore(0x40, zeta) - success := and(success, staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40)) + success := staticcall(gas(), 7, 0x00, 0x60, ACCUMULATOR2_X_LOC, 0x40) // accumulator = accumulator + accumulator_2 success := and(success, staticcall(gas(), 6, ACCUMULATOR_X_LOC, 0x80, ACCUMULATOR_X_LOC, 0x40)) @@ -2527,7 +2746,10 @@ abstract contract BaseUltraVerifier { let y := mload(PI_Z_OMEGA_Y_LOC) let xx := mulmod(x, x, q) // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) { + mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR) + revert(0x00, 0x04) + } mstore(0x00, x) mstore(0x20, y) } @@ -2555,7 +2777,10 @@ abstract contract BaseUltraVerifier { let y := mload(RECURSIVE_P1_Y_LOC) let xx := mulmod(x, x, q) // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) { + mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR) + revert(0x00, 0x04) + } mstore(0x00, x) mstore(0x20, y) } @@ -2569,7 +2794,10 @@ abstract contract BaseUltraVerifier { let y := mload(RECURSIVE_P2_Y_LOC) let xx := mulmod(x, x, q) // validate on curve - success := and(success, eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) + if iszero(eq(mulmod(y, y, q), addmod(mulmod(x, xx, q), 3, q))) { + mstore(0x0, POINT_NOT_ON_CURVE_SELECTOR) + revert(0x00, 0x04) + } mstore(0x00, x) mstore(0x20, y) } @@ -2589,10 +2817,9 @@ abstract contract BaseUltraVerifier { } if iszero(success) { - mstore(0x0, EC_SCALAR_MUL_FAILURE_SELECTOR) + mstore(0x0, PAIRING_PREAMBLE_FAILED_SELECTOR) revert(0x00, 0x04) } - mstore(PAIRING_PREAMBLE_SUCCESS_FLAG, success) } /** @@ -2617,18 +2844,12 @@ abstract contract BaseUltraVerifier { mstore(0x160, mload(G2X_Y1_LOC)) success := staticcall(gas(), 8, 0x00, 0x180, 0x00, 0x20) - mstore(PAIRING_SUCCESS_FLAG, success) - mstore(RESULT_FLAG, mload(0x00)) - } - if iszero( - and( - and(and(mload(PAIRING_SUCCESS_FLAG), mload(RESULT_FLAG)), mload(PAIRING_PREAMBLE_SUCCESS_FLAG)), - mload(OPENING_COMMITMENT_SUCCESS_FLAG) - ) - ) { - mstore(0x0, PROOF_FAILURE_SELECTOR) - revert(0x00, 0x04) + if iszero(and(success, mload(0x00))) { + mstore(0x0, PAIRING_FAILED_SELECTOR) + revert(0x00, 0x04) + } } + { mstore(0x00, 0x01) return(0x00, 0x20) // Proof succeeded! diff --git a/vite-hardhat/circuit/target/noirstarter.json b/vite-hardhat/circuit/target/noirstarter.json new file mode 100644 index 0000000..3f986f3 --- /dev/null +++ b/vite-hardhat/circuit/target/noirstarter.json @@ -0,0 +1 @@ +{"noir_version":"0.24.0+9544813fabbd18a87dd88456e6a5b781bd0cf008","hash":5369864856198621426,"abi":{"parameters":[{"name":"x","type":{"kind":"field"},"visibility":"private"},{"name":"y","type":{"kind":"field"},"visibility":"public"}],"param_witnesses":{"x":[{"start":0,"end":1}],"y":[{"start":1,"end":2}]},"return_type":null,"return_witnesses":[]},"bytecode":"H4sIAAAAAAAA/7WUPQ7DIAyFTZNWHXsUm59gtlylqOT+J6iqqqmCiDfMW2CwzGc/mxkArnDWtJ/rfjpcvC/RFnL0RJsyB/QhL0xMgcPLsnOFPceUU8RE3hXaQnIb/lTnwj6RUeS66HHht2dG6KVpeol9Ik1m03j+n4WbwF/Htfd7FfdWrLV9t2V5CJwnD1ZFmBFmTgPyzqC7vCPqnvU9QhAGYkRPsVMGjuUxArP0kcAH+JIvC64FAAA=","debug_symbols":"lc9BCoAgEIXhu7y1i0or8CrRYioDQVRUghDvntIJ3M0/fJuXYdxJSTsbITMGyC0jerKtYqKQIMXKoOwFOfPCcGuj6m8pO8PYx6c+zvu46OE1HgqaDqPa8Jrp9f9ZPg==","file_map":{"46":{"source":"fn main(x : Field, y : pub Field) {\n assert(x != y);\n}\n","path":"/Users/zpedro/Documents/GitHub/noir-starter/vite-hardhat/circuit/src/main.nr"}}} \ No newline at end of file diff --git a/vite-hardhat/hooks/useOffChainVerification.tsx b/vite-hardhat/hooks/useOffChainVerification.tsx index abbaf80..13b85fb 100644 --- a/vite-hardhat/hooks/useOffChainVerification.tsx +++ b/vite-hardhat/hooks/useOffChainVerification.tsx @@ -10,7 +10,7 @@ export function useOffChainVerification(noir?: Noir, proofData?: ProofData) { useEffect(() => { if (!proofData || !noir) return; - toast.promise(noir.verifyFinalProof(proofData), { + toast.promise(noir.verifyProof(proofData), { pending: 'Verifying proof off-chain', success: 'Proof verified off-chain', error: 'Error verifying proof off-chain', diff --git a/vite-hardhat/hooks/useProofGeneration.tsx b/vite-hardhat/hooks/useProofGeneration.tsx index 080f9b2..3eb9f38 100644 --- a/vite-hardhat/hooks/useProofGeneration.tsx +++ b/vite-hardhat/hooks/useProofGeneration.tsx @@ -20,7 +20,7 @@ export function useProofGeneration(inputs?: { [key: string]: string }) { error: 'Error initializing Noir', }); - const data = await toast.promise(noir.generateFinalProof(inputs), { + const data = await toast.promise(noir.generateProof(inputs), { pending: 'Generating proof', success: 'Proof generated', error: 'Error generating proof', diff --git a/vite-hardhat/package.json b/vite-hardhat/package.json index e8df0d7..82e2688 100644 --- a/vite-hardhat/package.json +++ b/vite-hardhat/package.json @@ -12,10 +12,10 @@ "test": "NODE_OPTIONS='--experimental-loader ts-node/esm/transpile-only' hardhat test" }, "dependencies": { - "@noir-lang/backend_barretenberg": "^0.23.0", - "@noir-lang/noir_js": "^0.23.0", - "@noir-lang/noir_wasm": "^0.23.0", - "@noir-lang/types": "^0.23.0", + "@noir-lang/backend_barretenberg": "^0.25.0", + "@noir-lang/noir_js": "^0.25.0", + "@noir-lang/noir_wasm": "^0.25.0", + "@noir-lang/types": "^0.25.0", "@nomicfoundation/hardhat-network-helpers": "^1.0.0", "@nomicfoundation/hardhat-toolbox-viem": "1.0.0", "@nomicfoundation/hardhat-viem": "1.0.0", diff --git a/vite-hardhat/test/index.ts b/vite-hardhat/test/index.ts index 17564be..6b4ef45 100644 --- a/vite-hardhat/test/index.ts +++ b/vite-hardhat/test/index.ts @@ -38,19 +38,19 @@ describe('It compiles noir program code, receiving circuit bytes and abi object. it('Should generate valid proof for correct input', async () => { const input = { x: 1, y: 2 }; // Generate proof - correctProof = await noir.generateFinalProof(input); + correctProof = await noir.generateProof(input); expect(correctProof.proof instanceof Uint8Array).to.be.true; }); it('Should verify valid proof for correct input', async () => { - const verification = await noir.verifyFinalProof(correctProof); + const verification = await noir.verifyProof(correctProof); expect(verification).to.be.true; }); it('Should fail to generate valid proof for incorrect input', async () => { try { const input = { x: 1, y: 1 }; - const incorrectProof = await noir.generateFinalProof(input); + const incorrectProof = await noir.generateProof(input); } catch (err) { // TODO(Ze): Not sure how detailed we want this test to be expect(err instanceof Error).to.be.true; diff --git a/vite-hardhat/utils/addresses.json b/vite-hardhat/utils/addresses.json index 5f201f8..1e5eeb4 100644 --- a/vite-hardhat/utils/addresses.json +++ b/vite-hardhat/utils/addresses.json @@ -1 +1 @@ -{"chainId":31337,"verifier":"0x0165878a594ca255338adfa4d48449f69242eb8f"} \ No newline at end of file +{"chainId":31337,"verifier":"0x5fbdb2315678afecb367f032d93f642f64180aa3"} \ No newline at end of file diff --git a/vite-hardhat/yarn.lock b/vite-hardhat/yarn.lock index 5befd95..9757b06 100644 --- a/vite-hardhat/yarn.lock +++ b/vite-hardhat/yarn.lock @@ -12,10 +12,10 @@ resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.9.4.tgz#aae21cb858bbb0411949d5b7b3051f4209043f62" integrity sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw== -"@aztec/bb.js@0.19.0": - version "0.19.0" - resolved "https://registry.yarnpkg.com/@aztec/bb.js/-/bb.js-0.19.0.tgz#1c9c1d386954398e99c024425d9f282955389d59" - integrity sha512-I28AdggGl/5FjOEdOCYXviH0TnQUjEl2B95sux1kVJj8MiwD1rmx/tuaQBvUwRKe3hg/4C1KQRYWFn4vwlhg3A== +"@aztec/bb.js@0.26.3": + version "0.26.3" + resolved "https://registry.yarnpkg.com/@aztec/bb.js/-/bb.js-0.26.3.tgz#a148c3c8b35d78a92568f2f7ce9c05a8de4ead22" + integrity sha512-iZXQyjVVgDYQt77IggxC1MUZDBd68Q9aXepclq1kv4Ube1wllmlZ3+NGKZx/ma8yd24ytYGtIx/7kY8L4SbdkQ== dependencies: comlink "^4.4.1" commander "^10.0.1" @@ -756,47 +756,48 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@noir-lang/acvm_js@0.39.0": - version "0.39.0" - resolved "https://registry.yarnpkg.com/@noir-lang/acvm_js/-/acvm_js-0.39.0.tgz#8d05c0fee40b378beeede6f68e6e243e43bd74d2" - integrity sha512-Y77qyfamkYSIzzKFkewTwExzTvxYcRd1XBqo950ti4uKMdu18GthkOssqC7CGacwx5PdrdOGFGRJbVtjoXeKIg== +"@noir-lang/acvm_js@0.41.0": + version "0.41.0" + resolved "https://registry.yarnpkg.com/@noir-lang/acvm_js/-/acvm_js-0.41.0.tgz#7636ac018e26271c113309cd8883d95aa661ac2a" + integrity sha512-/FST2lHKOpe/US6UFtTYSJZFtmvTjTtW7zBkcp1VaEn00SqezJszuwv9oQOfVz7F59LBL3b4+JFi5oIHlzef0g== -"@noir-lang/backend_barretenberg@0.23.0": - version "0.23.0" - resolved "https://registry.yarnpkg.com/@noir-lang/backend_barretenberg/-/backend_barretenberg-0.23.0.tgz#19a85be2c4f83b87e8b4c03eb4e8f3e108304d51" - integrity sha512-amehMEE8kEMEbuxvPT1H9BwVQyEFFip6ajHWhgJjw/PkNB8tBzP+ekVrcEvxVerAKNikfzCEWS/kV7CEWcQNzA== +"@noir-lang/backend_barretenberg@^0.25.0": + version "0.25.0" + resolved "https://registry.yarnpkg.com/@noir-lang/backend_barretenberg/-/backend_barretenberg-0.25.0.tgz#4f4abf5bbdcb5d88fa4dbb29f68eddb513a3070c" + integrity sha512-Dipgpc1DmxLAtB4CEXwOQw8EA/DLqALD+F3cezwuo4vCiB+pvALaUBTDSco6TP1VINRzelzWvUL5BIEoEAlByQ== dependencies: - "@aztec/bb.js" "0.19.0" - "@noir-lang/types" "0.23.0" + "@aztec/bb.js" "0.26.3" + "@noir-lang/types" "0.25.0" fflate "^0.8.0" -"@noir-lang/noir_js@0.23.0": - version "0.23.0" - resolved "https://registry.yarnpkg.com/@noir-lang/noir_js/-/noir_js-0.23.0.tgz#fd85e4b3f1434b8ff811ec4ceb19a5814474289f" - integrity sha512-eblqgm0PjgptYG+TkK2Dmp/Y2fEhjM5sqMam+QUQHn/2WmC+8/LO2a0FQU0t1432BGCII6/TfojQzgQobuXJAw== +"@noir-lang/noir_js@^0.25.0": + version "0.25.0" + resolved "https://registry.yarnpkg.com/@noir-lang/noir_js/-/noir_js-0.25.0.tgz#7ff8f0ffc2d1fe0e180156b2c2131374b0d544be" + integrity sha512-hCfTfM6QU7s2ZC8rxf0JEm+7bHIsLnH1FHsw7W2cQB9g69U4HBs0cY7Sc8XUHPpabxQ8VC1kcNTsoQwDvocF0g== dependencies: - "@noir-lang/acvm_js" "0.39.0" - "@noir-lang/noirc_abi" "0.23.0" - "@noir-lang/types" "0.23.0" + "@noir-lang/acvm_js" "0.41.0" + "@noir-lang/noirc_abi" "0.25.0" + "@noir-lang/types" "0.25.0" -"@noir-lang/noir_wasm@0.23.0": - version "0.23.0" - resolved "https://registry.yarnpkg.com/@noir-lang/noir_wasm/-/noir_wasm-0.23.0.tgz#5fe49f31d7fd67963d166439f7402a09668aec95" - integrity sha512-HL78frUo60bKrUaxOAJQtyrmBWUyiQbSp4yQkh9A/vFAnEhxehDwd8peCGKMZKX66JpRccClv52zyb5O/ECE4g== +"@noir-lang/noir_wasm@^0.25.0": + version "0.25.0" + resolved "https://registry.yarnpkg.com/@noir-lang/noir_wasm/-/noir_wasm-0.25.0.tgz#20641eba0c99583e13cbd77d0a1d82f409edb4b9" + integrity sha512-S8x3E9q+UqtvkLO76IDr2f6st8/3VihtHDioR+TwI10SO2LkKssq1QLNLAyrE0P8BFjZNHlcchbSjOylKDQp9A== dependencies: + "@noir-lang/types" "0.25.0" pako "^2.1.0" -"@noir-lang/noirc_abi@0.23.0": - version "0.23.0" - resolved "https://registry.yarnpkg.com/@noir-lang/noirc_abi/-/noirc_abi-0.23.0.tgz#47dcfd724e205eadc3a6d4ebab9b11355cb0d0cb" - integrity sha512-MYBkj6hSpiimlcBmX6n/hY+y2Kk39Qh8qre5c41GZPvmC88f7MqhAdDTSsfrFnNg1pvpY5UX6/G1D8jEkT11qA== - -"@noir-lang/types@0.23.0": - version "0.23.0" - resolved "https://registry.yarnpkg.com/@noir-lang/types/-/types-0.23.0.tgz#a99c7bc6eaffbf9e1209d1cb2ca7ecd0f047f62f" - integrity sha512-jgA4thao714WHiXVE3KS7Y2vQnH3gvsVM1cO1kQsihgmqX5VO+Kk6bI3Yck9HUvAqgcjJgSeOeBtbdTYSzjzkw== +"@noir-lang/noirc_abi@0.25.0": + version "0.25.0" + resolved "https://registry.yarnpkg.com/@noir-lang/noirc_abi/-/noirc_abi-0.25.0.tgz#098eea2bf65a0a2dc180041330c26a089c39709c" + integrity sha512-uoNfRgGP9qAfovZKrtfZIE6cKCH2OiuKrsCRvNvSxx2Nv57sN93YYpKF+g1726Y6d/a5vxbxP6z5+uvoEALkDw== dependencies: - "@noir-lang/noirc_abi" "0.23.0" + "@noir-lang/types" "0.25.0" + +"@noir-lang/types@0.25.0", "@noir-lang/types@^0.25.0": + version "0.25.0" + resolved "https://registry.yarnpkg.com/@noir-lang/types/-/types-0.25.0.tgz#e05843ba2850e222c2c1e7b1ed5634460bfa7c9f" + integrity sha512-kt1R0vd/J116Q8dTZt3iIEg4d17wzvXOHmw5HbfYbWnFbepA8AlAneEDpYusmZoTwFcxqPKiZu45aUrezFd+kQ== "@nomicfoundation/ethereumjs-block@5.0.2": version "5.0.2"