New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@noir-lang/acvm_js

Package Overview
Dependencies
Maintainers
0
Versions
354
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@noir-lang/acvm_js - npm Package Compare versions

Comparing version 1.0.0-beta.1-f2a6d10.nightly to 1.0.0-beta.2-582f56e.nightly

22

nodejs/acvm_js_bg.wasm.d.ts
/* tslint:disable */
/* eslint-disable */
export const memory: WebAssembly.Memory;
export function buildInfo(): number;
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
export function getPublicWitness(a: number, b: number, c: number, d: 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 compressWitness(a: number, b: number): void;

@@ -18,14 +18,14 @@ export function decompressWitness(a: number, b: number, c: 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 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 initLogLevel(a: number, b: number, c: number): void;
export function buildInfo(): number;
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
export function __wbindgen_malloc(a: number): number;
export function __wbindgen_realloc(a: number, b: number, c: number): number;
export const __wbindgen_export_2: WebAssembly.Table;
export function wasm_bindgen__convert__closures__invoke1_mut__h7f1511a2915e72e7(a: number, b: number, c: number): void;
export function wasm_bindgen__convert__closures__invoke1_mut__hec5660d9489c77a2(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 wasm_bindgen__convert__closures__invoke3_mut__h0ccbefcb4d729e69(a: number, b: number, c: number, d: number, e: number): void;
export function wasm_bindgen__convert__closures__invoke3_mut__h083a66e5b0ae3ce9(a: number, b: number, c: number, d: number, e: number): void;
export function __wbindgen_exn_store(a: number): void;
export function wasm_bindgen__convert__closures__invoke2_mut__h2ed79be2e23ac22f(a: number, b: number, c: number, d: number): void;
export function wasm_bindgen__convert__closures__invoke2_mut__h7636f3796134b93b(a: number, b: number, c: number, d: number): void;
/* tslint:disable */
/* eslint-disable */
/**
* Returns the `BuildInfo` object containing information about how the installed package was built.
* @returns {BuildInfo} - Information on how the installed package was built.
* Sets the package's logging level.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
*/
export function buildInfo(): BuildInfo;
export function initLogLevel(filter: string): void;
/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
* 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} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's return values.
* @param {Uint8Array} program
* @param {WitnessMap} witness_map
* @returns {WitnessMap}
* @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 getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
* 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} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
* @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 getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
* 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} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
* @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 getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
/**

@@ -116,36 +112,54 @@ * Compresses a `WitnessMap` into the binary format outputted by Nargo.

/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
* 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.
*
* @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 {WitnessMap} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's return values.
* @param {Uint8Array} program
* @param {WitnessMap} witness_map
* @returns {WitnessMap}
*/
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
/**
* 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.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
*
* @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.
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
*/
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
*
* @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.
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
*/
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
export type ForeignCallInput = string[]
export type ForeignCallOutput = string | string[]
/**
* Sets the package's logging level.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
* 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 function initLogLevel(filter: string): void;
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
// Map from witness index to hex string value of witness.

@@ -201,15 +215,1 @@ export type WitnessMap = Map<number, 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[]>;

@@ -220,12 +220,24 @@ let imports = {};

function __wbg_adapter_22(arg0, arg1, arg2) {
wasm.wasm_bindgen__convert__closures__invoke1_mut__h7f1511a2915e72e7(arg0, arg1, addHeapObject(arg2));
wasm.wasm_bindgen__convert__closures__invoke1_mut__hec5660d9489c77a2(arg0, arg1, addHeapObject(arg2));
}
/**
* Returns the `BuildInfo` object containing information about how the installed package was built.
* @returns {BuildInfo} - Information on how the installed package was built.
* Sets the package's logging level.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
*/
module.exports.buildInfo = function() {
const ret = wasm.buildInfo();
return takeObject(ret);
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);
}
};

@@ -240,83 +252,45 @@

