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 8b38148c072f..faa11417ed0f 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.cpp @@ -301,6 +301,29 @@ WASM_EXPORT void acir_prove_ultra_starknet_honk([[maybe_unused]] uint8_t const* #endif } +WASM_EXPORT void acir_prove_ultra_starknet_zk_honk([[maybe_unused]] uint8_t const* acir_vec, + [[maybe_unused]] uint8_t const* witness_vec, + [[maybe_unused]] uint8_t** out) +{ +#ifdef STARKNET_GARAGA_FLAVORS + // Lambda function to ensure things get freed before proving. + UltraStarknetZKProver prover = [&] { + const acir_format::ProgramMetadata metadata{ .honk_recursion = 1 }; + acir_format::AcirProgram program{ + acir_format::circuit_buf_to_acir_format(from_buffer>(acir_vec)), + acir_format::witness_buf_to_witness_data(from_buffer>(witness_vec)) + }; + auto builder = acir_format::create_circuit(program, metadata); + + return UltraStarknetZKProver(builder); + }(); + auto proof = prover.construct_proof(); + *out = to_heap_buffer(to_buffer(proof)); +#else + throw_or_abort("bb wasm was not compiled with starknet garaga flavors!"); +#endif +} + WASM_EXPORT void acir_verify_ultra_honk(uint8_t const* proof_buf, uint8_t const* vk_buf, bool* result) { using VerificationKey = UltraFlavor::VerificationKey; @@ -359,6 +382,25 @@ WASM_EXPORT void acir_verify_ultra_starknet_honk([[maybe_unused]] uint8_t const* #endif } +WASM_EXPORT void acir_verify_ultra_starknet_zk_honk([[maybe_unused]] uint8_t const* proof_buf, + [[maybe_unused]] uint8_t const* vk_buf, + [[maybe_unused]] bool* result) +{ +#ifdef STARKNET_GARAGA_FLAVORS + using VerificationKey = UltraStarknetZKFlavor::VerificationKey; + using Verifier = UltraVerifier_; + + auto proof = many_from_buffer(from_buffer>(proof_buf)); + auto verification_key = std::make_shared(from_buffer(vk_buf)); + + Verifier verifier{ verification_key }; + + *result = verifier.verify_proof(proof); +#else + throw_or_abort("bb wasm was not compiled with starknet garaga flavors!"); +#endif +} + WASM_EXPORT void acir_write_vk_ultra_honk(uint8_t const* acir_vec, uint8_t** out) { using DeciderProvingKey = DeciderProvingKey_; @@ -435,6 +477,29 @@ WASM_EXPORT void acir_write_vk_ultra_starknet_honk([[maybe_unused]] uint8_t cons #endif } +WASM_EXPORT void acir_write_vk_ultra_starknet_zk_honk([[maybe_unused]] uint8_t const* acir_vec, + [[maybe_unused]] uint8_t** out) +{ +#ifdef STARKNET_GARAGA_FLAVORS + using DeciderProvingKey = DeciderProvingKey_; + using VerificationKey = UltraStarknetZKFlavor::VerificationKey; + + // lambda to free the builder + DeciderProvingKey proving_key = [&] { + const acir_format::ProgramMetadata metadata{ .honk_recursion = 1 }; + acir_format::AcirProgram program{ acir_format::circuit_buf_to_acir_format( + from_buffer>(acir_vec)) }; + auto builder = acir_format::create_circuit(program, metadata); + return DeciderProvingKey(builder); + }(); + VerificationKey vk(proving_key.proving_key); + vinfo("Constructed UltraStarknetZKHonk verification key"); + *out = to_heap_buffer(to_buffer(vk)); +#else + throw_or_abort("bb wasm was not compiled with starknet garaga flavors!"); +#endif +} + WASM_EXPORT void acir_honk_solidity_verifier(uint8_t const* proof_buf, uint8_t const* vk_buf, uint8_t** out) { using VerificationKey = UltraKeccakFlavor::VerificationKey; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.hpp b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.hpp index 7b80f1bf5f81..dbfc1bfdb939 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.hpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.hpp @@ -86,16 +86,19 @@ WASM_EXPORT void acir_prove_ultra_honk(uint8_t const* acir_vec, uint8_t const* w WASM_EXPORT void acir_prove_ultra_keccak_honk(uint8_t const* acir_vec, uint8_t const* witness_vec, uint8_t** out); WASM_EXPORT void acir_prove_ultra_keccak_zk_honk(uint8_t const* acir_vec, uint8_t const* witness_vec, uint8_t** out); WASM_EXPORT void acir_prove_ultra_starknet_honk(uint8_t const* acir_vec, uint8_t const* witness_vec, uint8_t** out); +WASM_EXPORT void acir_prove_ultra_starknet_zk_honk(uint8_t const* acir_vec, uint8_t const* witness_vec, uint8_t** out); WASM_EXPORT void acir_verify_ultra_honk(uint8_t const* proof_buf, uint8_t const* vk_buf, bool* result); WASM_EXPORT void acir_verify_ultra_keccak_honk(uint8_t const* proof_buf, uint8_t const* vk_buf, bool* result); WASM_EXPORT void acir_verify_ultra_keccak_zk_honk(uint8_t const* proof_buf, uint8_t const* vk_buf, bool* result); WASM_EXPORT void acir_verify_ultra_starknet_honk(uint8_t const* proof_buf, uint8_t const* vk_buf, bool* result); +WASM_EXPORT void acir_verify_ultra_starknet_zk_honk(uint8_t const* proof_buf, uint8_t const* vk_buf, bool* result); WASM_EXPORT void acir_write_vk_ultra_honk(uint8_t const* acir_vec, uint8_t** out); WASM_EXPORT void acir_write_vk_ultra_keccak_honk(uint8_t const* acir_vec, uint8_t** out); WASM_EXPORT void acir_write_vk_ultra_keccak_zk_honk(uint8_t const* acir_vec, uint8_t** out); WASM_EXPORT void acir_write_vk_ultra_starknet_honk(uint8_t const* acir_vec, uint8_t** out); +WASM_EXPORT void acir_write_vk_ultra_starknet_zk_honk(uint8_t const* acir_vec, uint8_t** out); WASM_EXPORT void acir_proof_as_fields_ultra_honk(uint8_t const* proof_buf, fr::vec_out_buf out); diff --git a/barretenberg/exports.json b/barretenberg/exports.json index 5644ee3a60f7..c4eede91f83b 100644 --- a/barretenberg/exports.json +++ b/barretenberg/exports.json @@ -715,6 +715,46 @@ ], "isAsync": false }, + { + "functionName": "acir_prove_ultra_starknet_honk", + "inArgs": [ + { + "name": "acir_vec", + "type": "const uint8_t *" + }, + { + "name": "witness_vec", + "type": "const uint8_t *" + } + ], + "outArgs": [ + { + "name": "out", + "type": "uint8_t **" + } + ], + "isAsync": false + }, + { + "functionName": "acir_prove_ultra_starknet_zk_honk", + "inArgs": [ + { + "name": "acir_vec", + "type": "const uint8_t *" + }, + { + "name": "witness_vec", + "type": "const uint8_t *" + } + ], + "outArgs": [ + { + "name": "out", + "type": "uint8_t **" + } + ], + "isAsync": false + }, { "functionName": "acir_verify_ultra_honk", "inArgs": [ @@ -775,6 +815,46 @@ ], "isAsync": false }, + { + "functionName": "acir_verify_ultra_starknet_honk", + "inArgs": [ + { + "name": "proof_buf", + "type": "const uint8_t *" + }, + { + "name": "vk_buf", + "type": "const uint8_t *" + } + ], + "outArgs": [ + { + "name": "result", + "type": "bool *" + } + ], + "isAsync": false + }, + { + "functionName": "acir_verify_ultra_starknet_zk_honk", + "inArgs": [ + { + "name": "proof_buf", + "type": "const uint8_t *" + }, + { + "name": "vk_buf", + "type": "const uint8_t *" + } + ], + "outArgs": [ + { + "name": "result", + "type": "bool *" + } + ], + "isAsync": false + }, { "functionName": "acir_write_vk_ultra_honk", "inArgs": [ @@ -823,6 +903,38 @@ ], "isAsync": false }, + { + "functionName": "acir_write_vk_ultra_starknet_honk", + "inArgs": [ + { + "name": "acir_vec", + "type": "const uint8_t *" + } + ], + "outArgs": [ + { + "name": "out", + "type": "uint8_t **" + } + ], + "isAsync": false + }, + { + "functionName": "acir_write_vk_ultra_starknet_zk_honk", + "inArgs": [ + { + "name": "acir_vec", + "type": "const uint8_t *" + } + ], + "outArgs": [ + { + "name": "out", + "type": "uint8_t **" + } + ], + "isAsync": false + }, { "functionName": "acir_proof_as_fields_ultra_honk", "inArgs": [ diff --git a/barretenberg/ts/src/barretenberg/backend.ts b/barretenberg/ts/src/barretenberg/backend.ts index fd3704736c45..572a057c340d 100644 --- a/barretenberg/ts/src/barretenberg/backend.ts +++ b/barretenberg/ts/src/barretenberg/backend.ts @@ -48,11 +48,16 @@ export type UltraHonkBackendOptions = { * Use this when you want to verify the created proof on an EVM chain. */ keccakZK?: boolean; - /**S electing this option will use the poseidon/stark252 hash function instead of poseidon + /** Selecting this option will use the poseidon/stark252 hash function instead of poseidon * when generating challenges in the proof. * Use this when you want to verify the created proof on an Starknet chain with Garaga. */ starknet?: boolean; + /** Selecting this option will use the poseidon/stark252 hash function instead of poseidon + * when generating challenges in the proof. + * Use this when you want to verify the created proof on an Starknet chain with Garaga. + */ + starknetZK?: boolean; }; export class UltraHonkBackend { @@ -90,10 +95,12 @@ export class UltraHonkBackend { const proveUltraHonk = options?.keccak ? this.api.acirProveUltraKeccakHonk.bind(this.api) : options?.keccakZK - ? this.api.acirProveUltraKeccakZKHonk.bind(this.api) + ? this.api.acirProveUltraKeccakZkHonk.bind(this.api) : options?.starknet ? this.api.acirProveUltraStarknetHonk.bind(this.api) - : this.api.acirProveUltraHonk.bind(this.api); + : options?.starknetZK + ? this.api.acirProveUltraStarknetZkHonk.bind(this.api) + : this.api.acirProveUltraHonk.bind(this.api); const proofWithPublicInputs = await proveUltraHonk(this.acirUncompressedBytecode, gunzip(compressedWitness)); @@ -101,10 +108,12 @@ export class UltraHonkBackend { const writeVKUltraHonk = options?.keccak ? this.api.acirWriteVkUltraKeccakHonk.bind(this.api) : options?.keccakZK - ? this.api.acirWriteVkUltraKeccakZKHonk.bind(this.api) + ? this.api.acirWriteVkUltraKeccakZkHonk.bind(this.api) : options?.starknet ? this.api.acirWriteVkUltraStarknetHonk.bind(this.api) - : this.api.acirWriteVkUltraHonk.bind(this.api); + : options?.starknetZK + ? this.api.acirWriteVkUltraStarknetZkHonk.bind(this.api) + : this.api.acirWriteVkUltraHonk.bind(this.api); const vk = await writeVKUltraHonk(this.acirUncompressedBytecode); const vkAsFields = await this.api.acirVkAsFieldsUltraHonk(new RawBuffer(vk)); @@ -127,17 +136,21 @@ export class UltraHonkBackend { const writeVkUltraHonk = options?.keccak ? this.api.acirWriteVkUltraKeccakHonk.bind(this.api) : options?.keccakZK - ? this.api.acirWriteVkUltraKeccakZKHonk.bind(this.api) + ? this.api.acirWriteVkUltraKeccakZkHonk.bind(this.api) : options?.starknet ? this.api.acirWriteVkUltraStarknetHonk.bind(this.api) - : this.api.acirWriteVkUltraHonk.bind(this.api); + : options?.starknetZK + ? this.api.acirWriteVkUltraStarknetZkHonk.bind(this.api) + : this.api.acirWriteVkUltraHonk.bind(this.api); const verifyUltraHonk = options?.keccak ? this.api.acirVerifyUltraKeccakHonk.bind(this.api) : options?.keccakZK - ? this.api.acirVerifyUltraKeccakZKHonk.bind(this.api) + ? this.api.acirVerifyUltraKeccakZkHonk.bind(this.api) : options?.starknet ? this.api.acirVerifyUltraStarknetHonk.bind(this.api) - : this.api.acirVerifyUltraHonk.bind(this.api); + : options?.starknetZK + ? this.api.acirVerifyUltraStarknetZkHonk.bind(this.api) + : this.api.acirVerifyUltraHonk.bind(this.api); const vkBuf = await writeVkUltraHonk(this.acirUncompressedBytecode); return await verifyUltraHonk(proof, new RawBuffer(vkBuf)); @@ -148,10 +161,12 @@ export class UltraHonkBackend { return options?.keccak ? await this.api.acirWriteVkUltraKeccakHonk(this.acirUncompressedBytecode) : options?.keccakZK - ? await this.api.acirWriteVkUltraKeccakZKHonk(this.acirUncompressedBytecode) + ? await this.api.acirWriteVkUltraKeccakZkHonk(this.acirUncompressedBytecode) : options?.starknet ? await this.api.acirWriteVkUltraStarknetHonk(this.acirUncompressedBytecode) - : await this.api.acirWriteVkUltraHonk(this.acirUncompressedBytecode); + : options?.starknetZK + ? await this.api.acirWriteVkUltraStarknetZkHonk(this.acirUncompressedBytecode) + : await this.api.acirWriteVkUltraHonk(this.acirUncompressedBytecode); } /** @description Returns a solidity verifier */ diff --git a/barretenberg/ts/src/barretenberg_api/index.ts b/barretenberg/ts/src/barretenberg_api/index.ts index 07c10bc0274a..bb92d58eac5f 100644 --- a/barretenberg/ts/src/barretenberg_api/index.ts +++ b/barretenberg/ts/src/barretenberg_api/index.ts @@ -472,7 +472,7 @@ export class BarretenbergApi { return out[0]; } - async acirProveUltraKeccakZKHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Promise { + async acirProveUltraKeccakZkHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Promise { const inArgs = [acirVec, witnessVec].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = await this.wasm.callWasmExport( @@ -496,6 +496,18 @@ export class BarretenbergApi { return out[0]; } + async acirProveUltraStarknetZkHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Promise { + const inArgs = [acirVec, witnessVec].map(serializeBufferable); + const outTypes: OutputType[] = [BufferDeserializer()]; + const result = await this.wasm.callWasmExport( + 'acir_prove_ultra_starknet_zk_honk', + inArgs, + outTypes.map(t => t.SIZE_IN_BYTES), + ); + const out = result.map((r, i) => outTypes[i].fromBuffer(r)); + return out[0]; + } + async acirVerifyUltraHonk(proofBuf: Uint8Array, vkBuf: Uint8Array): Promise { const inArgs = [proofBuf, vkBuf].map(serializeBufferable); const outTypes: OutputType[] = [BoolDeserializer()]; @@ -520,7 +532,7 @@ export class BarretenbergApi { return out[0]; } - async acirVerifyUltraKeccakZKHonk(proofBuf: Uint8Array, vkBuf: Uint8Array): Promise { + async acirVerifyUltraKeccakZkHonk(proofBuf: Uint8Array, vkBuf: Uint8Array): Promise { const inArgs = [proofBuf, vkBuf].map(serializeBufferable); const outTypes: OutputType[] = [BoolDeserializer()]; const result = await this.wasm.callWasmExport( @@ -544,6 +556,18 @@ export class BarretenbergApi { return out[0]; } + async acirVerifyUltraStarknetZkHonk(proofBuf: Uint8Array, vkBuf: Uint8Array): Promise { + const inArgs = [proofBuf, vkBuf].map(serializeBufferable); + const outTypes: OutputType[] = [BoolDeserializer()]; + const result = await this.wasm.callWasmExport( + 'acir_verify_ultra_starknet_zk_honk', + inArgs, + outTypes.map(t => t.SIZE_IN_BYTES), + ); + const out = result.map((r, i) => outTypes[i].fromBuffer(r)); + return out[0]; + } + async acirWriteVkUltraHonk(acirVec: Uint8Array): Promise { const inArgs = [acirVec].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; @@ -568,7 +592,7 @@ export class BarretenbergApi { return out[0]; } - async acirWriteVkUltraKeccakZKHonk(acirVec: Uint8Array): Promise { + async acirWriteVkUltraKeccakZkHonk(acirVec: Uint8Array): Promise { const inArgs = [acirVec].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = await this.wasm.callWasmExport( @@ -592,6 +616,18 @@ export class BarretenbergApi { return out[0]; } + async acirWriteVkUltraStarknetZkHonk(acirVec: Uint8Array): Promise { + const inArgs = [acirVec].map(serializeBufferable); + const outTypes: OutputType[] = [BufferDeserializer()]; + const result = await this.wasm.callWasmExport( + 'acir_write_vk_ultra_starknet_zk_honk', + inArgs, + outTypes.map(t => t.SIZE_IN_BYTES), + ); + const out = result.map((r, i) => outTypes[i].fromBuffer(r)); + return out[0]; + } + async acirProofAsFieldsUltraHonk(proofBuf: Uint8Array): Promise { const inArgs = [proofBuf].map(serializeBufferable); const outTypes: OutputType[] = [VectorDeserializer(Fr)]; @@ -1092,7 +1128,7 @@ export class BarretenbergApiSync { return out[0]; } - acirProveUltraKeccakZKHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Uint8Array { + acirProveUltraKeccakZkHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Uint8Array { const inArgs = [acirVec, witnessVec].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = this.wasm.callWasmExport( @@ -1104,11 +1140,23 @@ export class BarretenbergApiSync { return out[0]; } - acirProveUltraKeccakZkHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Uint8Array { + acirProveUltraStarknetHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Uint8Array { const inArgs = [acirVec, witnessVec].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = this.wasm.callWasmExport( - 'acir_prove_ultra_keccak_zk_honk', + 'acir_prove_ultra_starknet_honk', + inArgs, + outTypes.map(t => t.SIZE_IN_BYTES), + ); + const out = result.map((r, i) => outTypes[i].fromBuffer(r)); + return out[0]; + } + + acirProveUltraStarknetZkHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Uint8Array { + const inArgs = [acirVec, witnessVec].map(serializeBufferable); + const outTypes: OutputType[] = [BufferDeserializer()]; + const result = this.wasm.callWasmExport( + 'acir_prove_ultra_starknet_zk_honk', inArgs, outTypes.map(t => t.SIZE_IN_BYTES), ); @@ -1128,7 +1176,19 @@ export class BarretenbergApiSync { return out[0]; } - acirVerifyUltraKeccakZKHonk(proofBuf: Uint8Array, vkBuf: Uint8Array): boolean { + acirVerifyUltraKeccakHonk(proofBuf: Uint8Array, vkBuf: Uint8Array): boolean { + const inArgs = [proofBuf, vkBuf].map(serializeBufferable); + const outTypes: OutputType[] = [BoolDeserializer()]; + const result = this.wasm.callWasmExport( + 'acir_verify_ultra_keccak_honk', + inArgs, + outTypes.map(t => t.SIZE_IN_BYTES), + ); + const out = result.map((r, i) => outTypes[i].fromBuffer(r)); + return out[0]; + } + + acirVerifyUltraKeccakZkHonk(proofBuf: Uint8Array, vkBuf: Uint8Array): boolean { const inArgs = [proofBuf, vkBuf].map(serializeBufferable); const outTypes: OutputType[] = [BoolDeserializer()]; const result = this.wasm.callWasmExport( @@ -1140,6 +1200,30 @@ export class BarretenbergApiSync { return out[0]; } + acirVerifyUltraStarknetHonk(proofBuf: Uint8Array, vkBuf: Uint8Array): boolean { + const inArgs = [proofBuf, vkBuf].map(serializeBufferable); + const outTypes: OutputType[] = [BoolDeserializer()]; + const result = this.wasm.callWasmExport( + 'acir_verify_ultra_starknet_honk', + inArgs, + outTypes.map(t => t.SIZE_IN_BYTES), + ); + const out = result.map((r, i) => outTypes[i].fromBuffer(r)); + return out[0]; + } + + acirVerifyUltraStarknetZkHonk(proofBuf: Uint8Array, vkBuf: Uint8Array): boolean { + const inArgs = [proofBuf, vkBuf].map(serializeBufferable); + const outTypes: OutputType[] = [BoolDeserializer()]; + const result = this.wasm.callWasmExport( + 'acir_verify_ultra_starknet_zk_honk', + inArgs, + outTypes.map(t => t.SIZE_IN_BYTES), + ); + const out = result.map((r, i) => outTypes[i].fromBuffer(r)); + return out[0]; + } + acirWriteVkUltraHonk(acirVec: Uint8Array): Uint8Array { const inArgs = [acirVec].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; @@ -1164,7 +1248,7 @@ export class BarretenbergApiSync { return out[0]; } - acirWriteVkUltraKeccakZKHonk(acirVec: Uint8Array): Uint8Array { + acirWriteVkUltraKeccakZkHonk(acirVec: Uint8Array): Uint8Array { const inArgs = [acirVec].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = this.wasm.callWasmExport( @@ -1176,6 +1260,30 @@ export class BarretenbergApiSync { return out[0]; } + acirWriteVkUltraStarknetHonk(acirVec: Uint8Array): Uint8Array { + const inArgs = [acirVec].map(serializeBufferable); + const outTypes: OutputType[] = [BufferDeserializer()]; + const result = this.wasm.callWasmExport( + 'acir_write_vk_ultra_starknet_honk', + inArgs, + outTypes.map(t => t.SIZE_IN_BYTES), + ); + const out = result.map((r, i) => outTypes[i].fromBuffer(r)); + return out[0]; + } + + acirWriteVkUltraStarknetZkHonk(acirVec: Uint8Array): Uint8Array { + const inArgs = [acirVec].map(serializeBufferable); + const outTypes: OutputType[] = [BufferDeserializer()]; + const result = this.wasm.callWasmExport( + 'acir_write_vk_ultra_starknet_zk_honk', + inArgs, + outTypes.map(t => t.SIZE_IN_BYTES), + ); + const out = result.map((r, i) => outTypes[i].fromBuffer(r)); + return out[0]; + } + acirProofAsFieldsUltraHonk(proofBuf: Uint8Array): Fr[] { const inArgs = [proofBuf].map(serializeBufferable); const outTypes: OutputType[] = [VectorDeserializer(Fr)]; diff --git a/barretenberg/ts/src/main.ts b/barretenberg/ts/src/main.ts index 6aabde543a28..187c9d51eff2 100755 --- a/barretenberg/ts/src/main.ts +++ b/barretenberg/ts/src/main.ts @@ -400,10 +400,12 @@ export async function proveUltraHonk( const acirProveUltraHonk = options?.keccak ? api.acirProveUltraKeccakHonk.bind(api) : options?.keccakZK - ? api.acirProveUltraKeccakZKHonk.bind(api) + ? api.acirProveUltraKeccakZkHonk.bind(api) : options?.starknet ? api.acirProveUltraStarknetHonk.bind(api) - : api.acirProveUltraHonk.bind(api); + : options?.starknetZK + ? api.acirProveUltraStarknetZkHonk.bind(api) + : api.acirProveUltraHonk.bind(api); const proof = await acirProveUltraHonk(bytecode, witness); if (outputPath === '-') { @@ -432,10 +434,12 @@ export async function writeVkUltraHonk( const acirWriteVkUltraHonk = options?.keccak ? api.acirWriteVkUltraKeccakHonk.bind(api) : options?.keccakZK - ? api.acirWriteVkUltraKeccakZKHonk.bind(api) + ? api.acirWriteVkUltraKeccakZkHonk.bind(api) : options?.starknet ? api.acirWriteVkUltraStarknetHonk.bind(api) - : api.acirWriteVkUltraHonk.bind(api); + : options?.starknetZK + ? api.acirWriteVkUltraStarknetZkHonk.bind(api) + : api.acirWriteVkUltraHonk.bind(api); const vk = await acirWriteVkUltraHonk(bytecode); if (outputPath === '-') { @@ -461,10 +465,12 @@ export async function verifyUltraHonk( const acirVerifyUltraHonk = options?.keccak ? api.acirVerifyUltraKeccakHonk.bind(api) : options?.keccakZK - ? api.acirVerifyUltraKeccakZKHonk.bind(api) + ? api.acirVerifyUltraKeccakZkHonk.bind(api) : options?.starknet ? api.acirVerifyUltraStarknetHonk.bind(api) - : api.acirVerifyUltraHonk.bind(api); + : options?.starknetZK + ? api.acirVerifyUltraStarknetZkHonk.bind(api) + : api.acirVerifyUltraHonk.bind(api); const verified = await acirVerifyUltraHonk( Uint8Array.from(readFileSync(proofPath)), new RawBuffer(readFileSync(vkPath)),