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.47.0 to 0.48.0

8

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

@@ -12,0 +12,0 @@ export function xor(a: number, b: number): number;

/* tslint:disable */
/* eslint-disable */
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
* Sets the package's logging level.
*
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
* @param {LogLevel} level - The maximum level of logging to be emitted.
*/
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
export function initLogLevel(filter: string): void;
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
* This method also extracts the public return values from the solved witness into its own return witness.
*
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
* @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
*/
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
*
* @param {Uint8Array} program - A serialized representation of an ACIR program
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
*/
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.

@@ -65,8 +43,30 @@ *

/**
* Sets the package's logging level.
* Executes an ACIR circuit to generate the solved witness from the initial witness.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
*/
export function initLogLevel(filter: string): void;
export 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>;
/**
* Performs a bitwise AND operation between `lhs` and `rhs`

@@ -167,17 +167,2 @@ * @param {string} lhs

// Map from witness index to hex string value of witness.
export type WitnessMap = Map<number, string>;
/**
* An execution result containing two witnesses.
* 1. The full solved witness of the execution.
* 2. The return witness which contains the given public return values within the full witness.
*/
export type SolvedAndReturnWitness = {
solvedWitness: WitnessMap;
returnWitness: WitnessMap;
}
export type StackItem = {

@@ -192,2 +177,16 @@ index: number;

/**
* @typedef {Object} BuildInfo - Information about how the installed package was built
* @property {string} gitHash - The hash of the git commit from which the package was built.
* @property {string} version - The version of the package at the built git commit.
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
*/
export type BuildInfo = {
gitHash: string;
version: string;
dirty: string;
}
export type ForeignCallInput = string[]

@@ -207,14 +206,15 @@ export type ForeignCallOutput = string | string[]

// Map from witness index to hex string value of witness.
export type WitnessMap = Map<number, 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.
* An execution result containing two witnesses.
* 1. The full solved witness of the execution.
* 2. The return witness which contains the given public return values within the full witness.
*/
export type BuildInfo = {
gitHash: string;
version: string;
dirty: string;
export type SolvedAndReturnWitness = {
solvedWitness: WitnessMap;
returnWitness: WitnessMap;
}

@@ -26,2 +26,24 @@ let imports = {};

function isLikeNone(x) {
return x === undefined || x === null;
}
let cachedFloat64Memory0 = null;
function getFloat64Memory0() {
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
}
return cachedFloat64Memory0;
}
let cachedInt32Memory0 = null;
function getInt32Memory0() {
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
}
return cachedInt32Memory0;
}
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });

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

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) {

@@ -225,2 +225,23 @@ // primitive types

/**
* Sets the package's logging level.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
*/
module.exports.initLogLevel = function(filter) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
wasm.initLogLevel(retptr, ptr0, len0);
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
if (r1) {
throw takeObject(r0);
}
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
};
function passArray8ToWasm0(arg, malloc) {

@@ -233,48 +254,2 @@ const ptr = malloc(arg.length * 1) >>> 0;

/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
*
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
*/
module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
return takeObject(ret);
};
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
* This method also extracts the public return values from the solved witness into its own return witness.
*
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
* @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
*/
module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
return takeObject(ret);
};
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
*
* @param {Uint8Array} program - A serialized representation of an ACIR program
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
*/
module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.executeProgram(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
return takeObject(ret);
};
/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.

@@ -364,23 +339,48 @@ *

