Socket
Socket
Sign inDemoInstall

@noir-lang/acvm_js

Package Overview
Dependencies
Maintainers
1
Versions
255
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 0.46.0-f03f8ae.nightly to 0.46.0-ff7bb72.nightly

8

nodejs/acvm_js_bg.wasm.d.ts

@@ -11,2 +11,6 @@ /* tslint:disable */

export function getPublicWitness(a: number, b: number, c: number, d: 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 initLogLevel(a: number, b: number, c: number): void;
export function and(a: number, b: number): number;

@@ -20,6 +24,2 @@ export function xor(a: number, b: number): number;

export function buildInfo(): 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 __wbindgen_malloc(a: number): number;

@@ -26,0 +26,0 @@ export function __wbindgen_realloc(a: number, b: number, c: number): number;

@@ -66,2 +66,36 @@ /* tslint:disable */

/**
* 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: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<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.
*
* @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>;
/**
* Sets the package's logging level.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
*/
export function initLogLevel(filter: string): void;
/**
* Performs a bitwise AND operation between `lhs` and `rhs`

@@ -121,36 +155,2 @@ * @param {string} lhs

export function buildInfo(): BuildInfo;
/**
* 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: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<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.
*
* @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>;
/**
* Sets the package's logging level.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
*/
export function initLogLevel(filter: string): void;

@@ -168,13 +168,13 @@ export type RawAssertionPayload = {

export type ForeignCallInput = string[]
export type ForeignCallOutput = string | 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;
}
* 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[]>;

@@ -207,14 +207,14 @@

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[]>;
* @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;
}

@@ -53,24 +53,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 WASM_VECTOR_LEN = 0;

@@ -131,2 +109,24 @@

function isLikeNone(x) {
return x === undefined || x === null;
}
let cachedInt32Memory0 = null;
function getInt32Memory0() {
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
}
return cachedInt32Memory0;
}
let cachedFloat64Memory0 = null;
function getFloat64Memory0() {
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
}
return cachedFloat64Memory0;
}
function debugString(val) {

@@ -419,2 +419,69 @@ // primitive types

/**
* 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);
};
/**
* 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);
}
};
/**
* Performs a bitwise AND operation between `lhs` and `rhs`

@@ -555,69 +622,2 @@ * @param {string} lhs

/**
* 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);
};
/**
* 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 __wbg_adapter_76(arg0, arg1, arg2, arg3, arg4) {

@@ -642,12 +642,2 @@ wasm.wasm_bindgen__convert__closures__invoke3_mut__h629417323d5efbaa(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));

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_constructor_81b34c49dcbdd2af = function(arg0) {

@@ -663,7 +653,10 @@ const ret = new Error(takeObject(arg0));

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) {
const obj = takeObject(arg0).original;
if (obj.cnt-- == 1) {
obj.a = 0;
return true;
}
const ret = false;
return ret;
};

@@ -695,2 +688,9 @@

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.__wbg_new_ee5ac63ff3b0fa4d = function() {

@@ -924,4 +924,4 @@ const ret = new Array();

module.exports.__wbindgen_closure_wrapper742 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 239, __wbg_adapter_22);
module.exports.__wbindgen_closure_wrapper739 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 240, __wbg_adapter_22);
return addHeapObject(ret);

@@ -928,0 +928,0 @@ };

{
"name": "@noir-lang/acvm_js",
"version": "0.46.0-f03f8ae.nightly",
"version": "0.46.0-ff7bb72.nightly",
"publishConfig": {

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

@@ -11,2 +11,6 @@ /* tslint:disable */

export function getPublicWitness(a: number, b: number, c: number, d: 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 initLogLevel(a: number, b: number, c: number): void;
export function and(a: number, b: number): number;

@@ -20,6 +24,2 @@ export function xor(a: number, b: number): number;

export function buildInfo(): 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 __wbindgen_malloc(a: number): number;

@@ -26,0 +26,0 @@ export function __wbindgen_realloc(a: number, b: number, c: number): number;

@@ -66,2 +66,36 @@ /* tslint:disable */

/**
* 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: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<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.
*
* @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>;
/**
* Sets the package's logging level.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
*/
export function initLogLevel(filter: string): void;
/**
* Performs a bitwise AND operation between `lhs` and `rhs`

@@ -121,36 +155,2 @@ * @param {string} lhs

export function buildInfo(): BuildInfo;
/**
* 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: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<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.
*
* @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>;
/**
* Sets the package's logging level.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
*/
export function initLogLevel(filter: string): void;

@@ -168,13 +168,13 @@ export type RawAssertionPayload = {

export type ForeignCallInput = string[]
export type ForeignCallOutput = string | 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;
}
* 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[]>;

@@ -207,13 +207,13 @@

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[]>;
* @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;
}

@@ -233,2 +233,6 @@

readonly getPublicWitness: (a: number, b: number, c: number, d: 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 initLogLevel: (a: number, b: number, c: number) => void;
readonly and: (a: number, b: number) => number;

@@ -242,6 +246,2 @@ readonly xor: (a: number, b: number) => number;

readonly buildInfo: () => 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 __wbindgen_malloc: (a: number) => number;

@@ -248,0 +248,0 @@ readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;

@@ -50,24 +50,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;
}
let WASM_VECTOR_LEN = 0;

@@ -128,2 +106,24 @@

function isLikeNone(x) {
return x === undefined || x === null;
}
let cachedInt32Memory0 = null;
function getInt32Memory0() {
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
}
return cachedInt32Memory0;
}
let cachedFloat64Memory0 = null;
function getFloat64Memory0() {
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
}
return cachedFloat64Memory0;
}
function debugString(val) {

@@ -416,2 +416,69 @@ // primitive types

/**
* 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);
}
/**
* 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);
}
}
/**
* Performs a bitwise AND operation between `lhs` and `rhs`

@@ -552,69 +619,2 @@ * @param {string} lhs

/**
* 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);
}
/**
* 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 __wbg_adapter_76(arg0, arg1, arg2, arg3, arg4) {

@@ -672,2 +672,10 @@ wasm.wasm_bindgen__convert__closures__invoke3_mut__h629417323d5efbaa(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));

};
imports.wbg.__wbg_constructor_81b34c49dcbdd2af = function(arg0) {
const ret = new Error(takeObject(arg0));
return addHeapObject(ret);
};
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_cb_drop = function(arg0) {

@@ -682,16 +690,2 @@ const obj = takeObject(arg0).original;

};
imports.wbg.__wbg_constructor_81b34c49dcbdd2af = function(arg0) {
const ret = new Error(takeObject(arg0));
return addHeapObject(ret);
};
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(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_is_array = function(arg0) {

@@ -717,2 +711,8 @@ const ret = Array.isArray(getObject(arg0));

};
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.__wbg_new_ee5ac63ff3b0fa4d = function() {

@@ -909,4 +909,4 @@ const ret = new Array();

};
imports.wbg.__wbindgen_closure_wrapper742 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 239, __wbg_adapter_22);
imports.wbg.__wbindgen_closure_wrapper739 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 240, __wbg_adapter_22);
return addHeapObject(ret);

@@ -913,0 +913,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