@noir-lang/acvm_js
Advanced tools
Comparing version 0.40.0 to 0.41.0
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function getPublicWitness(a: number, b: number, c: number, d: number): void; | ||
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void; | ||
export function getReturnWitness(a: number, b: number, c: number, d: number): void; | ||
export function initLogLevel(a: number, b: number, c: number): void; | ||
export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number; | ||
@@ -12,2 +8,7 @@ export function executeCircuit(a: number, b: number, c: number, d: number): number; | ||
export function __wbg_wasmblackboxfunctionsolver_free(a: number): void; | ||
export function getPublicWitness(a: number, b: number, c: number, d: number): void; | ||
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void; | ||
export function getReturnWitness(a: number, b: number, c: number, d: number): void; | ||
export function decompressWitness(a: number, b: number, c: number): void; | ||
export function compressWitness(a: number, b: number): void; | ||
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number; | ||
@@ -20,4 +21,3 @@ export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number; | ||
export function and(a: number, b: number): number; | ||
export function decompressWitness(a: number, b: number, c: number): void; | ||
export function compressWitness(a: number, b: number): void; | ||
export function initLogLevel(a: number, b: number, c: number): void; | ||
export function buildInfo(): number; | ||
@@ -29,6 +29,6 @@ export function __wbg_trap_free(a: number): void; | ||
export const __wbindgen_export_2: WebAssembly.Table; | ||
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0c6c8312617d6ad4(a: number, b: number, c: number): void; | ||
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hfdf1d0fa4debaf70(a: number, b: number, c: number): void; | ||
export function __wbindgen_add_to_stack_pointer(a: number): number; | ||
export function __wbindgen_free(a: number, b: number): void; | ||
export function __wbindgen_exn_store(a: number): void; | ||
export function wasm_bindgen__convert__closures__invoke2_mut__hc5e8ba855f687f9d(a: number, b: number, c: number, d: number): void; | ||
export function wasm_bindgen__convert__closures__invoke2_mut__h79f8a29187e94f15(a: number, b: number, c: number, d: number): void; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver. | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
*/ | ||
export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>; | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
*/ | ||
export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>; | ||
/** | ||
* @returns {Promise<WasmBlackBoxFunctionSolver>} | ||
*/ | ||
export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs. | ||
@@ -37,31 +60,16 @@ * | ||
/** | ||
* Sets the package's logging level. | ||
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`. | ||
* | ||
* @param {LogLevel} level - The maximum level of logging to be emitted. | ||
* @param {Uint8Array} compressed_witness - A compressed witness. | ||
* @returns {WitnessMap} The decompressed witness map. | ||
*/ | ||
export function initLogLevel(filter: string): void; | ||
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap; | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* Compresses a `WitnessMap` into the binary format outputted by Nargo. | ||
* | ||
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver. | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
* @param {Uint8Array} compressed_witness - A witness map. | ||
* @returns {WitnessMap} A compressed witness map | ||
*/ | ||
export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>; | ||
export function compressWitness(witness_map: WitnessMap): Uint8Array; | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
*/ | ||
export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>; | ||
/** | ||
* @returns {Promise<WasmBlackBoxFunctionSolver>} | ||
*/ | ||
export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>; | ||
/** | ||
* Verifies a ECDSA signature over the secp256r1 curve. | ||
@@ -117,16 +125,8 @@ * @param {Uint8Array} hashed_msg | ||
/** | ||
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`. | ||
* Sets the package's logging level. | ||
* | ||
* @param {Uint8Array} compressed_witness - A compressed witness. | ||
* @returns {WitnessMap} The decompressed witness map. | ||
* @param {LogLevel} level - The maximum level of logging to be emitted. | ||
*/ | ||
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap; | ||
export function initLogLevel(filter: string): void; | ||
/** | ||
* Compresses a `WitnessMap` into the binary format outputted by Nargo. | ||
* | ||
* @param {Uint8Array} compressed_witness - A witness map. | ||
* @returns {WitnessMap} A compressed witness map | ||
*/ | ||
export function compressWitness(witness_map: WitnessMap): Uint8Array; | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
@@ -137,13 +137,2 @@ * @returns {BuildInfo} - Information on how the installed package was built. | ||
// Map from witness index to hex string value of witness. | ||
export type WitnessMap = Map<number, string>; | ||
export type ExecutionError = Error & { | ||
callStack?: string[]; | ||
}; | ||
export type ForeignCallInput = string[] | ||
@@ -163,2 +152,13 @@ export type ForeignCallOutput = string | string[] | ||
// Map from witness index to hex string value of witness. | ||
export type WitnessMap = Map<number, string>; | ||
export type ExecutionError = Error & { | ||
callStack?: string[]; | ||
}; | ||
/** | ||
@@ -165,0 +165,0 @@ * @typedef {Object} BuildInfo - Information about how the installed package was built |
@@ -229,5 +229,12 @@ let imports = {}; | ||
function __wbg_adapter_52(arg0, arg1, arg2) { | ||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0c6c8312617d6ad4(arg0, arg1, addHeapObject(arg2)); | ||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hfdf1d0fa4debaf70(arg0, arg1, addHeapObject(arg2)); | ||
} | ||
function _assertClass(instance, klass) { | ||
if (!(instance instanceof klass)) { | ||
throw new Error(`expected instance of ${klass.name}`); | ||
} | ||
return instance.ptr; | ||
} | ||
function passArray8ToWasm0(arg, malloc) { | ||
@@ -240,2 +247,42 @@ const ptr = malloc(arg.length * 1) >>> 0; | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver. | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
*/ | ||
module.exports.executeCircuitWithBlackBoxSolver = function(solver, circuit, initial_witness, foreign_call_handler) { | ||
_assertClass(solver, WasmBlackBoxFunctionSolver); | ||
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuitWithBlackBoxSolver(solver.__wbg_ptr, ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler)); | ||
return takeObject(ret); | ||
}; | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
*/ | ||
module.exports.executeCircuit = function(circuit, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler)); | ||
return takeObject(ret); | ||
}; | ||
/** | ||
* @returns {Promise<WasmBlackBoxFunctionSolver>} | ||
*/ | ||
module.exports.createBlackBoxSolver = function() { | ||
const ret = wasm.createBlackBoxSolver(); | ||
return takeObject(ret); | ||
}; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs. | ||
@@ -325,17 +372,20 @@ * | ||
/** | ||
* Sets the package's logging level. | ||
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`. | ||
* | ||
* @param {LogLevel} level - The maximum level of logging to be emitted. | ||
* @param {Uint8Array} compressed_witness - A compressed witness. | ||
* @returns {WitnessMap} The decompressed witness map. | ||
*/ | ||
module.exports.initLogLevel = function(filter) { | ||
module.exports.decompressWitness = function(compressed_witness) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.initLogLevel(retptr, ptr0, len0); | ||
wasm.decompressWitness(retptr, ptr0, len0); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
if (r1) { | ||
throw takeObject(r0); | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
@@ -346,49 +396,32 @@ wasm.__wbindgen_add_to_stack_pointer(16); | ||
function _assertClass(instance, klass) { | ||
if (!(instance instanceof klass)) { | ||
throw new Error(`expected instance of ${klass.name}`); | ||
} | ||
return instance.ptr; | ||
function getArrayU8FromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); | ||
} | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* Compresses a `WitnessMap` into the binary format outputted by Nargo. | ||
* | ||
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver. | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
* @param {Uint8Array} compressed_witness - A witness map. | ||
* @returns {WitnessMap} A compressed witness map | ||
*/ | ||
module.exports.executeCircuitWithBlackBoxSolver = function(solver, circuit, initial_witness, foreign_call_handler) { | ||
_assertClass(solver, WasmBlackBoxFunctionSolver); | ||
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuitWithBlackBoxSolver(solver.__wbg_ptr, ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler)); | ||
return takeObject(ret); | ||
module.exports.compressWitness = function(witness_map) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.compressWitness(retptr, addHeapObject(witness_map)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
if (r3) { | ||
throw takeObject(r2); | ||
} | ||
var v1 = getArrayU8FromWasm0(r0, r1).slice(); | ||
wasm.__wbindgen_free(r0, r1 * 1); | ||
return v1; | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
}; | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
*/ | ||
module.exports.executeCircuit = function(circuit, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler)); | ||
return takeObject(ret); | ||
}; | ||
/** | ||
* @returns {Promise<WasmBlackBoxFunctionSolver>} | ||
*/ | ||
module.exports.createBlackBoxSolver = function() { | ||
const ret = wasm.createBlackBoxSolver(); | ||
return takeObject(ret); | ||
}; | ||
/** | ||
* Verifies a ECDSA signature over the secp256r1 curve. | ||
@@ -435,6 +468,2 @@ * @param {Uint8Array} hashed_msg | ||
function getArrayU8FromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); | ||
} | ||
/** | ||
@@ -526,20 +555,17 @@ * Calculates the Keccak256 hash of the input bytes | ||
/** | ||
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`. | ||
* Sets the package's logging level. | ||
* | ||
* @param {Uint8Array} compressed_witness - A compressed witness. | ||
* @returns {WitnessMap} The decompressed witness map. | ||
* @param {LogLevel} level - The maximum level of logging to be emitted. | ||
*/ | ||
module.exports.decompressWitness = function(compressed_witness) { | ||
module.exports.initLogLevel = function(filter) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc); | ||
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.decompressWitness(retptr, ptr0, len0); | ||
wasm.initLogLevel(retptr, ptr0, len0); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
if (r1) { | ||
throw takeObject(r0); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
@@ -551,27 +577,2 @@ wasm.__wbindgen_add_to_stack_pointer(16); | ||
/** | ||
* Compresses a `WitnessMap` into the binary format outputted by Nargo. | ||
* | ||
* @param {Uint8Array} compressed_witness - A witness map. | ||
* @returns {WitnessMap} A compressed witness map | ||
*/ | ||
module.exports.compressWitness = function(witness_map) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.compressWitness(retptr, addHeapObject(witness_map)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
if (r3) { | ||
throw takeObject(r2); | ||
} | ||
var v1 = getArrayU8FromWasm0(r0, r1).slice(); | ||
wasm.__wbindgen_free(r0, r1 * 1); | ||
return v1; | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
}; | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
@@ -593,3 +594,3 @@ * @returns {BuildInfo} - Information on how the installed package was built. | ||
function __wbg_adapter_159(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__hc5e8ba855f687f9d(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h79f8a29187e94f15(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
} | ||
@@ -652,2 +653,12 @@ | ||
module.exports.__wbindgen_error_new = function(arg0, arg1) { | ||
const ret = new Error(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_object_clone_ref = function(arg0) { | ||
const ret = getObject(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_wasmblackboxfunctionsolver_new = function(arg0) { | ||
@@ -658,4 +669,9 @@ const ret = WasmBlackBoxFunctionSolver.__wrap(arg0); | ||
module.exports.__wbindgen_is_array = function(arg0) { | ||
const ret = Array.isArray(getObject(arg0)); | ||
module.exports.__wbindgen_cb_drop = function(arg0) { | ||
const obj = takeObject(arg0).original; | ||
if (obj.cnt-- == 1) { | ||
obj.a = 0; | ||
return true; | ||
} | ||
const ret = false; | ||
return ret; | ||
@@ -669,13 +685,3 @@ }; | ||
module.exports.__wbg_constructor_8444207292d12e94 = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_is_string = function(arg0) { | ||
const ret = typeof(getObject(arg0)) === 'string'; | ||
return ret; | ||
}; | ||
module.exports.__wbg_new_12499e712355d566 = function() { | ||
module.exports.__wbg_new_ab82e8584bdd2143 = function() { | ||
const ret = new Map(); | ||
@@ -699,2 +705,7 @@ return addHeapObject(ret); | ||
module.exports.__wbg_constructor_d9cb984c4e2c6bcd = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_number_get = function(arg0, arg1) { | ||
@@ -707,24 +718,14 @@ const obj = getObject(arg1); | ||
module.exports.__wbindgen_error_new = function(arg0, arg1) { | ||
const ret = new Error(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
module.exports.__wbindgen_is_undefined = function(arg0) { | ||
const ret = getObject(arg0) === undefined; | ||
return ret; | ||
}; | ||
module.exports.__wbindgen_object_clone_ref = function(arg0) { | ||
const ret = getObject(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_cb_drop = function(arg0) { | ||
const obj = takeObject(arg0).original; | ||
if (obj.cnt-- == 1) { | ||
obj.a = 0; | ||
return true; | ||
} | ||
const ret = false; | ||
module.exports.__wbindgen_is_string = function(arg0) { | ||
const ret = typeof(getObject(arg0)) === 'string'; | ||
return ret; | ||
}; | ||
module.exports.__wbindgen_is_undefined = function(arg0) { | ||
const ret = getObject(arg0) === undefined; | ||
module.exports.__wbindgen_is_array = function(arg0) { | ||
const ret = Array.isArray(getObject(arg0)); | ||
return ret; | ||
@@ -758,12 +759,2 @@ }; | ||
module.exports.__wbindgen_bigint_from_i64 = function(arg0) { | ||
const ret = arg0; | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_bigint_from_u128 = function(arg0, arg1) { | ||
const ret = BigInt.asUintN(64, arg0) << BigInt(64) | BigInt.asUintN(64, arg1); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_ge = function(arg0, arg1) { | ||
@@ -794,10 +785,15 @@ const ret = getObject(arg0) >= getObject(arg1); | ||
module.exports.__wbg_instanceof_Global_1c3b64df1a5c886c = function(arg0) { | ||
let result; | ||
try { | ||
result = getObject(arg0) instanceof WebAssembly.Global; | ||
} catch { | ||
result = false; | ||
} | ||
const ret = result; | ||
module.exports.__wbindgen_bigint_from_i64 = function(arg0) { | ||
const ret = arg0; | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_bigint_from_u128 = function(arg0, arg1) { | ||
const ret = BigInt.asUintN(64, arg0) << BigInt(64) | BigInt.asUintN(64, arg1); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_is_object = function(arg0) { | ||
const val = getObject(arg0); | ||
const ret = typeof(val) === 'object' && val !== null; | ||
return ret; | ||
@@ -811,5 +807,10 @@ }; | ||
module.exports.__wbindgen_is_object = function(arg0) { | ||
const val = getObject(arg0); | ||
const ret = typeof(val) === 'object' && val !== null; | ||
module.exports.__wbg_instanceof_Global_f4b019d2b45e18ab = function(arg0) { | ||
let result; | ||
try { | ||
result = getObject(arg0) instanceof WebAssembly.Global; | ||
} catch { | ||
result = false; | ||
} | ||
const ret = result; | ||
return ret; | ||
@@ -1148,2 +1149,7 @@ }; | ||
module.exports.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) { | ||
const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
module.exports.__wbg_compile_eefe73dfb19bff3d = function(arg0) { | ||
@@ -1216,7 +1222,2 @@ const ret = WebAssembly.compile(getObject(arg0)); | ||
module.exports.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) { | ||
const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
module.exports.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) { | ||
@@ -1251,4 +1252,4 @@ const v = getObject(arg1); | ||
module.exports.__wbindgen_closure_wrapper1433 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 501, __wbg_adapter_52); | ||
module.exports.__wbindgen_closure_wrapper1388 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 484, __wbg_adapter_52); | ||
return addHeapObject(ret); | ||
@@ -1255,0 +1256,0 @@ }; |
{ | ||
"name": "@noir-lang/acvm_js", | ||
"version": "0.40.0", | ||
"version": "0.41.0", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function getPublicWitness(a: number, b: number, c: number, d: number): void; | ||
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void; | ||
export function getReturnWitness(a: number, b: number, c: number, d: number): void; | ||
export function initLogLevel(a: number, b: number, c: number): void; | ||
export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number; | ||
@@ -12,2 +8,7 @@ export function executeCircuit(a: number, b: number, c: number, d: number): number; | ||
export function __wbg_wasmblackboxfunctionsolver_free(a: number): void; | ||
export function getPublicWitness(a: number, b: number, c: number, d: number): void; | ||
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void; | ||
export function getReturnWitness(a: number, b: number, c: number, d: number): void; | ||
export function decompressWitness(a: number, b: number, c: number): void; | ||
export function compressWitness(a: number, b: number): void; | ||
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number; | ||
@@ -20,4 +21,3 @@ export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number; | ||
export function and(a: number, b: number): number; | ||
export function decompressWitness(a: number, b: number, c: number): void; | ||
export function compressWitness(a: number, b: number): void; | ||
export function initLogLevel(a: number, b: number, c: number): void; | ||
export function buildInfo(): number; | ||
@@ -29,6 +29,6 @@ export function __wbg_trap_free(a: number): void; | ||
export const __wbindgen_export_2: WebAssembly.Table; | ||
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0c6c8312617d6ad4(a: number, b: number, c: number): void; | ||
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hfdf1d0fa4debaf70(a: number, b: number, c: number): void; | ||
export function __wbindgen_add_to_stack_pointer(a: number): number; | ||
export function __wbindgen_free(a: number, b: number): void; | ||
export function __wbindgen_exn_store(a: number): void; | ||
export function wasm_bindgen__convert__closures__invoke2_mut__hc5e8ba855f687f9d(a: number, b: number, c: number, d: number): void; | ||
export function wasm_bindgen__convert__closures__invoke2_mut__h79f8a29187e94f15(a: number, b: number, c: number, d: number): void; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver. | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
*/ | ||
export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>; | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
*/ | ||
export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>; | ||
/** | ||
* @returns {Promise<WasmBlackBoxFunctionSolver>} | ||
*/ | ||
export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs. | ||
@@ -37,31 +60,16 @@ * | ||
/** | ||
* Sets the package's logging level. | ||
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`. | ||
* | ||
* @param {LogLevel} level - The maximum level of logging to be emitted. | ||
* @param {Uint8Array} compressed_witness - A compressed witness. | ||
* @returns {WitnessMap} The decompressed witness map. | ||
*/ | ||
export function initLogLevel(filter: string): void; | ||
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap; | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* Compresses a `WitnessMap` into the binary format outputted by Nargo. | ||
* | ||
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver. | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
* @param {Uint8Array} compressed_witness - A witness map. | ||
* @returns {WitnessMap} A compressed witness map | ||
*/ | ||
export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>; | ||
export function compressWitness(witness_map: WitnessMap): Uint8Array; | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
*/ | ||
export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>; | ||
/** | ||
* @returns {Promise<WasmBlackBoxFunctionSolver>} | ||
*/ | ||
export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>; | ||
/** | ||
* Verifies a ECDSA signature over the secp256r1 curve. | ||
@@ -117,16 +125,8 @@ * @param {Uint8Array} hashed_msg | ||
/** | ||
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`. | ||
* Sets the package's logging level. | ||
* | ||
* @param {Uint8Array} compressed_witness - A compressed witness. | ||
* @returns {WitnessMap} The decompressed witness map. | ||
* @param {LogLevel} level - The maximum level of logging to be emitted. | ||
*/ | ||
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap; | ||
export function initLogLevel(filter: string): void; | ||
/** | ||
* Compresses a `WitnessMap` into the binary format outputted by Nargo. | ||
* | ||
* @param {Uint8Array} compressed_witness - A witness map. | ||
* @returns {WitnessMap} A compressed witness map | ||
*/ | ||
export function compressWitness(witness_map: WitnessMap): Uint8Array; | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
@@ -137,13 +137,2 @@ * @returns {BuildInfo} - Information on how the installed package was built. | ||
// Map from witness index to hex string value of witness. | ||
export type WitnessMap = Map<number, string>; | ||
export type ExecutionError = Error & { | ||
callStack?: string[]; | ||
}; | ||
export type ForeignCallInput = string[] | ||
@@ -163,2 +152,13 @@ export type ForeignCallOutput = string | string[] | ||
// Map from witness index to hex string value of witness. | ||
export type WitnessMap = Map<number, string>; | ||
export type ExecutionError = Error & { | ||
callStack?: string[]; | ||
}; | ||
/** | ||
@@ -187,6 +187,2 @@ * @typedef {Object} BuildInfo - Information about how the installed package was built | ||
readonly memory: WebAssembly.Memory; | ||
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void; | ||
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void; | ||
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void; | ||
readonly initLogLevel: (a: number, b: number, c: number) => void; | ||
readonly executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number; | ||
@@ -196,2 +192,7 @@ readonly executeCircuit: (a: number, b: number, c: number, d: number) => number; | ||
readonly __wbg_wasmblackboxfunctionsolver_free: (a: number) => void; | ||
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void; | ||
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void; | ||
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void; | ||
readonly decompressWitness: (a: number, b: number, c: number) => void; | ||
readonly compressWitness: (a: number, b: number) => void; | ||
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number; | ||
@@ -204,4 +205,3 @@ readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number; | ||
readonly and: (a: number, b: number) => number; | ||
readonly decompressWitness: (a: number, b: number, c: number) => void; | ||
readonly compressWitness: (a: number, b: number) => void; | ||
readonly initLogLevel: (a: number, b: number, c: number) => void; | ||
readonly buildInfo: () => number; | ||
@@ -213,7 +213,7 @@ readonly __wbg_trap_free: (a: number) => void; | ||
readonly __wbindgen_export_2: WebAssembly.Table; | ||
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0c6c8312617d6ad4: (a: number, b: number, c: number) => void; | ||
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hfdf1d0fa4debaf70: (a: number, b: number, c: number) => void; | ||
readonly __wbindgen_add_to_stack_pointer: (a: number) => number; | ||
readonly __wbindgen_free: (a: number, b: number) => void; | ||
readonly __wbindgen_exn_store: (a: number) => void; | ||
readonly wasm_bindgen__convert__closures__invoke2_mut__hc5e8ba855f687f9d: (a: number, b: number, c: number, d: number) => void; | ||
readonly wasm_bindgen__convert__closures__invoke2_mut__h79f8a29187e94f15: (a: number, b: number, c: number, d: number) => void; | ||
} | ||
@@ -220,0 +220,0 @@ |
@@ -226,5 +226,12 @@ let wasm; | ||
function __wbg_adapter_52(arg0, arg1, arg2) { | ||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0c6c8312617d6ad4(arg0, arg1, addHeapObject(arg2)); | ||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hfdf1d0fa4debaf70(arg0, arg1, addHeapObject(arg2)); | ||
} | ||
function _assertClass(instance, klass) { | ||
if (!(instance instanceof klass)) { | ||
throw new Error(`expected instance of ${klass.name}`); | ||
} | ||
return instance.ptr; | ||
} | ||
function passArray8ToWasm0(arg, malloc) { | ||
@@ -237,2 +244,42 @@ const ptr = malloc(arg.length * 1) >>> 0; | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver. | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
*/ | ||
export function executeCircuitWithBlackBoxSolver(solver, circuit, initial_witness, foreign_call_handler) { | ||
_assertClass(solver, WasmBlackBoxFunctionSolver); | ||
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuitWithBlackBoxSolver(solver.__wbg_ptr, ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler)); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
*/ | ||
export function executeCircuit(circuit, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler)); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* @returns {Promise<WasmBlackBoxFunctionSolver>} | ||
*/ | ||
export function createBlackBoxSolver() { | ||
const ret = wasm.createBlackBoxSolver(); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs. | ||
@@ -322,17 +369,20 @@ * | ||
/** | ||
* Sets the package's logging level. | ||
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`. | ||
* | ||
* @param {LogLevel} level - The maximum level of logging to be emitted. | ||
* @param {Uint8Array} compressed_witness - A compressed witness. | ||
* @returns {WitnessMap} The decompressed witness map. | ||
*/ | ||
export function initLogLevel(filter) { | ||
export function decompressWitness(compressed_witness) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.initLogLevel(retptr, ptr0, len0); | ||
wasm.decompressWitness(retptr, ptr0, len0); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
if (r1) { | ||
throw takeObject(r0); | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
@@ -343,49 +393,32 @@ wasm.__wbindgen_add_to_stack_pointer(16); | ||
function _assertClass(instance, klass) { | ||
if (!(instance instanceof klass)) { | ||
throw new Error(`expected instance of ${klass.name}`); | ||
} | ||
return instance.ptr; | ||
function getArrayU8FromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); | ||
} | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* Compresses a `WitnessMap` into the binary format outputted by Nargo. | ||
* | ||
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver. | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
* @param {Uint8Array} compressed_witness - A witness map. | ||
* @returns {WitnessMap} A compressed witness map | ||
*/ | ||
export function executeCircuitWithBlackBoxSolver(solver, circuit, initial_witness, foreign_call_handler) { | ||
_assertClass(solver, WasmBlackBoxFunctionSolver); | ||
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuitWithBlackBoxSolver(solver.__wbg_ptr, ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler)); | ||
return takeObject(ret); | ||
export function compressWitness(witness_map) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.compressWitness(retptr, addHeapObject(witness_map)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
if (r3) { | ||
throw takeObject(r2); | ||
} | ||
var v1 = getArrayU8FromWasm0(r0, r1).slice(); | ||
wasm.__wbindgen_free(r0, r1 * 1); | ||
return v1; | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
} | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`.. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit. | ||
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs. | ||
*/ | ||
export function executeCircuit(circuit, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler)); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* @returns {Promise<WasmBlackBoxFunctionSolver>} | ||
*/ | ||
export function createBlackBoxSolver() { | ||
const ret = wasm.createBlackBoxSolver(); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* Verifies a ECDSA signature over the secp256r1 curve. | ||
@@ -432,6 +465,2 @@ * @param {Uint8Array} hashed_msg | ||
function getArrayU8FromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); | ||
} | ||
/** | ||
@@ -523,20 +552,17 @@ * Calculates the Keccak256 hash of the input bytes | ||
/** | ||
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`. | ||
* Sets the package's logging level. | ||
* | ||
* @param {Uint8Array} compressed_witness - A compressed witness. | ||
* @returns {WitnessMap} The decompressed witness map. | ||
* @param {LogLevel} level - The maximum level of logging to be emitted. | ||
*/ | ||
export function decompressWitness(compressed_witness) { | ||
export function initLogLevel(filter) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc); | ||
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.decompressWitness(retptr, ptr0, len0); | ||
wasm.initLogLevel(retptr, ptr0, len0); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
if (r1) { | ||
throw takeObject(r0); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
@@ -548,27 +574,2 @@ wasm.__wbindgen_add_to_stack_pointer(16); | ||
/** | ||
* Compresses a `WitnessMap` into the binary format outputted by Nargo. | ||
* | ||
* @param {Uint8Array} compressed_witness - A witness map. | ||
* @returns {WitnessMap} A compressed witness map | ||
*/ | ||
export function compressWitness(witness_map) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.compressWitness(retptr, addHeapObject(witness_map)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
if (r3) { | ||
throw takeObject(r2); | ||
} | ||
var v1 = getArrayU8FromWasm0(r0, r1).slice(); | ||
wasm.__wbindgen_free(r0, r1 * 1); | ||
return v1; | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
} | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
@@ -590,3 +591,3 @@ * @returns {BuildInfo} - Information on how the installed package was built. | ||
function __wbg_adapter_159(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__hc5e8ba855f687f9d(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h79f8a29187e94f15(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
} | ||
@@ -680,2 +681,10 @@ | ||
}; | ||
imports.wbg.__wbindgen_error_new = function(arg0, arg1) { | ||
const ret = new Error(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_object_clone_ref = function(arg0) { | ||
const ret = getObject(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_wasmblackboxfunctionsolver_new = function(arg0) { | ||
@@ -685,4 +694,9 @@ const ret = WasmBlackBoxFunctionSolver.__wrap(arg0); | ||
}; | ||
imports.wbg.__wbindgen_is_array = function(arg0) { | ||
const ret = Array.isArray(getObject(arg0)); | ||
imports.wbg.__wbindgen_cb_drop = function(arg0) { | ||
const obj = takeObject(arg0).original; | ||
if (obj.cnt-- == 1) { | ||
obj.a = 0; | ||
return true; | ||
} | ||
const ret = false; | ||
return ret; | ||
@@ -694,11 +708,3 @@ }; | ||
}; | ||
imports.wbg.__wbg_constructor_8444207292d12e94 = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_is_string = function(arg0) { | ||
const ret = typeof(getObject(arg0)) === 'string'; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_new_12499e712355d566 = function() { | ||
imports.wbg.__wbg_new_ab82e8584bdd2143 = function() { | ||
const ret = new Map(); | ||
@@ -719,2 +725,6 @@ return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_constructor_d9cb984c4e2c6bcd = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_number_get = function(arg0, arg1) { | ||
@@ -726,21 +736,12 @@ const obj = getObject(arg1); | ||
}; | ||
imports.wbg.__wbindgen_error_new = function(arg0, arg1) { | ||
const ret = new Error(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
imports.wbg.__wbindgen_is_undefined = function(arg0) { | ||
const ret = getObject(arg0) === undefined; | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_object_clone_ref = function(arg0) { | ||
const ret = getObject(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_cb_drop = function(arg0) { | ||
const obj = takeObject(arg0).original; | ||
if (obj.cnt-- == 1) { | ||
obj.a = 0; | ||
return true; | ||
} | ||
const ret = false; | ||
imports.wbg.__wbindgen_is_string = function(arg0) { | ||
const ret = typeof(getObject(arg0)) === 'string'; | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_is_undefined = function(arg0) { | ||
const ret = getObject(arg0) === undefined; | ||
imports.wbg.__wbindgen_is_array = function(arg0) { | ||
const ret = Array.isArray(getObject(arg0)); | ||
return ret; | ||
@@ -770,10 +771,2 @@ }; | ||
}; | ||
imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) { | ||
const ret = arg0; | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_bigint_from_u128 = function(arg0, arg1) { | ||
const ret = BigInt.asUintN(64, arg0) << BigInt(64) | BigInt.asUintN(64, arg1); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_ge = function(arg0, arg1) { | ||
@@ -799,3 +792,20 @@ const ret = getObject(arg0) >= getObject(arg1); | ||
}; | ||
imports.wbg.__wbg_instanceof_Global_1c3b64df1a5c886c = function(arg0) { | ||
imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) { | ||
const ret = arg0; | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_bigint_from_u128 = function(arg0, arg1) { | ||
const ret = BigInt.asUintN(64, arg0) << BigInt(64) | BigInt.asUintN(64, arg1); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_is_object = function(arg0) { | ||
const val = getObject(arg0); | ||
const ret = typeof(val) === 'object' && val !== null; | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_is_function = function(arg0) { | ||
const ret = typeof(getObject(arg0)) === 'function'; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_instanceof_Global_f4b019d2b45e18ab = function(arg0) { | ||
let result; | ||
@@ -810,11 +820,2 @@ try { | ||
}; | ||
imports.wbg.__wbindgen_is_function = function(arg0) { | ||
const ret = typeof(getObject(arg0)) === 'function'; | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_is_object = function(arg0) { | ||
const val = getObject(arg0); | ||
const ret = typeof(val) === 'object' && val !== null; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_crypto_c48a774b022d20ac = function(arg0) { | ||
@@ -1091,2 +1092,6 @@ const ret = getObject(arg0).crypto; | ||
}; | ||
imports.wbg.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) { | ||
const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
imports.wbg.__wbg_compile_eefe73dfb19bff3d = function(arg0) { | ||
@@ -1148,6 +1153,2 @@ const ret = WebAssembly.compile(getObject(arg0)); | ||
}, arguments) }; | ||
imports.wbg.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) { | ||
const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) { | ||
@@ -1177,4 +1178,4 @@ const v = getObject(arg1); | ||
}; | ||
imports.wbg.__wbindgen_closure_wrapper1433 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 501, __wbg_adapter_52); | ||
imports.wbg.__wbindgen_closure_wrapper1388 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 484, __wbg_adapter_52); | ||
return addHeapObject(ret); | ||
@@ -1181,0 +1182,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6638239