/**
* Sets the package's logging level.
* Executes an ACIR circuit to generate the solved witness from the initial witness.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
*/
module.exports.initLogLevel = function(filter) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
wasm.initLogLevel(retptr, ptr0, len0);
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
if (r1) {
throw takeObject(r0);
}
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
return takeObject(ret);
};
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
* This method also extracts the public return values from the solved witness into its own return witness.
*
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
* @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
*/
module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
return takeObject(ret);
};
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
*
* @param {Uint8Array} program - A serialized representation of an ACIR program
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
*/
module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.executeProgram(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
return takeObject(ret);
};
/**
* Performs a bitwise AND operation between `lhs` and `rhs`

@@ -639,2 +639,12 @@ * @param {string} lhs

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) {

@@ -644,4 +654,11 @@ takeObject(arg0);

module.exports.__wbindgen_string_new = function(arg0, arg1) {
const ret = getStringFromWasm0(arg0, arg1);
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_constructor_a4e1fbe49b64399a = function(arg0) {
const ret = new Error(takeObject(arg0));
return addHeapObject(ret);

@@ -655,9 +672,14 @@ };

module.exports.__wbg_constructor_971e67e66cc5bd6a = function(arg0) {
const ret = new Error(takeObject(arg0));
module.exports.__wbindgen_is_string = function(arg0) {
const ret = typeof(getObject(arg0)) === 'string';
return ret;
};
module.exports.__wbindgen_string_new = function(arg0, arg1) {
const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret);
};
module.exports.__wbg_new_193bac1dd2be232d = function() {
const ret = new Map();
module.exports.__wbg_new_99fb929611321a93 = function() {
const ret = new Array();
return addHeapObject(ret);

@@ -671,2 +693,7 @@ };

module.exports.__wbg_new_237eb36a3bda602b = function() {
const ret = new Map();
return addHeapObject(ret);
};
module.exports.__wbindgen_string_get = function(arg0, arg1) {

@@ -681,29 +708,2 @@ const obj = getObject(arg1);

module.exports.__wbindgen_number_get = function(arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof(obj) === 'number' ? obj : undefined;
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
};
module.exports.__wbindgen_is_string = function(arg0) {
const ret = typeof(getObject(arg0)) === 'string';
return ret;
};
module.exports.__wbindgen_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_f139361aad331bd0 = function() {
const ret = new Array();
return addHeapObject(ret);
};
module.exports.__wbg_new_abda76e883ba8a5f = function() {

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

module.exports.__wbindgen_closure_wrapper739 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 237, __wbg_adapter_22);
module.exports.__wbindgen_closure_wrapper759 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 256, __wbg_adapter_22);
return addHeapObject(ret);

@@ -931,0 +931,0 @@ };

{
"name": "@noir-lang/acvm_js",
"version": "0.47.0",
"version": "0.48.0",
"publishConfig": {

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

/* tslint:disable */
/* eslint-disable */
export const memory: WebAssembly.Memory;
export function initLogLevel(a: number, b: number, c: number): void;
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 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 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 and(a: number, b: number): number;

@@ -12,0 +12,0 @@ export function xor(a: number, b: number): number;

/* tslint:disable */
/* eslint-disable */
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
* Sets the package's logging level.
*
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
* @param {LogLevel} level - The maximum level of logging to be emitted.
*/
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
export function initLogLevel(filter: string): void;
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
* This method also extracts the public return values from the solved witness into its own return witness.
*
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
* @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
*/
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
*
* @param {Uint8Array} program - A serialized representation of an ACIR program
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
*/
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.

@@ -65,8 +43,30 @@ *

