@noir-lang/acvm_js
Advanced tools
Comparing version 0.52.0 to 0.53.0-13856a1.nightly
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function executeCircuit(a: number, b: number, c: number, d: number): number; | ||
export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number; | ||
export function executeProgram(a: number, b: number, c: number, d: number): number; | ||
export function buildInfo(): number; | ||
export function initLogLevel(a: number, b: number, c: number): void; | ||
export function getReturnWitness(a: number, b: number, c: number, d: number): void; | ||
@@ -17,2 +14,3 @@ export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void; | ||
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number; | ||
export function buildInfo(): number; | ||
export function compressWitness(a: number, b: number): void; | ||
@@ -22,3 +20,5 @@ export function decompressWitness(a: number, b: number, c: number): void; | ||
export function decompressWitnessStack(a: number, b: number, c: number): void; | ||
export function initLogLevel(a: number, b: number, c: number): void; | ||
export function executeCircuit(a: number, b: number, c: number, d: number): number; | ||
export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number; | ||
export function executeProgram(a: number, b: number, c: number, d: number): number; | ||
export function __wbindgen_malloc(a: number): number; | ||
@@ -25,0 +25,0 @@ export function __wbindgen_realloc(a: number, b: number, c: number): number; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* Sets the package's logging level. | ||
* | ||
* @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 {LogLevel} level - The maximum level of logging to be emitted. | ||
*/ | ||
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>; | ||
export function initLogLevel(filter: string): void; | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* This method also extracts the public return values from the solved witness into its own return 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 {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit. | ||
*/ | ||
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>; | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {Uint8Array} program - A serialized representation of an ACIR program | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program. | ||
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs. | ||
*/ | ||
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>; | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
* @returns {BuildInfo} - Information on how the installed package was built. | ||
*/ | ||
export function buildInfo(): BuildInfo; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values. | ||
@@ -115,2 +88,7 @@ * | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
* @returns {BuildInfo} - Information on how the installed package was built. | ||
*/ | ||
export function buildInfo(): BuildInfo; | ||
/** | ||
* Compresses a `WitnessMap` into the binary format outputted by Nargo. | ||
@@ -145,36 +123,30 @@ * | ||
/** | ||
* Sets the package's logging level. | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {LogLevel} level - The maximum level of logging to be emitted. | ||
* @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 initLogLevel(filter: string): void; | ||
export type ForeignCallInput = string[] | ||
export type ForeignCallOutput = string | string[] | ||
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>; | ||
/** | ||
* A callback which performs an foreign call and returns the response. | ||
* @callback ForeignCallHandler | ||
* @param {string} name - The identifier for the type of foreign call being performed. | ||
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call. | ||
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call. | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* This method also extracts the public return values from the solved witness into its own return 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 {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit. | ||
*/ | ||
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>; | ||
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>; | ||
/** | ||
* @typedef {Object} BuildInfo - Information about how the installed package was built | ||
* @property {string} gitHash - The hash of the git commit from which the package was built. | ||
* @property {string} version - The version of the package at the built git commit. | ||
* @property {boolean} dirty - Whether the package contained uncommitted changes when built. | ||
*/ | ||
export type BuildInfo = { | ||
gitHash: string; | ||
version: string; | ||
dirty: string; | ||
} | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {Uint8Array} program - A serialized representation of an ACIR program | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program. | ||
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs. | ||
*/ | ||
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>; | ||
export type RawAssertionPayload = { | ||
@@ -202,2 +174,30 @@ selector: string; | ||
/** | ||
* @typedef {Object} BuildInfo - Information about how the installed package was built | ||
* @property {string} gitHash - The hash of the git commit from which the package was built. | ||
* @property {string} version - The version of the package at the built git commit. | ||
* @property {boolean} dirty - Whether the package contained uncommitted changes when built. | ||
*/ | ||
export type BuildInfo = { | ||
gitHash: string; | ||
version: string; | ||
dirty: string; | ||
} | ||
export type ForeignCallInput = string[] | ||
export type ForeignCallOutput = string | string[] | ||
/** | ||
* A callback which performs an foreign call and returns the response. | ||
* @callback ForeignCallHandler | ||
* @param {string} name - The identifier for the type of foreign call being performed. | ||
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call. | ||
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call. | ||
*/ | ||
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>; | ||
// Map from witness index to hex string value of witness. | ||
@@ -204,0 +204,0 @@ export type WitnessMap = Map<number, string>; |
@@ -26,24 +26,2 @@ let imports = {}; | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
let cachedFloat64Memory0 = null; | ||
function getFloat64Memory0() { | ||
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { | ||
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); | ||
} | ||
return cachedFloat64Memory0; | ||
} | ||
let cachedInt32Memory0 = null; | ||
function getInt32Memory0() { | ||
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
} | ||
return cachedInt32Memory0; | ||
} | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
@@ -76,2 +54,24 @@ | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
let cachedFloat64Memory0 = null; | ||
function getFloat64Memory0() { | ||
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { | ||
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); | ||
} | ||
return cachedFloat64Memory0; | ||
} | ||
let cachedInt32Memory0 = null; | ||
function getInt32Memory0() { | ||
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
} | ||
return cachedInt32Memory0; | ||
} | ||
let WASM_VECTOR_LEN = 0; | ||
@@ -225,2 +225,23 @@ | ||
/** | ||
* Sets the package's logging level. | ||
* | ||
* @param {LogLevel} level - The maximum level of logging to be emitted. | ||
*/ | ||
module.exports.initLogLevel = function(filter) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.initLogLevel(retptr, ptr0, len0); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
if (r1) { | ||
throw takeObject(r0); | ||
} | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
}; | ||
function passArray8ToWasm0(arg, malloc) { | ||
@@ -233,57 +254,2 @@ const ptr = malloc(arg.length * 1) >>> 0; | ||
/** | ||
* 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(program, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuit(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. | ||
* This method also extracts the public return values from the solved witness into its own return 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 {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit. | ||
*/ | ||
module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuitWithReturnWitness(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} program - A serialized representation of an ACIR program | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program. | ||
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs. | ||
*/ | ||
module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeProgram(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler)); | ||
return takeObject(ret); | ||
}; | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
* @returns {BuildInfo} - Information on how the installed package was built. | ||
*/ | ||
module.exports.buildInfo = function() { | ||
const ret = wasm.buildInfo(); | ||
return takeObject(ret); | ||
}; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values. | ||
@@ -506,2 +472,11 @@ * | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
* @returns {BuildInfo} - Information on how the installed package was built. | ||
*/ | ||
module.exports.buildInfo = function() { | ||
const ret = wasm.buildInfo(); | ||
return takeObject(ret); | ||
}; | ||
/** | ||
* Compresses a `WitnessMap` into the binary format outputted by Nargo. | ||
@@ -606,22 +581,47 @@ * | ||
/** | ||
* Sets the package's logging level. | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {LogLevel} level - The maximum level of logging to be emitted. | ||
* @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.initLogLevel = function(filter) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.initLogLevel(retptr, ptr0, len0); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
if (r1) { | ||
throw takeObject(r0); | ||
} | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuit(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. | ||
* This method also extracts the public return values from the solved witness into its own return 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 {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit. | ||
*/ | ||
module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuitWithReturnWitness(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} program - A serialized representation of an ACIR program | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program. | ||
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs. | ||
*/ | ||
module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeProgram(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler)); | ||
return takeObject(ret); | ||
}; | ||
function __wbg_adapter_75(arg0, arg1, arg2, arg3, arg4) { | ||
@@ -646,19 +646,2 @@ wasm.wasm_bindgen__convert__closures__invoke3_mut__h17fc532521b46256(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4)); | ||
module.exports.__wbindgen_is_array = function(arg0) { | ||
const ret = Array.isArray(getObject(arg0)); | ||
return ret; | ||
}; | ||
module.exports.__wbindgen_is_string = function(arg0) { | ||
const ret = typeof(getObject(arg0)) === 'string'; | ||
return ret; | ||
}; | ||
module.exports.__wbindgen_number_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'number' ? obj : undefined; | ||
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; | ||
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); | ||
}; | ||
module.exports.__wbindgen_cb_drop = function(arg0) { | ||
@@ -674,3 +657,3 @@ const obj = takeObject(arg0).original; | ||
module.exports.__wbg_constructor_720343c738f4344c = function(arg0) { | ||
module.exports.__wbg_constructor_01cf62506201187d = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
@@ -685,3 +668,3 @@ return addHeapObject(ret); | ||
module.exports.__wbg_new_55c288bb849e1b31 = function() { | ||
module.exports.__wbg_new_0d58cd3f85c51a07 = function() { | ||
const ret = new Array(); | ||
@@ -696,3 +679,20 @@ return addHeapObject(ret); | ||
module.exports.__wbg_new_7379c57bfbea14d0 = function() { | ||
module.exports.__wbindgen_number_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'number' ? obj : undefined; | ||
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; | ||
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); | ||
}; | ||
module.exports.__wbindgen_is_string = function(arg0) { | ||
const ret = typeof(getObject(arg0)) === 'string'; | ||
return ret; | ||
}; | ||
module.exports.__wbindgen_is_array = function(arg0) { | ||
const ret = Array.isArray(getObject(arg0)); | ||
return ret; | ||
}; | ||
module.exports.__wbg_new_ced18ca7e58573af = function() { | ||
const ret = new Map(); | ||
@@ -929,4 +929,4 @@ return addHeapObject(ret); | ||
module.exports.__wbindgen_closure_wrapper727 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 267, __wbg_adapter_22); | ||
module.exports.__wbindgen_closure_wrapper736 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 269, __wbg_adapter_22); | ||
return addHeapObject(ret); | ||
@@ -933,0 +933,0 @@ }; |
{ | ||
"name": "@noir-lang/acvm_js", | ||
"version": "0.52.0", | ||
"version": "0.53.0-13856a1.nightly", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function executeCircuit(a: number, b: number, c: number, d: number): number; | ||
export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number; | ||
export function executeProgram(a: number, b: number, c: number, d: number): number; | ||
export function buildInfo(): number; | ||
export function initLogLevel(a: number, b: number, c: number): void; | ||
export function getReturnWitness(a: number, b: number, c: number, d: number): void; | ||
@@ -17,2 +14,3 @@ export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void; | ||
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number; | ||
export function buildInfo(): number; | ||
export function compressWitness(a: number, b: number): void; | ||
@@ -22,3 +20,5 @@ export function decompressWitness(a: number, b: number, c: number): void; | ||
export function decompressWitnessStack(a: number, b: number, c: number): void; | ||
export function initLogLevel(a: number, b: number, c: number): void; | ||
export function executeCircuit(a: number, b: number, c: number, d: number): number; | ||
export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number; | ||
export function executeProgram(a: number, b: number, c: number, d: number): number; | ||
export function __wbindgen_malloc(a: number): number; | ||
@@ -25,0 +25,0 @@ export function __wbindgen_realloc(a: number, b: number, c: number): number; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* Sets the package's logging level. | ||
* | ||
* @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 {LogLevel} level - The maximum level of logging to be emitted. | ||
*/ | ||
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>; | ||
export function initLogLevel(filter: string): void; | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* This method also extracts the public return values from the solved witness into its own return 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 {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit. | ||
*/ | ||
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>; | ||
/** | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {Uint8Array} program - A serialized representation of an ACIR program | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program. | ||
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs. | ||
*/ | ||
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>; | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
* @returns {BuildInfo} - Information on how the installed package was built. | ||
*/ | ||
export function buildInfo(): BuildInfo; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values. | ||
@@ -115,2 +88,7 @@ * | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
* @returns {BuildInfo} - Information on how the installed package was built. | ||
*/ | ||
export function buildInfo(): BuildInfo; | ||
/** | ||
* Compresses a `WitnessMap` into the binary format outputted by Nargo. | ||
@@ -145,36 +123,30 @@ * | ||
/** | ||
* Sets the package's logging level. | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {LogLevel} level - The maximum level of logging to be emitted. | ||
* @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 initLogLevel(filter: string): void; | ||
export type ForeignCallInput = string[] | ||
export type ForeignCallOutput = string | string[] | ||
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>; | ||
/** | ||
* A callback which performs an foreign call and returns the response. | ||
* @callback ForeignCallHandler | ||
* @param {string} name - The identifier for the type of foreign call being performed. | ||
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call. | ||
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call. | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* This method also extracts the public return values from the solved witness into its own return 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 {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit. | ||
*/ | ||
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>; | ||
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>; | ||
/** | ||
* @typedef {Object} BuildInfo - Information about how the installed package was built | ||
* @property {string} gitHash - The hash of the git commit from which the package was built. | ||
* @property {string} version - The version of the package at the built git commit. | ||
* @property {boolean} dirty - Whether the package contained uncommitted changes when built. | ||
*/ | ||
export type BuildInfo = { | ||
gitHash: string; | ||
version: string; | ||
dirty: string; | ||
} | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {Uint8Array} program - A serialized representation of an ACIR program | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program. | ||
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs. | ||
*/ | ||
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>; | ||
export type RawAssertionPayload = { | ||
@@ -202,2 +174,30 @@ selector: string; | ||
/** | ||
* @typedef {Object} BuildInfo - Information about how the installed package was built | ||
* @property {string} gitHash - The hash of the git commit from which the package was built. | ||
* @property {string} version - The version of the package at the built git commit. | ||
* @property {boolean} dirty - Whether the package contained uncommitted changes when built. | ||
*/ | ||
export type BuildInfo = { | ||
gitHash: string; | ||
version: string; | ||
dirty: string; | ||
} | ||
export type ForeignCallInput = string[] | ||
export type ForeignCallOutput = string | string[] | ||
/** | ||
* A callback which performs an foreign call and returns the response. | ||
* @callback ForeignCallHandler | ||
* @param {string} name - The identifier for the type of foreign call being performed. | ||
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call. | ||
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call. | ||
*/ | ||
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>; | ||
// Map from witness index to hex string value of witness. | ||
@@ -222,6 +222,3 @@ export type WitnessMap = Map<number, string>; | ||
readonly memory: WebAssembly.Memory; | ||
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number; | ||
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: number, d: number) => number; | ||
readonly executeProgram: (a: number, b: number, c: number, d: number) => number; | ||
readonly buildInfo: () => number; | ||
readonly initLogLevel: (a: number, b: number, c: number) => void; | ||
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void; | ||
@@ -236,2 +233,3 @@ readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void; | ||
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number; | ||
readonly buildInfo: () => number; | ||
readonly compressWitness: (a: number, b: number) => void; | ||
@@ -241,3 +239,5 @@ readonly decompressWitness: (a: number, b: number, c: number) => void; | ||
readonly decompressWitnessStack: (a: number, b: number, c: number) => void; | ||
readonly initLogLevel: (a: number, b: number, c: number) => void; | ||
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number; | ||
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: number, d: number) => number; | ||
readonly executeProgram: (a: number, b: number, c: number, d: number) => number; | ||
readonly __wbindgen_malloc: (a: number) => number; | ||
@@ -244,0 +244,0 @@ readonly __wbindgen_realloc: (a: number, b: number, c: number) => number; |
@@ -23,24 +23,2 @@ let wasm; | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
let cachedFloat64Memory0 = null; | ||
function getFloat64Memory0() { | ||
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { | ||
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); | ||
} | ||
return cachedFloat64Memory0; | ||
} | ||
let cachedInt32Memory0 = null; | ||
function getInt32Memory0() { | ||
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
} | ||
return cachedInt32Memory0; | ||
} | ||
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); | ||
@@ -73,2 +51,24 @@ | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
let cachedFloat64Memory0 = null; | ||
function getFloat64Memory0() { | ||
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { | ||
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); | ||
} | ||
return cachedFloat64Memory0; | ||
} | ||
let cachedInt32Memory0 = null; | ||
function getInt32Memory0() { | ||
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
} | ||
return cachedInt32Memory0; | ||
} | ||
let WASM_VECTOR_LEN = 0; | ||
@@ -222,2 +222,23 @@ | ||
/** | ||
* Sets the package's logging level. | ||
* | ||
* @param {LogLevel} level - The maximum level of logging to be emitted. | ||
*/ | ||
export function initLogLevel(filter) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.initLogLevel(retptr, ptr0, len0); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
if (r1) { | ||
throw takeObject(r0); | ||
} | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
} | ||
function passArray8ToWasm0(arg, malloc) { | ||
@@ -230,57 +251,2 @@ const ptr = malloc(arg.length * 1) >>> 0; | ||
/** | ||
* 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(program, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuit(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. | ||
* This method also extracts the public return values from the solved witness into its own return 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 {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit. | ||
*/ | ||
export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuitWithReturnWitness(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} program - A serialized representation of an ACIR program | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program. | ||
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs. | ||
*/ | ||
export function executeProgram(program, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeProgram(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler)); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
* @returns {BuildInfo} - Information on how the installed package was built. | ||
*/ | ||
export function buildInfo() { | ||
const ret = wasm.buildInfo(); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values. | ||
@@ -503,2 +469,11 @@ * | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
* @returns {BuildInfo} - Information on how the installed package was built. | ||
*/ | ||
export function buildInfo() { | ||
const ret = wasm.buildInfo(); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* Compresses a `WitnessMap` into the binary format outputted by Nargo. | ||
@@ -603,22 +578,47 @@ * | ||
/** | ||
* Sets the package's logging level. | ||
* Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
* | ||
* @param {LogLevel} level - The maximum level of logging to be emitted. | ||
* @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 initLogLevel(filter) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.initLogLevel(retptr, ptr0, len0); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
if (r1) { | ||
throw takeObject(r0); | ||
} | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
export function executeCircuit(program, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuit(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. | ||
* This method also extracts the public return values from the solved witness into its own return 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 {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit. | ||
*/ | ||
export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeCircuitWithReturnWitness(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} program - A serialized representation of an ACIR program | ||
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`. | ||
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program. | ||
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs. | ||
*/ | ||
export function executeProgram(program, initial_witness, foreign_call_handler) { | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.executeProgram(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler)); | ||
return takeObject(ret); | ||
} | ||
function __wbg_adapter_75(arg0, arg1, arg2, arg3, arg4) { | ||
@@ -676,16 +676,2 @@ wasm.wasm_bindgen__convert__closures__invoke3_mut__h17fc532521b46256(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4)); | ||
}; | ||
imports.wbg.__wbindgen_is_array = function(arg0) { | ||
const ret = Array.isArray(getObject(arg0)); | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_is_string = function(arg0) { | ||
const ret = typeof(getObject(arg0)) === 'string'; | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_number_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'number' ? obj : undefined; | ||
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; | ||
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); | ||
}; | ||
imports.wbg.__wbindgen_cb_drop = function(arg0) { | ||
@@ -700,3 +686,3 @@ const obj = takeObject(arg0).original; | ||
}; | ||
imports.wbg.__wbg_constructor_720343c738f4344c = function(arg0) { | ||
imports.wbg.__wbg_constructor_01cf62506201187d = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
@@ -709,3 +695,3 @@ return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_new_55c288bb849e1b31 = function() { | ||
imports.wbg.__wbg_new_0d58cd3f85c51a07 = function() { | ||
const ret = new Array(); | ||
@@ -718,3 +704,17 @@ return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_new_7379c57bfbea14d0 = function() { | ||
imports.wbg.__wbindgen_number_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'number' ? obj : undefined; | ||
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; | ||
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); | ||
}; | ||
imports.wbg.__wbindgen_is_string = function(arg0) { | ||
const ret = typeof(getObject(arg0)) === 'string'; | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_is_array = function(arg0) { | ||
const ret = Array.isArray(getObject(arg0)); | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_new_ced18ca7e58573af = function() { | ||
const ret = new Map(); | ||
@@ -914,4 +914,4 @@ return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_closure_wrapper727 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 267, __wbg_adapter_22); | ||
imports.wbg.__wbindgen_closure_wrapper736 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 269, __wbg_adapter_22); | ||
return addHeapObject(ret); | ||
@@ -918,0 +918,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
4102721