diff --git a/barretenberg/Earthfile b/barretenberg/Earthfile index 095cfc97f21d..a77cede937a7 100644 --- a/barretenberg/Earthfile +++ b/barretenberg/Earthfile @@ -115,6 +115,8 @@ barretenberg-acir-tests-bb.js: RUN BIN=../ts/dest/node/main.js FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh 6_array assert_statement # Run a single arbitrary test not involving recursion through bb.js for MegaHonk RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_mega_honk ./run_acir_tests.sh 6_array + # Run fold_basic test through bb.js which runs ClientIVC on fold basic + RUN BIN=../ts/dest/node/main.js FLOW=fold_and_verify_program ./run_acir_tests.sh fold_basic # Run 1_mul through bb.js build, all_cmds flow, to test all cli args. RUN BIN=../ts/dest/node/main.js FLOW=all_cmds ./run_acir_tests.sh 1_mul # TODO(https://github.com/AztecProtocol/aztec-packages/issues/6672) diff --git a/barretenberg/cpp/src/barretenberg/bb/get_bn254_crs.cpp b/barretenberg/cpp/src/barretenberg/bb/get_bn254_crs.cpp index a0cc5f3b06d5..12d40ce387ce 100644 --- a/barretenberg/cpp/src/barretenberg/bb/get_bn254_crs.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/get_bn254_crs.cpp @@ -38,7 +38,7 @@ std::vector get_bn254_g1_data(const std::filesystem::path& p size_t g1_file_size = get_file_size(g1_path); if (g1_file_size >= num_points * 64 && g1_file_size % 64 == 0) { - vinfo("using cached crs of size ", std::to_string(g1_file_size / 64), " at ", g1_path); + vinfo("using cached bn254 crs of size ", std::to_string(g1_file_size / 64), " at ", g1_path); auto data = read_file(g1_path, g1_file_size); auto points = std::vector(num_points); for (size_t i = 0; i < num_points; ++i) { @@ -47,7 +47,7 @@ std::vector get_bn254_g1_data(const std::filesystem::path& p return points; } - vinfo("downloading crs..."); + vinfo("downloading bn254 crs..."); auto data = download_bn254_g1_data(num_points); write_file(g1_path, data); diff --git a/barretenberg/cpp/src/barretenberg/bb/get_grumpkin_crs.cpp b/barretenberg/cpp/src/barretenberg/bb/get_grumpkin_crs.cpp index 1942c278ea4a..69cf8761f7a9 100644 --- a/barretenberg/cpp/src/barretenberg/bb/get_grumpkin_crs.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/get_grumpkin_crs.cpp @@ -34,7 +34,7 @@ std::vector get_grumpkin_g1_data(const std::file } if (size >= num_points) { auto file = path / "grumpkin_g1.dat"; - vinfo("using cached crs at: ", file); + vinfo("using cached grumpkin crs of size ", size, " at: ", file); auto data = read_file(file, 28 + num_points * 64); auto points = std::vector(num_points); auto size_of_points_in_bytes = num_points * 64; diff --git a/barretenberg/cpp/src/barretenberg/bb/main.cpp b/barretenberg/cpp/src/barretenberg/bb/main.cpp index d318d9e337af..cf5e1abaf7f3 100644 --- a/barretenberg/cpp/src/barretenberg/bb/main.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/main.cpp @@ -456,10 +456,10 @@ bool foldAndVerifyProgram(const std::string& bytecodePath, const std::string& wi auto stack_item = program_stack.back(); // Construct a bberg circuit from the acir representation - auto circuit = acir_format::create_circuit( - stack_item.constraints, 0, stack_item.witness, false, ivc.goblin.op_queue); + auto builder = acir_format::create_circuit( + stack_item.constraints, 0, stack_item.witness, /*honk_recursion=*/false, ivc.goblin.op_queue); - ivc.accumulate(circuit); + ivc.accumulate(builder); program_stack.pop_back(); } diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.cpp index 6e03f99ec3c2..ea8bef00035d 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.cpp @@ -107,6 +107,7 @@ WASM_EXPORT void acir_fold_and_verify_program_stack(uint8_t const* acir_vec, uin program_stack.pop_back(); } *result = ivc.prove_and_verify(); + info("acir_fold_and_verify_program_stack result: ", *result); } WASM_EXPORT void acir_prove_and_verify_mega_honk(uint8_t const* acir_vec, uint8_t const* witness_vec, bool* result) diff --git a/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp b/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp index d33872ad1bdb..a0ab01417b04 100644 --- a/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp +++ b/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp @@ -45,7 +45,7 @@ TEST(reference_string, mem_bn254_file_consistency) 0); } -TEST(reference_string, DISABLED_mem_grumpkin_file_consistency) +TEST(reference_string, mem_grumpkin_file_consistency) { // Load 1024 from file. auto file_crs = FileCrsFactory("../srs_db/grumpkin", 1024); diff --git a/barretenberg/cpp/src/barretenberg/srs/factories/mem_grumpkin_crs_factory.cpp b/barretenberg/cpp/src/barretenberg/srs/factories/mem_grumpkin_crs_factory.cpp index 4a79ec26e620..88ab4bc3b169 100644 --- a/barretenberg/cpp/src/barretenberg/srs/factories/mem_grumpkin_crs_factory.cpp +++ b/barretenberg/cpp/src/barretenberg/srs/factories/mem_grumpkin_crs_factory.cpp @@ -54,7 +54,10 @@ MemGrumpkinCrsFactory::MemGrumpkinCrsFactory(std::vector> MemGrumpkinCrsFactory::get_prover_crs(size_t degree) { if (prover_crs_->get_monomial_size() < degree) { - throw_or_abort("prover trying to get too many points in MemGrumpkinCrsFactory!"); + throw_or_abort(format("prover trying to get too many points in MemGrumpkinCrsFactory - ", + degree, + " is more than ", + prover_crs_->get_monomial_size())); } return prover_crs_; } @@ -62,7 +65,10 @@ std::shared_ptr> MemGrumpkinCrsFactory:: std::shared_ptr> MemGrumpkinCrsFactory::get_verifier_crs(size_t degree) { if (prover_crs_->get_monomial_size() < degree) { - throw_or_abort("verifier trying to get too many points in MemGrumpkinCrsFactory!"); + throw_or_abort(format("verifier trying to get too many points in MemGrumpkinCrsFactory - ", + degree, + " is more than ", + prover_crs_->get_monomial_size())); } return verifier_crs_; } diff --git a/barretenberg/cpp/src/barretenberg/srs/global_crs.cpp b/barretenberg/cpp/src/barretenberg/srs/global_crs.cpp index 08e18c8a3f4d..40c5fefd02ce 100644 --- a/barretenberg/cpp/src/barretenberg/srs/global_crs.cpp +++ b/barretenberg/cpp/src/barretenberg/srs/global_crs.cpp @@ -44,7 +44,7 @@ void init_grumpkin_crs_factory(std::string crs_path) std::shared_ptr> get_bn254_crs_factory() { if (!crs_factory) { - throw_or_abort("You need to initalize the global CRS with a call to init_crs_factory(...)!"); + throw_or_abort("You need to initialize the global CRS with a call to init_crs_factory(...)!"); } return crs_factory; } @@ -52,7 +52,7 @@ std::shared_ptr> get_bn254_crs_factory() std::shared_ptr> get_grumpkin_crs_factory() { if (!grumpkin_crs_factory) { - throw_or_abort("You need to initalize the global CRS with a call to init_grumpkin_crs_factory(...)!"); + throw_or_abort("You need to initialize the global CRS with a call to init_grumpkin_crs_factory(...)!"); } return grumpkin_crs_factory; } diff --git a/barretenberg/ts/src/main.ts b/barretenberg/ts/src/main.ts index 6b17d0434951..188db2733e0c 100755 --- a/barretenberg/ts/src/main.ts +++ b/barretenberg/ts/src/main.ts @@ -1,5 +1,6 @@ #!/usr/bin/env node import { Crs, Barretenberg, RawBuffer } from './index.js'; +import { GrumpkinCrs } from './crs/node/index.js'; import createDebug from 'debug'; import { readFileSync, writeFileSync } from 'fs'; import { gunzipSync } from 'zlib'; @@ -9,13 +10,13 @@ import path from 'path'; createDebug.log = console.error.bind(console); const debug = createDebug('bb.js'); -// Maximum we support in node and the browser is 2^19. -// This is because both node and browser use barretenberg.wasm. +// Maximum circuit size for plonk we support in node and the browser is 2^19. +// This is because both node and browser use barretenberg.wasm which has a 4GB memory limit. // // This is not a restriction in the bb binary and one should be // aware of this discrepancy, when creating proofs in bb versus // creating the same proofs in the node CLI. -const MAX_CIRCUIT_SIZE = 2 ** 19; +const MAX_ULTRAPLONK_CIRCUIT_SIZE_IN_WASM = 2 ** 19; const threads = +process.env.HARDWARE_CONCURRENCY! || undefined; function getBytecode(bytecodePath: string) { @@ -32,7 +33,7 @@ function getBytecode(bytecodePath: string) { return decompressed; } -async function getGates(bytecodePath: string, honkRecursion: boolean, api: Barretenberg) { +async function getGatesUltra(bytecodePath: string, honkRecursion: boolean, api: Barretenberg) { const { total } = await computeCircuitSize(bytecodePath, honkRecursion, api); return total; } @@ -50,33 +51,66 @@ async function computeCircuitSize(bytecodePath: string, honkRecursion: boolean, return { exact, total, subgroup }; } -async function init(bytecodePath: string, crsPath: string, subgroupSizeOverride = -1, honkRecursion = false) { +async function initUltraPlonk(bytecodePath: string, crsPath: string, subgroupSizeOverride = -1, honkRecursion = false) { const api = await Barretenberg.new({ threads }); - const circuitSize = await getGates(bytecodePath, honkRecursion, api); + const circuitSize = await getGatesUltra(bytecodePath, honkRecursion, api); // TODO(https://github.com/AztecProtocol/barretenberg/issues/811): remove subgroupSizeOverride hack for goblin const subgroupSize = Math.max(subgroupSizeOverride, Math.pow(2, Math.ceil(Math.log2(circuitSize)))); - if (subgroupSize > MAX_CIRCUIT_SIZE) { - throw new Error(`Circuit size of ${subgroupSize} exceeds max supported of ${MAX_CIRCUIT_SIZE}`); - } + if (subgroupSize > MAX_ULTRAPLONK_CIRCUIT_SIZE_IN_WASM) { + throw new Error(`Circuit size of ${subgroupSize} exceeds max supported of ${MAX_ULTRAPLONK_CIRCUIT_SIZE_IN_WASM}`); + } debug(`circuit size: ${circuitSize}`); debug(`subgroup size: ${subgroupSize}`); debug('loading crs...'); // Plus 1 needed! (Move +1 into Crs?) const crs = await Crs.new(subgroupSize + 1, crsPath); - // Important to init slab allocator as first thing, to ensure maximum memory efficiency. + // Important to init slab allocator as first thing, to ensure maximum memory efficiency for Plonk. await api.commonInitSlabAllocator(subgroupSize); // Load CRS into wasm global CRS state. // TODO: Make RawBuffer be default behavior, and have a specific Vector type for when wanting length prefixed. await api.srsInitSrs(new RawBuffer(crs.getG1Data()), crs.numPoints, new RawBuffer(crs.getG2Data())); - const acirComposer = await api.acirNewAcirComposer(subgroupSize); return { api, acirComposer, circuitSize, subgroupSize }; } +async function initUltraHonk(bytecodePath: string, crsPath: string) { + const api = await Barretenberg.new({ threads }); + + const circuitSize = await getGatesUltra(bytecodePath, /*honkRecursion=*/ true, api); + // TODO(https://github.com/AztecProtocol/barretenberg/issues/811): remove subgroupSizeOverride hack for goblin + const dyadicCircuitSize = Math.pow(2, Math.ceil(Math.log2(circuitSize))); + + debug(`circuit size: ${circuitSize}`); + debug(`dyadic circuit size size: ${dyadicCircuitSize}`); + debug('loading crs...'); + // Plus 1 needed! (Move +1 into Crs?) + const crs = await Crs.new(dyadicCircuitSize + 1, crsPath); + + // Load CRS into wasm global CRS state. + // TODO: Make RawBuffer be default behavior, and have a specific Vector type for when wanting length prefixed. + await api.srsInitSrs(new RawBuffer(crs.getG1Data()), crs.numPoints, new RawBuffer(crs.getG2Data())); + return { api, circuitSize, dyadicCircuitSize }; +} + +async function initClientIVC(bytecodePath: string, crsPath: string) { + const api = await Barretenberg.new({ threads }); + + debug('loading BN254 and Grumpkin crs...'); + // Plus 1 needed! (Move +1 into Crs?) + const crs = await Crs.new(2 ** 18 + 1, crsPath); + const grumpkinCrs = await GrumpkinCrs.new(8192 + 1, crsPath); + + // Load CRS into wasm global CRS state. + // TODO: Make RawBuffer be default behavior, and have a specific Vector type for when wanting length prefixed. + await api.srsInitSrs(new RawBuffer(crs.getG1Data()), crs.numPoints, new RawBuffer(crs.getG2Data())); + await api.srsInitGrumpkinSrs(new RawBuffer(grumpkinCrs.getG1Data()), grumpkinCrs.numPoints); + return { api }; +} + async function initLite() { const api = await Barretenberg.new({ threads: 1 }); @@ -94,7 +128,7 @@ export async function proveAndVerify(bytecodePath: string, witnessPath: string, /* eslint-disable camelcase */ const acir_test = path.basename(process.cwd()); - const { api, acirComposer, circuitSize, subgroupSize } = await init(bytecodePath, crsPath); + const { api, acirComposer, circuitSize, subgroupSize } = await initUltraPlonk(bytecodePath, crsPath); try { debug(`creating proof...`); const bytecode = getBytecode(bytecodePath); @@ -122,7 +156,7 @@ export async function proveAndVerify(bytecodePath: string, witnessPath: string, export async function proveAndVerifyUltraHonk(bytecodePath: string, witnessPath: string, crsPath: string) { /* eslint-disable camelcase */ - const { api } = await init(bytecodePath, crsPath, -1, true); + const { api } = await initUltraHonk(bytecodePath, crsPath); try { const bytecode = getBytecode(bytecodePath); const witness = getWitness(witnessPath); @@ -137,7 +171,7 @@ export async function proveAndVerifyUltraHonk(bytecodePath: string, witnessPath: export async function proveAndVerifyMegaHonk(bytecodePath: string, witnessPath: string, crsPath: string) { /* eslint-disable camelcase */ - const { api } = await init(bytecodePath, crsPath); + const { api } = await initUltraPlonk(bytecodePath, crsPath); try { const bytecode = getBytecode(bytecodePath); const witness = getWitness(witnessPath); @@ -152,12 +186,13 @@ export async function proveAndVerifyMegaHonk(bytecodePath: string, witnessPath: export async function foldAndVerifyProgram(bytecodePath: string, witnessPath: string, crsPath: string) { /* eslint-disable camelcase */ - const { api } = await init(bytecodePath, crsPath); + const { api } = await initClientIVC(bytecodePath, crsPath); try { const bytecode = getBytecode(bytecodePath); const witness = getWitness(witnessPath); const verified = await api.acirFoldAndVerifyProgramStack(bytecode, witness); + debug(`verified: ${verified}`); return verified; } finally { await api.destroy(); @@ -166,7 +201,7 @@ export async function foldAndVerifyProgram(bytecodePath: string, witnessPath: st } export async function prove(bytecodePath: string, witnessPath: string, crsPath: string, outputPath: string) { - const { api, acirComposer } = await init(bytecodePath, crsPath); + const { api, acirComposer } = await initUltraPlonk(bytecodePath, crsPath); try { debug(`creating proof...`); const bytecode = getBytecode(bytecodePath); @@ -186,10 +221,10 @@ export async function prove(bytecodePath: string, witnessPath: string, crsPath: } } -export async function gateCount(bytecodePath: string, honkRecursion: boolean) { +export async function gateCountUltra(bytecodePath: string, honkRecursion: boolean) { const api = await Barretenberg.new({ threads: 1 }); try { - const numberOfGates = await getGates(bytecodePath, honkRecursion, api); + const numberOfGates = await getGatesUltra(bytecodePath, honkRecursion, api); debug(`number of gates: : ${numberOfGates}`); // Create an 8-byte buffer and write the number into it. // Writing number directly to stdout will result in a variable sized @@ -234,7 +269,7 @@ export async function contract(outputPath: string, vkPath: string) { } export async function writeVk(bytecodePath: string, crsPath: string, outputPath: string) { - const { api, acirComposer } = await init(bytecodePath, crsPath); + const { api, acirComposer } = await initUltraPlonk(bytecodePath, crsPath); try { debug('initing proving key...'); const bytecode = getBytecode(bytecodePath); @@ -256,7 +291,7 @@ export async function writeVk(bytecodePath: string, crsPath: string, outputPath: } export async function writePk(bytecodePath: string, crsPath: string, outputPath: string) { - const { api, acirComposer } = await init(bytecodePath, crsPath); + const { api, acirComposer } = await initUltraPlonk(bytecodePath, crsPath); try { debug('initing proving key...'); const bytecode = getBytecode(bytecodePath); @@ -326,7 +361,7 @@ export async function vkAsFields(vkPath: string, vkeyOutputPath: string) { } export async function proveUltraHonk(bytecodePath: string, witnessPath: string, crsPath: string, outputPath: string) { - const { api } = await init(bytecodePath, crsPath, -1, /* honkRecursion= */ true); + const { api } = await initUltraHonk(bytecodePath, crsPath); try { debug(`creating proof...`); const bytecode = getBytecode(bytecodePath); @@ -347,7 +382,7 @@ export async function proveUltraHonk(bytecodePath: string, witnessPath: string, } export async function writeVkUltraHonk(bytecodePath: string, crsPath: string, outputPath: string) { - const { api } = await init(bytecodePath, crsPath, -1, true); + const { api } = await initUltraHonk(bytecodePath, crsPath); try { const bytecode = getBytecode(bytecodePath); debug('initing verification key...'); @@ -487,12 +522,12 @@ program program .command('gates') - .description('Print gate count to standard output.') + .description('Print Ultra Builder gate count to standard output.') .option('-b, --bytecode-path ', 'Specify the bytecode path', './target/program.json') .option('-hr, --honk-recursion', 'Specify whether to use UltraHonk recursion', false) .action(async ({ bytecodePath: bytecodePath, honkRecursion: honkRecursion }) => { handleGlobalOptions(); - await gateCount(bytecodePath, honkRecursion); + await gateCountUltra(bytecodePath, honkRecursion); }); program diff --git a/noir/noir-repo/test_programs/execution_success/bench_2_to_17/Nargo.toml b/noir/noir-repo/test_programs/execution_success/bench_2_to_17/Nargo.toml new file mode 100644 index 000000000000..47f495304830 --- /dev/null +++ b/noir/noir-repo/test_programs/execution_success/bench_2_to_17/Nargo.toml @@ -0,0 +1,7 @@ +[package] +name = "bench_2_to_17" +type = "bin" +authors = [""] +compiler_version = ">=0.33.0" + +[dependencies] \ No newline at end of file diff --git a/noir/noir-repo/test_programs/execution_success/bench_2_to_17/Prover.toml b/noir/noir-repo/test_programs/execution_success/bench_2_to_17/Prover.toml new file mode 100644 index 000000000000..2d35b0614e34 --- /dev/null +++ b/noir/noir-repo/test_programs/execution_success/bench_2_to_17/Prover.toml @@ -0,0 +1 @@ +x = "3" \ No newline at end of file diff --git a/noir/noir-repo/test_programs/execution_success/bench_2_to_17/src/main.nr b/noir/noir-repo/test_programs/execution_success/bench_2_to_17/src/main.nr new file mode 100644 index 000000000000..ae80dfcf0b4f --- /dev/null +++ b/noir/noir-repo/test_programs/execution_success/bench_2_to_17/src/main.nr @@ -0,0 +1,8 @@ +use std::hash::poseidon2; + +global len = 2450 * 2; +fn main(x: Field) { + let ped_input = [x; len]; + let mut val = poseidon2::Poseidon2::hash(ped_input, len); + assert(val != 0); +} diff --git a/noir/noir-repo/test_programs/execution_success/fold_2_to_17/Nargo.toml b/noir/noir-repo/test_programs/execution_success/fold_2_to_17/Nargo.toml new file mode 100644 index 000000000000..54e4c9a64e89 --- /dev/null +++ b/noir/noir-repo/test_programs/execution_success/fold_2_to_17/Nargo.toml @@ -0,0 +1,7 @@ +[package] +name = "fold_2_to_17" +type = "bin" +authors = [""] +compiler_version = ">=0.25.0" + +[dependencies] \ No newline at end of file diff --git a/noir/noir-repo/test_programs/execution_success/fold_2_to_17/Prover.toml b/noir/noir-repo/test_programs/execution_success/fold_2_to_17/Prover.toml new file mode 100644 index 000000000000..a56a84e61a45 --- /dev/null +++ b/noir/noir-repo/test_programs/execution_success/fold_2_to_17/Prover.toml @@ -0,0 +1 @@ +x = "2" diff --git a/noir/noir-repo/test_programs/execution_success/fold_2_to_17/src/main.nr b/noir/noir-repo/test_programs/execution_success/fold_2_to_17/src/main.nr new file mode 100644 index 000000000000..a3a747e4aeea --- /dev/null +++ b/noir/noir-repo/test_programs/execution_success/fold_2_to_17/src/main.nr @@ -0,0 +1,16 @@ +use std::hash::poseidon2; + +global len = 2450 * 2 - 240; // for just under 2^17 gates +fn main(x: Field) { + let ped_input = [x; len]; + let mut val = poseidon2::Poseidon2::hash(ped_input, len); + let z = foo(x); + assert(val == z); +} + +#[fold] +fn foo(x: Field) -> Field { + let ped_input = [x; len]; + let mut val = poseidon2::Poseidon2::hash(ped_input, len); + val +} diff --git a/noir/noir-repo/test_programs/execution_success/single_verify_proof/Nargo.toml b/noir/noir-repo/test_programs/execution_success/single_verify_proof/Nargo.toml new file mode 100644 index 000000000000..9dfbbcb9c1d9 --- /dev/null +++ b/noir/noir-repo/test_programs/execution_success/single_verify_proof/Nargo.toml @@ -0,0 +1,7 @@ +[package] +name = "single_verify_proof" +type = "bin" +authors = [""] +compiler_version = ">=0.24.0" + +[dependencies] \ No newline at end of file diff --git a/noir/noir-repo/test_programs/execution_success/single_verify_proof/Prover.toml b/noir/noir-repo/test_programs/execution_success/single_verify_proof/Prover.toml new file mode 100644 index 000000000000..27b3ebc0c35c --- /dev/null +++ b/noir/noir-repo/test_programs/execution_success/single_verify_proof/Prover.toml @@ -0,0 +1,4 @@ +key_hash = "0x096129b1c6e108252fc5c829c4cc9b7e8f0d1fd9f29c2532b563d6396645e08f" +proof = ["0x000000000000000000000000000000d62b795bec274279129a71195796825fcc","0x00000000000000000000000000000000000793ab763140f20a68a6bd2721fd74","0x00000000000000000000000000000053141d06d3307b36153f321511199e579c","0x00000000000000000000000000000000000a4b55d6c21f98a9c434911dcb5c67","0x0000000000000000000000000000005f9d324c0abd22cec92d99dbec438e9491","0x0000000000000000000000000000000000240dfafe1b53dc27147cbab14ea893","0x000000000000000000000000000000044a61d3aac32c6931247cf334a19d9611","0x000000000000000000000000000000000003f0f8cf4207bfa85c23ec9f8d0c88","0x00000000000000000000000000000002168a470e39ba2ac266f6b474de12045f","0x000000000000000000000000000000000025791e7d3feab542345c00ec5a30df","0x000000000000000000000000000000dcafd76d4c3640969c80e017b951ef6397","0x00000000000000000000000000000000001d27f75a1256771e88e0c86fc42dbc","0x0000000000000000000000000000007347ae7d2d9d7fc2b8f0baa014ee1fed9f","0x000000000000000000000000000000000018bd927f42bf7caf9555f56f09000d","0x000000000000000000000000000000041f765f83cbe5904c8f453f70a4531d10","0x00000000000000000000000000000000001858aabeeb5331a221419f4fed1c19","0x000000000000000000000000000000d254a54caaedf8287b9af951b2f2611121","0x000000000000000000000000000000000005ab493623c9563cf2e55ba5f18200","0x00000000000000000000000000000014f24cddc1a02440dc63637df8032c8074","0x000000000000000000000000000000000011950c16cef98471b1d78b935195a4","0x000000000000000000000000000000b0340b459e6bd5cc8f031c8654a502897f","0x00000000000000000000000000000000000e1cf3968dac4545a76a2ae58e512c","0x0000000000000000000000000000002adf7218aa06ca0d2c2e600dcc39193a2d","0x00000000000000000000000000000000001302e7e4b0f14749bd885ca25588b6","0x00000000000000000000000000000092009ce4056e79ab815d8cdfd4491138ae","0x000000000000000000000000000000000018af11e853c6cf2f0f6274b0da8133","0x000000000000000000000000000000dd3dc6f49232141718527b3a0e4b26e21d","0x00000000000000000000000000000000001a877853348a8b695c4f9a9aa4ce68","0x000000000000000000000000000000aecfc56ba07155450b368140d6324023b5","0x000000000000000000000000000000000029c11052798c57ece614617d33fcc2","0x000000000000000000000000000000eb106ffc816d16fb84e84b0b61157b2603","0x000000000000000000000000000000000026c3cac16206899a21cb5126841446","0x000000000000000000000000000000a782ed54805fe845068b362b58e2fa34ec","0x00000000000000000000000000000000000cf046a1bfcc666b7f28b572676073","0x000000000000000000000000000000b931c8dda60bb4aca4cc817f5540f1209f","0x000000000000000000000000000000000024ad50c3936fafc3d190e6a4874223","0x000000000000000000000000000000cce90cfbaf5671c8c8652db28a3a9566f7","0x000000000000000000000000000000000003574db9d0f84380c9635660f86354","0x0000000000000000000000000000003eb3e1dc31846a90f721e7a08c6d6dc4f7","0x000000000000000000000000000000000028999a700cd1abae1a288eebb9a91c","0x000000000000000000000000000000c1be4d385b11387e14eb9817050d772f78","0x000000000000000000000000000000000003c56b5bad8b4484c66ac921f1f102","0x000000000000000000000000000000ace245cabf0f00dc7fd253dd8af0377a14","0x0000000000000000000000000000000000107f1731fcf34b364c813599fa1df7","0x035b937d404932b542b706eb810ef4a7dca4566d4dde1ad6a8717f46167ead7e","0x17608cef3dc7960f41cb1295706df663727d45ee598a61e05e989d111449fb65","0x054712a950ad67da3aa860e49e6891f99b586b7f37caff94eb013fdb374b61ee","0x04b755083086c769b7f593e0e48d68dc54be808203351380ca5566a48149d8bb","0x17d7670b0915235f626fdc1d7e1134d2be906ef138d7843384b3ebc23b1d630f","0x064cf544ab5f4e3dab47960502cccc83321fb275068dfbdd3a2fcbc6dddcaa65","0x083338262712e2b66769ea40d9f412b18caa1bc81a51ff5a50b6c41f8c4b3d23","0x0cdd38958cab97defde00f4a5961b6fd676e29d9f2c352f6bb2c68b91f83f8af","0x02c8bdd005c2f43a0a8cbb2744916ce5c322dfa5b23367a829c12699f4036d32","0x25bac73c7e7b659fbea3135b7a0decf9db8dc3045bd2837dae337c64cc722546","0x19eb361aa419d37bce3d2e8b2b7692a02a9559e83d7f3d8fe9169970fbbc2cba","0x2494bd5106d00e05c7ea60e632e9fe03773b7f2c5b662aa37ec512a01f4a0775","0x18c52c2f2c6e7be1d7847c15e452a3a9c64316103d12e4b5b9a82fac4e940ee9","0x0e0342810456ef78f498c1bfa085a5f3cbc06db1f32fabd0ea9ad27dccac1680","0x024c13d6ef56af33ed7164ea8e47ddecc8a487b000d8b1b45edcd3895a503ba2","0x26e0d127f626bd39b55bc5d0c131dbf03fe006dc5c3edc57dda1e629799a4317","0x1b1140061bc52b15c4f5e100729a81968ee79dc03deb966a18850335a8e44a8b","0x1bb76f945199e71d531a89288912087a02dd0e83020e65d671485bf2e5e86e1a","0x29269900859c6d86e404185b415bf3b279cd100f38cfdb0077e8d6a299c4fd35","0x22b5e94bae2f6f0cdb424a3b12c4bf82cec3fb228e012c1974ed457827bbe012","0x18d3543a93249778e7a57936170dae85ffc47c2567f2d0076a32c0bb86fcf10a","0x03721dc2670206cde42a175fd56bcce32cf6cb8801450a8e8e4b3d4e07785973","0x2806db136dd214d3ac1478460855cae6a4324ab45cab35320d104fee26c260e8","0x1c3749f1937082afbbae9375b9be708cf339e1983e57ef4447f36cfa560c685c","0x1067b8cfb90ef08bcb48aea56b2716334241787c2004a95682d68a0685566fd0","0x0f41aee4416398f1d48ffc302403273cddef34a41f98507c53682041d82e51ff","0x10d854c9f0bfbdff7ca91a68f4978e9a79e7b14243d92f465f17bdf88d9f64f8","0x00000000000000000000000000000000018938b11099e0cdc05ddab84a153a97","0x0000000000000000000000000000000001d7dda1471f0dc3b3a3d3438c197982","0x00000000000000000000000000000000022682917da43ab9a6e9cbcece1db86d","0x2453913e6b0f36eab883ac4b0e0604d56aaeb9c55e641135173e63c342f1a660","0x05216c1b58dc43a49d01aaba3113b0e86be450fc17d28016e648e7162a1b67fb","0x152b34845a0222a2b41354c0d395a250d8363dc18748647d85acd89d6934ec56","0x1dfc6e971ce82b7dcda1f7f282713c6e22a8c79258a61209bda69719806da544","0x2968dd8b3af8e3953f1fbbd72f4c49b8270597bb27d4037adc157ac6083bee60","0x1b9425b88a4c7d39b3d75afe66917a9aa1d2055724392bc01fb918d84ff1410e","0x04ab571f236d8e750904dc307dd274003d9130f1a7110e4c1521cfb408877c73","0x2ad84f26fdc5831545272d02b806bb0e6dae44e71f73552c4eb9ff06030748c7","0x020e632b99d325db774b8630fb50b9a4e74d35b7f27d9fc02c65087ee747e42c","0x09a8c5a3171268cb61c02515c01c109889200ed13f415ae54df2078bbb887f92","0x1143281a9451abbb4c34c3fa84e7678c2af2e7ea8c05160a6f7f06988fc91af8","0x000000000000000000000000000000cbda736ca5cf6bc75413c2cc9e28ab0a68","0x00000000000000000000000000000000001ee78c9cc56aa5991062ae2e338587","0x000000000000000000000000000000bc9bfcdebb486f4cb314e681d2cc5f8df6","0x00000000000000000000000000000000000ad538431d04771bca7f633cb659ff","0x000000000000000000000000000000d45b317afcefa466a59bba9e171f1af70c","0x0000000000000000000000000000000000133c50180ea17932e4881124e7a7c6","0x000000000000000000000000000000fc9ed37f543775849f3e84eaa06f77f992","0x00000000000000000000000000000000001372873c9c051d1baff99248b8f70e"] +public_inputs = ["0x0000000000000000000000000000000000000000000000000000000000000003"] +verification_key = ["0x2b337de1c8c14f22ec9b9e2f96afef3652627366f8170a0a948dad4ac1bd5e80","0x0000000000000000000000000000000000000000000000000000000000000008","0x0000000000000000000000000000000000000000000000000000000000000005","0x0000000000000000000000000000000000000000000000000000000000000008","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x00000000000000000000000000000092139c61bae1a44f0fc7689507414be688","0x00000000000000000000000000000000000160ce4e279582f91bde4f03f5e9a2","0x0000000000000000000000000000005dc2d37f658c3b2d60f24740eb13b65d79","0x000000000000000000000000000000000007e3e8a5d98a1177ec85bf88f163a5","0x000000000000000000000000000000dc3035fbd7ff16412a8fd7da587a935298","0x000000000000000000000000000000000023d08e2817ac16990004ed11d8fc66","0x000000000000000000000000000000356a5ad59c646c746a8d09f5d154e47c4f","0x00000000000000000000000000000000000708529196af3c8e16ffa580c26182","0x0000000000000000000000000000002ddfe70eb7a1280596e8e4a804f118a6dd","0x000000000000000000000000000000000013757e15a0905f298303784a161b21","0x000000000000000000000000000000a23a729df796935c7824e3a26be794829b","0x000000000000000000000000000000000005775b6c146c4a59856e869fe5a70e","0x000000000000000000000000000000eef0c9e088fd2d45aa40311082d1f2809b","0x00000000000000000000000000000000001d539ccbfc556d0ad59307a218de65","0x000000000000000000000000000000a2c848beceb6ab7806fd3b88037b8410fc","0x0000000000000000000000000000000000177004deeb1f9d401fd7b1af1a5ac8","0x0000000000000000000000000000002508eb63672a733f20de1a97644be4f540","0x00000000000000000000000000000000000d82d51f2f75d806285fd248c819b8","0x000000000000000000000000000000d002f9100cbba8a29f13b11513c53c59d0","0x000000000000000000000000000000000006cd3b0e3460533b9e5ea2cdc0fcbb","0x000000000000000000000000000000f45ea38a93b2f810c5633ddb54927c1c96","0x000000000000000000000000000000000021791de65f9a28ec7024b1a87ab4f3","0x000000000000000000000000000000926511a0439502c86885a8c6f0327aa7ad","0x000000000000000000000000000000000029fa14a969c5d81ed3abbbfb11220a","0x000000000000000000000000000000b84c3258e8206f560e5b5b18cbeafef87e","0x00000000000000000000000000000000002a910445cd8fc895e5d235cd8ea185","0x000000000000000000000000000000887e67f15e84bcb8507a5064a363f6043b","0x000000000000000000000000000000000014dc6643d801c3ef27c2066b6e2bb4","0x000000000000000000000000000000e38e900b42c314ba803088e8fbf125203f","0x000000000000000000000000000000000020690fd4869db418306046b38161dc","0x0000000000000000000000000000001e2fa856bf7951b8292b1e88185993629c","0x0000000000000000000000000000000000048a85e0bbac7c60ad3d78f601f63c","0x0000000000000000000000000000006f457719495073d3666d77a625aeab0c51","0x00000000000000000000000000000000002623ad892dc62b1fa7d0a650f0d470","0x000000000000000000000000000000dbfcc8a467e021c03b13f74a9f79c3a10c","0x0000000000000000000000000000000000295f6f10976c37bd9c6f96bb7187d5","0x000000000000000000000000000000c13ef9a937cc12420fb38d9ab8e848e85e","0x000000000000000000000000000000000003560a3b334e887532f605c9cb7628","0x0000000000000000000000000000009bcebf08a4599cdda0fb96312d4dc0c7a9","0x000000000000000000000000000000000015adc8bb1e01c835f48959d1237bd6","0x00000000000000000000000000000047762ab839e4ff63c77605a9f383da37c2","0x000000000000000000000000000000000016a8c3c53d89660cf271522cd301fb","0x000000000000000000000000000000f0c8539a0b5f94420a513f9c305b932bfe","0x00000000000000000000000000000000002957ba01d9de5638f808f88a692533","0x000000000000000000000000000000ab17c6189d67d3bf5dd2f3885de0151b6f","0x0000000000000000000000000000000000060d8aa43fdc434d1942263f364d95","0x0000000000000000000000000000005d292333b3adb497f00b4bc32d45229060","0x00000000000000000000000000000000001a1018a66221883639f2898a66f345","0x00000000000000000000000000000006555a806b1993291deba0dc44e2abf431","0x00000000000000000000000000000000000cacff7099a9d5e35a21f4a00b2dc3","0x000000000000000000000000000000f50c11ba95d349c36d143eefd12e494950","0x00000000000000000000000000000000001022e8c5f02d639bc9dd8bc4407f99","0x000000000000000000000000000000c76828795098eda73d50b4b585c60afc60","0x00000000000000000000000000000000002bf09c0ec7011e93888962f2406630","0x00000000000000000000000000000049e5c83a8978d832fb8e144548e3ca1adb","0x00000000000000000000000000000000000e0ec242c2e160a984f61ca5adf5f5","0x0000000000000000000000000000009c5d6e08a6605ab4513748ac0fa017dd1c","0x00000000000000000000000000000000001f54baa07558e5fb055bd9ba49c067","0x0000000000000000000000000000001e1ee7ee29bbb5e4b080c6091c1433ce62","0x000000000000000000000000000000000024aec62a9d9763499267dc98c33428","0x0000000000000000000000000000001a96755946ff16f0d6632365f0eb0ab4d4","0x000000000000000000000000000000000028cf3e22bcd53782ebc3e0490e27e5","0x00000000000000000000000000000043148d7d8c9ba43f2133fab4201435a364","0x0000000000000000000000000000000000234ce541f1f5117dd404cfaf01a229","0x000000000000000000000000000000a7fb95ffb461d9514a1070e2d2403982ef","0x00000000000000000000000000000000003016955028b6390f446c3fd0c5b424","0x00000000000000000000000000000008863c3b7cd7cddc20ba79ce915051c56e","0x000000000000000000000000000000000013ef666111b0be56a235983d397d2a","0x000000000000000000000000000000e3993f465fc9f56e93ac769e597b752c1c","0x0000000000000000000000000000000000217f7c4235161e9a3c16c45b6ca499","0x0000000000000000000000000000008ffa4cd96bc67b0b7df5678271e1114075","0x0000000000000000000000000000000000256467bfcb63d9fdcb5dde397757ad","0x00000000000000000000000000000054e5eb270bb64bde6e6ececadfd8c3236c","0x00000000000000000000000000000000000e52d1bd75812c33c6f3d79ee4b94c","0x000000000000000000000000000000484a2c641dce55bc2dd64ef0cd790a7fea","0x00000000000000000000000000000000000ff417d256be43e73c8b1aa85bdda3","0x0000000000000000000000000000000b72e7b7713ab5da44e0f864182e748a23","0x00000000000000000000000000000000001a221055f1625ad833a44705f5f74e","0x00000000000000000000000000000067a99a34e9b81a17ad001db02e29bcb82a","0x000000000000000000000000000000000018a6c02e398389827568fa960e86e2","0x000000000000000000000000000000bb29f26f9890d6cc6401f4921d5884edca","0x00000000000000000000000000000000000868357b28039385c5a5058b6d358e","0x00000000000000000000000000000036fb6e229dde8edf7ec858b12d7e8be485","0x00000000000000000000000000000000001060afe929554ca473103f5e68193c","0x00000000000000000000000000000015226e07e207744c0857074dcab883af4a","0x00000000000000000000000000000000000b1c02619282755533457230b19b4a","0x0000000000000000000000000000001f2a0277e4807e6e1cbabca21dde5eb5e1","0x00000000000000000000000000000000000d928deafed363659688ed4ccdef52","0x000000000000000000000000000000363f0c994e91cecad25835338edee2294f","0x00000000000000000000000000000000002eea648c8732596b1314fe2a4d2f05","0x000000000000000000000000000000b2671d2ae51d31c1210433c3972bb64578","0x00000000000000000000000000000000000ab49886c2b94bd0bd3f6ed1dbbe2c"] \ No newline at end of file diff --git a/noir/noir-repo/test_programs/execution_success/single_verify_proof/src/main.nr b/noir/noir-repo/test_programs/execution_success/single_verify_proof/src/main.nr new file mode 100644 index 000000000000..4eb0cfdf6d0f --- /dev/null +++ b/noir/noir-repo/test_programs/execution_success/single_verify_proof/src/main.nr @@ -0,0 +1,15 @@ + +// This circuit aggregates one proof from `assert_statement_recursive`. +fn main( + verification_key: [Field; 114], + // This is the proof without public inputs attached. + // + // This means: the size of this does not change with the number of public inputs. + proof: [Field; 93], + public_inputs: pub [Field; 1], + // This is currently not public. It is fine given that the vk is a part of the circuit definition. + // I believe we want to eventually make it public too though. + key_hash: Field +) { + std::verify_proof(verification_key, proof, public_inputs, key_hash); +} diff --git a/noir/noir-repo/test_programs/rebuild.sh b/noir/noir-repo/test_programs/rebuild.sh index 1f2e199e814b..e5badbd2ea63 100755 --- a/noir/noir-repo/test_programs/rebuild.sh +++ b/noir/noir-repo/test_programs/rebuild.sh @@ -28,16 +28,17 @@ process_dir() { fi if ! nargo execute witness; then - echo "$dir: failed" + echo "$dir failed" else if [ -d "$current_dir/acir_artifacts/$dir_name/target" ]; then rm -r "$current_dir/acir_artifacts/$dir_name/target" fi mkdir "$current_dir/acir_artifacts/$dir_name/target" + mkdir "$current_dir/acir_artifacts/$dir_name/proofs" mv ./target/$dir_name.json "$current_dir/acir_artifacts/$dir_name/target/program.json" mv ./target/*.gz "$current_dir/acir_artifacts/$dir_name/target/" - echo "$dir: succeeded" + echo "$dir succeeded" fi cd "$current_dir"