/**
* Sets the package's logging level.
* Executes an ACIR circuit to generate the solved witness from the initial witness.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
*/
export function initLogLevel(filter: string): void;
export 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>;
/**
* Performs a bitwise AND operation between `lhs` and `rhs`

@@ -167,17 +167,2 @@ * @param {string} lhs

// Map from witness index to hex string value of witness.
export type WitnessMap = Map<number, string>;
/**
* An execution result containing two witnesses.
* 1. The full solved witness of the execution.
* 2. The return witness which contains the given public return values within the full witness.
*/
export type SolvedAndReturnWitness = {
solvedWitness: WitnessMap;
returnWitness: WitnessMap;
}
export type StackItem = {

@@ -192,2 +177,16 @@ index: number;

/**
* @typedef {Object} BuildInfo - Information about how the installed package was built
* @property {string} gitHash - The hash of the git commit from which the package was built.
* @property {string} version - The version of the package at the built git commit.
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
*/
export type BuildInfo = {
gitHash: string;
version: string;
dirty: string;
}
export type ForeignCallInput = string[]

@@ -207,12 +206,13 @@ export type ForeignCallOutput = string | string[]

// Map from witness index to hex string value of witness.
export type WitnessMap = Map<number, 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.
* An execution result containing two witnesses.
* 1. The full solved witness of the execution.
* 2. The return witness which contains the given public return values within the full witness.
*/
export type BuildInfo = {
gitHash: string;
version: string;
dirty: string;
export type SolvedAndReturnWitness = {
solvedWitness: WitnessMap;
returnWitness: WitnessMap;
}

@@ -226,9 +226,9 @@

readonly memory: WebAssembly.Memory;
readonly initLogLevel: (a: number, b: number, c: number) => void;
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 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 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 and: (a: number, b: number) => number;

@@ -235,0 +235,0 @@ readonly xor: (a: number, b: number) => number;

@@ -23,2 +23,24 @@ let wasm;

function isLikeNone(x) {
return x === undefined || x === null;
}
let cachedFloat64Memory0 = null;
function getFloat64Memory0() {
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
}
return cachedFloat64Memory0;
}
let cachedInt32Memory0 = null;
function getInt32Memory0() {
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
}
return cachedInt32Memory0;
}
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );

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

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) {

@@ -222,2 +222,23 @@ // primitive types

/**
* Sets the package's logging level.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
*/
export function initLogLevel(filter) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
wasm.initLogLevel(retptr, ptr0, len0);
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
if (r1) {
throw takeObject(r0);
}
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
}
function passArray8ToWasm0(arg, malloc) {

@@ -230,48 +251,2 @@ const ptr = malloc(arg.length * 1) >>> 0;

/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
*
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
*/
export function executeCircuit(program, initial_witness, foreign_call_handler) {
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
return takeObject(ret);
}
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
* This method also extracts the public return values from the solved witness into its own return witness.
*
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
* @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
*/
export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
return takeObject(ret);
}
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
*
* @param {Uint8Array} program - A serialized representation of an ACIR program
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
*/
export function executeProgram(program, initial_witness, foreign_call_handler) {
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.executeProgram(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
return takeObject(ret);
}
/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.

@@ -361,23 +336,48 @@ *

/**
* Sets the package's logging level.
* Executes an ACIR circuit to generate the solved witness from the initial witness.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
*/
export function initLogLevel(filter) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
wasm.initLogLevel(retptr, ptr0, len0);
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
if (r1) {
throw takeObject(r0);
}
} finally {
wasm.__wbindgen_add_to_stack_pointer(16);
}
export function executeCircuit(program, initial_witness, foreign_call_handler) {
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
return takeObject(ret);
}
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
* This method also extracts the public return values from the solved witness into its own return witness.
*
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
* @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
*/
export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
return takeObject(ret);
}
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.
*
* @param {Uint8Array} program - A serialized representation of an ACIR program
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
*/
export function executeProgram(program, initial_witness, foreign_call_handler) {
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.executeProgram(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
return takeObject(ret);
}
/**
* Performs a bitwise AND operation between `lhs` and `rhs`

@@ -670,7 +670,22 @@ * @param {string} lhs

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

@@ -682,8 +697,12 @@ };

};
imports.wbg.__wbg_constructor_971e67e66cc5bd6a = function(arg0) {
const ret = new Error(takeObject(arg0));
imports.wbg.__wbindgen_is_string = function(arg0) {
const ret = typeof(getObject(arg0)) === 'string';
return ret;
};
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret);
};
imports.wbg.__wbg_new_193bac1dd2be232d = function() {
const ret = new Map();
imports.wbg.__wbg_new_99fb929611321a93 = function() {
const ret = new Array();
return addHeapObject(ret);

@@ -695,2 +714,6 @@ };

};
imports.wbg.__wbg_new_237eb36a3bda602b = function() {
const ret = new Map();
return addHeapObject(ret);
};
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {

@@ -704,25 +727,2 @@ const obj = getObject(arg1);

};
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof(obj) === 'number' ? obj : undefined;
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
};
imports.wbg.__wbindgen_is_string = function(arg0) {
const ret = typeof(getObject(arg0)) === 'string';
return ret;
};
imports.wbg.__wbindgen_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_f139361aad331bd0 = function() {
const ret = new Array();
return addHeapObject(ret);
};
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {

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

};
imports.wbg.__wbindgen_closure_wrapper739 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 237, __wbg_adapter_22);
imports.wbg.__wbindgen_closure_wrapper759 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 256, __wbg_adapter_22);
return addHeapObject(ret);

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