/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
* 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} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's return values.
* @param {Uint8Array} program
* @param {WitnessMap} witness_map
* @returns {WitnessMap}
* @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.getReturnWitness = function(program, witness_map) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
if (r2) {
throw takeObject(r1);
}
return 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);
};
/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
* 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} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
* @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.getPublicParametersWitness = function(program, solved_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
if (r2) {
throw takeObject(r1);
}
return takeObject(r0);
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
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);
};
/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
* 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} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
* @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.getPublicWitness = function(program, solved_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
if (r2) {
throw takeObject(r1);
}
return takeObject(r0);
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
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);
};

@@ -557,13 +531,7 @@

/**
* 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.
* 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.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));
module.exports.buildInfo = function() {
const ret = wasm.buildInfo();
return takeObject(ret);

@@ -573,48 +541,80 @@ };

/**
* 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.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
*
* @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.
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's return values.
* @param {Uint8Array} program
* @param {WitnessMap} witness_map
* @returns {WitnessMap}
*/
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);
module.exports.getReturnWitness = function(program, witness_map) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
if (r2) {
throw takeObject(r1);
}
return takeObject(r0);
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
};
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
*
* @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.
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
*/
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);
module.exports.getPublicParametersWitness = function(program, solved_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
if (r2) {
throw takeObject(r1);
}
return takeObject(r0);
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
};
/**
* Sets the package's logging level.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
*/
module.exports.initLogLevel = function(filter) {
module.exports.getPublicWitness = function(program, solved_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.initLogLevel(retptr, ptr0, len0);
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
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 {

@@ -626,3 +626,3 @@ wasm.__wbindgen_add_to_stack_pointer(16);

function __wbg_adapter_75(arg0, arg1, arg2, arg3, arg4) {
wasm.wasm_bindgen__convert__closures__invoke3_mut__h0ccbefcb4d729e69(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
wasm.wasm_bindgen__convert__closures__invoke3_mut__h083a66e5b0ae3ce9(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
}

@@ -638,15 +638,5 @@

function __wbg_adapter_92(arg0, arg1, arg2, arg3) {
wasm.wasm_bindgen__convert__closures__invoke2_mut__h2ed79be2e23ac22f(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
wasm.wasm_bindgen__convert__closures__invoke2_mut__h7636f3796134b93b(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
}
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;
};
module.exports.__wbindgen_object_drop_ref = function(arg0) {

@@ -666,3 +656,8 @@ takeObject(arg0);

module.exports.__wbg_new_d86d15722f6b14a4 = function() {
module.exports.__wbg_constructor_7d42f5e2b3ae2f5e = function(arg0) {
const ret = new Error(takeObject(arg0));
return addHeapObject(ret);
};
module.exports.__wbg_new_35cd49f1520efef9 = function() {
const ret = new Map();

@@ -691,12 +686,12 @@ return addHeapObject(ret);

module.exports.__wbg_constructor_a10f2b77c63b8d5e = function(arg0) {
const ret = new Error(takeObject(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;
return ret;
};
module.exports.__wbg_new_a16954212d33afab = function() {
const ret = new Array();
return addHeapObject(ret);
};
module.exports.__wbindgen_number_get = function(arg0, arg1) {

@@ -709,2 +704,7 @@ const obj = getObject(arg1);

module.exports.__wbg_new_3904a031fd091cf2 = function() {
const ret = new Array();
return addHeapObject(ret);
};
module.exports.__wbg_new_abda76e883ba8a5f = function() {

@@ -928,4 +928,4 @@ const ret = new Error();

module.exports.__wbindgen_closure_wrapper763 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 297, __wbg_adapter_22);
module.exports.__wbindgen_closure_wrapper782 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 300, __wbg_adapter_22);
return addHeapObject(ret);

@@ -932,0 +932,0 @@ };

{
"name": "@noir-lang/acvm_js",
"version": "1.0.0-beta.1-f2a6d10.nightly",
"version": "1.0.0-beta.2-582f56e.nightly",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public"

/* tslint:disable */
/* eslint-disable */
export const memory: WebAssembly.Memory;
export function buildInfo(): number;
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
export function getPublicWitness(a: number, b: number, c: number, d: 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 compressWitness(a: number, b: number): void;

@@ -18,14 +18,14 @@ export function decompressWitness(a: number, b: number, c: 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 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 initLogLevel(a: number, b: number, c: number): void;
export function buildInfo(): number;
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
export function __wbindgen_malloc(a: number): number;
export function __wbindgen_realloc(a: number, b: number, c: number): number;
export const __wbindgen_export_2: WebAssembly.Table;
export function wasm_bindgen__convert__closures__invoke1_mut__h7f1511a2915e72e7(a: number, b: number, c: number): void;
export function wasm_bindgen__convert__closures__invoke1_mut__hec5660d9489c77a2(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 wasm_bindgen__convert__closures__invoke3_mut__h0ccbefcb4d729e69(a: number, b: number, c: number, d: number, e: number): void;
export function wasm_bindgen__convert__closures__invoke3_mut__h083a66e5b0ae3ce9(a: number, b: number, c: number, d: number, e: number): void;
export function __wbindgen_exn_store(a: number): void;
export function wasm_bindgen__convert__closures__invoke2_mut__h2ed79be2e23ac22f(a: number, b: number, c: number, d: number): void;
export function wasm_bindgen__convert__closures__invoke2_mut__h7636f3796134b93b(a: number, b: number, c: number, d: number): void;
/* tslint:disable */
/* eslint-disable */
/**
* Returns the `BuildInfo` object containing information about how the installed package was built.
* @returns {BuildInfo} - Information on how the installed package was built.
* Sets the package's logging level.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
*/
export function buildInfo(): BuildInfo;
export function initLogLevel(filter: string): void;
/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
* 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} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's return values.
* @param {Uint8Array} program
* @param {WitnessMap} witness_map
* @returns {WitnessMap}
* @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 getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
* 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} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
* @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 getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
* 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} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
* @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 getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
/**

@@ -116,36 +112,54 @@ * Compresses a `WitnessMap` into the binary format outputted by Nargo.

/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
* 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.
*
* @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 {WitnessMap} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's return values.
* @param {Uint8Array} program
* @param {WitnessMap} witness_map
* @returns {WitnessMap}
*/
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
/**
* 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.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
*
* @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.
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
*/
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
*
* @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.
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
*/
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
export type ForeignCallInput = string[]
export type ForeignCallOutput = string | string[]
/**
* Sets the package's logging level.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
* 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 function initLogLevel(filter: string): void;
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
// Map from witness index to hex string value of witness.

@@ -202,16 +216,2 @@ export type WitnessMap = Map<number, 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[]>;
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;

@@ -221,6 +221,6 @@

readonly memory: WebAssembly.Memory;
readonly buildInfo: () => number;
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
readonly getPublicWitness: (a: number, b: number, c: number, d: 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 compressWitness: (a: number, b: number) => void;

@@ -236,15 +236,15 @@ readonly decompressWitness: (a: number, b: number, c: number) => void;

readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
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 initLogLevel: (a: number, b: number, c: number) => void;
readonly buildInfo: () => number;
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
readonly __wbindgen_malloc: (a: number) => number;
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
readonly __wbindgen_export_2: WebAssembly.Table;
readonly wasm_bindgen__convert__closures__invoke1_mut__h7f1511a2915e72e7: (a: number, b: number, c: number) => void;
readonly wasm_bindgen__convert__closures__invoke1_mut__hec5660d9489c77a2: (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 wasm_bindgen__convert__closures__invoke3_mut__h0ccbefcb4d729e69: (a: number, b: number, c: number, d: number, e: number) => void;
readonly wasm_bindgen__convert__closures__invoke3_mut__h083a66e5b0ae3ce9: (a: number, b: number, c: number, d: number, e: number) => void;
readonly __wbindgen_exn_store: (a: number) => void;
readonly wasm_bindgen__convert__closures__invoke2_mut__h2ed79be2e23ac22f: (a: number, b: number, c: number, d: number) => void;
readonly wasm_bindgen__convert__closures__invoke2_mut__h7636f3796134b93b: (a: number, b: number, c: number, d: number) => void;
}

@@ -251,0 +251,0 @@

@@ -217,12 +217,24 @@ let wasm;

function __wbg_adapter_22(arg0, arg1, arg2) {
wasm.wasm_bindgen__convert__closures__invoke1_mut__h7f1511a2915e72e7(arg0, arg1, addHeapObject(arg2));
wasm.wasm_bindgen__convert__closures__invoke1_mut__hec5660d9489c77a2(arg0, arg1, addHeapObject(arg2));
}
/**
* Returns the `BuildInfo` object containing information about how the installed package was built.
* @returns {BuildInfo} - Information on how the installed package was built.
* Sets the package's logging level.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
*/
export function buildInfo() {
const ret = wasm.buildInfo();
return takeObject(ret);
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);
}
}

@@ -237,83 +249,45 @@

/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
* 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} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's return values.
* @param {Uint8Array} program
* @param {WitnessMap} witness_map
* @returns {WitnessMap}
* @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 getReturnWitness(program, witness_map) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
if (r2) {
throw takeObject(r1);
}
return 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);
}
/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
* 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} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
* @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 getPublicParametersWitness(program, solved_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
if (r2) {
throw takeObject(r1);
}
return takeObject(r0);
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
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);
}
/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
* 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} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
* @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 getPublicWitness(program, solved_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
if (r2) {
throw takeObject(r1);
}
return takeObject(r0);
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
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);
}

@@ -554,13 +528,7 @@

/**
* 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.
* 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 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));
export function buildInfo() {
const ret = wasm.buildInfo();
return takeObject(ret);

@@ -570,48 +538,80 @@ }

/**
* 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.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
*
* @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.
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's return values.
* @param {Uint8Array} program
* @param {WitnessMap} witness_map
* @returns {WitnessMap}
*/
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);
export function getReturnWitness(program, witness_map) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
if (r2) {
throw takeObject(r1);
}
return takeObject(r0);
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
}
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
*
* @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.
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
*/
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);
export function getPublicParametersWitness(program, solved_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
if (r2) {
throw takeObject(r1);
}
return takeObject(r0);
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
}
/**
* Sets the package's logging level.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
* @param {Uint8Array} program
* @param {WitnessMap} solved_witness
* @returns {WitnessMap}
*/
export function initLogLevel(filter) {
export function getPublicWitness(program, solved_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.initLogLevel(retptr, ptr0, len0);
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
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 {

@@ -623,3 +623,3 @@ wasm.__wbindgen_add_to_stack_pointer(16);

function __wbg_adapter_75(arg0, arg1, arg2, arg3, arg4) {
wasm.wasm_bindgen__convert__closures__invoke3_mut__h0ccbefcb4d729e69(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
wasm.wasm_bindgen__convert__closures__invoke3_mut__h083a66e5b0ae3ce9(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
}

@@ -635,3 +635,3 @@

function __wbg_adapter_92(arg0, arg1, arg2, arg3) {
wasm.wasm_bindgen__convert__closures__invoke2_mut__h2ed79be2e23ac22f(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
wasm.wasm_bindgen__convert__closures__invoke2_mut__h7636f3796134b93b(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
}

@@ -673,11 +673,2 @@

imports.wbg = {};
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;
};
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {

@@ -694,3 +685,7 @@ takeObject(arg0);

};
imports.wbg.__wbg_new_d86d15722f6b14a4 = function() {
imports.wbg.__wbg_constructor_7d42f5e2b3ae2f5e = function(arg0) {
const ret = new Error(takeObject(arg0));
return addHeapObject(ret);
};
imports.wbg.__wbg_new_35cd49f1520efef9 = function() {
const ret = new Map();

@@ -715,10 +710,11 @@ return addHeapObject(ret);

};
imports.wbg.__wbg_constructor_a10f2b77c63b8d5e = function(arg0) {
const ret = new Error(takeObject(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;
return ret;
};
imports.wbg.__wbg_new_a16954212d33afab = function() {
const ret = new Array();
return addHeapObject(ret);
};
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {

@@ -730,2 +726,6 @@ const obj = getObject(arg1);

};
imports.wbg.__wbg_new_3904a031fd091cf2 = function() {
const ret = new Array();
return addHeapObject(ret);
};
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {

@@ -914,4 +914,4 @@ const ret = new Error();

};
imports.wbg.__wbindgen_closure_wrapper763 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 297, __wbg_adapter_22);
imports.wbg.__wbindgen_closure_wrapper782 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 300, __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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc