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 8d1f060a74e..bd76ac0ee10 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.hpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.hpp @@ -86,4 +86,12 @@ WASM_EXPORT void acir_serialize_verification_key_into_fields(in_ptr acir_compose fr::vec_out_buf out_vkey, fr::out_buf out_key_hash); -WASM_EXPORT void acir_prove_ultra_honk(uint8_t const* acir_vec, uint8_t const* witness_vec, uint8_t** out); \ No newline at end of file +WASM_EXPORT void acir_prove_ultra_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_write_vk_ultra_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); + +WASM_EXPORT void acir_vk_as_fields_ultra_honk(uint8_t const* vk_buf, fr::vec_out_buf out_vkey); \ No newline at end of file diff --git a/barretenberg/exports.json b/barretenberg/exports.json index b0ed6310fb3..6db6db70a6b 100644 --- a/barretenberg/exports.json +++ b/barretenberg/exports.json @@ -839,5 +839,93 @@ } ], "isAsync": false + }, + { + "functionName": "acir_prove_ultra_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": [ + { + "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": [ + { + "name": "acir_vec", + "type": "const uint8_t *" + } + ], + "outArgs": [ + { + "name": "out", + "type": "uint8_t **" + } + ], + "isAsync": false + }, + { + "functionName": "acir_proof_as_fields_ultra_honk", + "inArgs": [ + { + "name": "proof_buf", + "type": "const uint8_t *" + } + ], + "outArgs": [ + { + "name": "out", + "type": "fr::vec_out_buf" + } + ], + "isAsync": false + }, + { + "functionName": "acir_vk_as_fields_ultra_honk", + "inArgs": [ + { + "name": "vk_buf", + "type": "const uint8_t *" + } + ], + "outArgs": [ + { + "name": "out_vkey", + "type": "fr::vec_out_buf" + } + ], + "isAsync": false } ] diff --git a/barretenberg/ts/src/barretenberg_api/index.ts b/barretenberg/ts/src/barretenberg_api/index.ts index c7972d38869..1a3d112877d 100644 --- a/barretenberg/ts/src/barretenberg_api/index.ts +++ b/barretenberg/ts/src/barretenberg_api/index.ts @@ -568,8 +568,8 @@ export class BarretenbergApi { return out as any; } - async acirProveUltraHonk(constraintSystemBuf: Uint8Array, witnessBuf: Uint8Array): Promise { - const inArgs = [constraintSystemBuf, witnessBuf].map(serializeBufferable); + async acirProveUltraHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Promise { + const inArgs = [acirVec, witnessVec].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = await this.wasm.callWasmExport( 'acir_prove_ultra_honk', @@ -592,8 +592,8 @@ export class BarretenbergApi { return out[0]; } - async acirWriteVkUltraHonk(constraintSystemBuf: Uint8Array): Promise { - const inArgs = [constraintSystemBuf].map(serializeBufferable); + async acirWriteVkUltraHonk(acirVec: Uint8Array): Promise { + const inArgs = [acirVec].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = await this.wasm.callWasmExport( 'acir_write_vk_ultra_honk', @@ -625,7 +625,7 @@ export class BarretenbergApi { outTypes.map(t => t.SIZE_IN_BYTES), ); const out = result.map((r, i) => outTypes[i].fromBuffer(r)); - return out as any; + return out[0]; } } export class BarretenbergApiSync { @@ -1172,8 +1172,8 @@ export class BarretenbergApiSync { return out as any; } - acirUltraHonkProve(constraintSystemBuf: Uint8Array, witnessBuf: Uint8Array): Uint8Array { - const inArgs = [constraintSystemBuf, witnessBuf].map(serializeBufferable); + acirProveUltraHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Uint8Array { + const inArgs = [acirVec, witnessVec].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = this.wasm.callWasmExport( 'acir_prove_ultra_honk', @@ -1196,8 +1196,8 @@ export class BarretenbergApiSync { return out[0]; } - acirWriteVkUltraHonk(constraintSystemBuf: Uint8Array): Uint8Array { - const inArgs = [constraintSystemBuf].map(serializeBufferable); + acirWriteVkUltraHonk(acirVec: Uint8Array): Uint8Array { + const inArgs = [acirVec].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = this.wasm.callWasmExport( 'acir_write_vk_ultra_honk', @@ -1229,6 +1229,6 @@ export class BarretenbergApiSync { outTypes.map(t => t.SIZE_IN_BYTES), ); const out = result.map((r, i) => outTypes[i].fromBuffer(r)); - return out as any; + return out[0]; } }