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.0-fd816cf.nightly to 1.0.0-beta.1-0007992.nightly

14

nodejs/acvm_js_bg.wasm.d.ts

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

export function buildInfo(): number;
export function compressWitness(a: number, b: number): void;
export function decompressWitness(a: number, b: number, c: number): void;
export function compressWitnessStack(a: number, b: number): void;
export function decompressWitnessStack(a: number, b: number, c: number): void;
export function initLogLevel(a: number, b: number, c: number): void;

@@ -16,6 +20,2 @@ export function getReturnWitness(a: number, b: number, c: number, d: number): void;

export function getPublicWitness(a: number, b: number, c: number, d: number): void;
export function compressWitness(a: number, b: number): void;
export function decompressWitness(a: number, b: number, c: number): void;
export function compressWitnessStack(a: number, b: number): void;
export function decompressWitnessStack(a: number, b: number, c: number): void;
export function executeCircuit(a: number, b: number, c: number, d: number): number;

@@ -27,7 +27,7 @@ export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number;

export const __wbindgen_export_2: WebAssembly.Table;
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h624a3dfbf78ca22a(a: number, b: number, c: number): void;
export function wasm_bindgen__convert__closures__invoke1_mut__h7f1511a2915e72e7(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__h45040feada3ebb25(a: number, b: number, c: number, d: number, e: number): void;
export function wasm_bindgen__convert__closures__invoke3_mut__h0ccbefcb4d729e69(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__h3f07259b3eb55784(a: number, b: number, c: number, d: number): void;
export function wasm_bindgen__convert__closures__invoke2_mut__h2ed79be2e23ac22f(a: number, b: number, c: number, d: number): void;

@@ -54,2 +54,31 @@ /* tslint:disable */

/**
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
*
* @param {WitnessMap} witness_map - A witness map.
* @returns {Uint8Array} A compressed witness map
*/
export function compressWitness(witness_map: WitnessMap): Uint8Array;
/**
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
* This should be used to only fetch the witness map for the main function.
*
* @param {Uint8Array} compressed_witness - A compressed witness.
* @returns {WitnessMap} The decompressed witness map.
*/
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
/**
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
*
* @param {WitnessStack} witness_stack - A witness stack.
* @returns {Uint8Array} A compressed witness stack
*/
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
/**
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
*
* @param {Uint8Array} compressed_witness - A compressed witness.
* @returns {WitnessStack} The decompressed witness stack.
*/
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
/**
* Sets the package's logging level.

@@ -94,31 +123,2 @@ *

/**
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
*
* @param {WitnessMap} witness_map - A witness map.
* @returns {Uint8Array} A compressed witness map
*/
export function compressWitness(witness_map: WitnessMap): Uint8Array;
/**
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
* This should be used to only fetch the witness map for the main function.
*
* @param {Uint8Array} compressed_witness - A compressed witness.
* @returns {WitnessMap} The decompressed witness map.
*/
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
/**
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
*
* @param {WitnessStack} witness_stack - A witness stack.
* @returns {Uint8Array} A compressed witness stack
*/
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
/**
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
*
* @param {Uint8Array} compressed_witness - A compressed witness.
* @returns {WitnessStack} The decompressed witness stack.
*/
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.

@@ -166,16 +166,2 @@ *

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 RawAssertionPayload = {

@@ -194,11 +180,2 @@ selector: string;

export type StackItem = {
index: number;
witness: WitnessMap;
}
export type WitnessStack = Array<StackItem>;
// Map from witness index to hex string value of witness.

@@ -218,1 +195,24 @@ export type WitnessMap = Map<number, string>;

export type StackItem = {
index: number;
witness: WitnessMap;
}
export type WitnessStack = Array<StackItem>;
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,3 +220,3 @@ let imports = {};

function __wbg_adapter_22(arg0, arg1, arg2) {
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h624a3dfbf78ca22a(arg0, arg1, addHeapObject(arg2));
wasm.wasm_bindgen__convert__closures__invoke1_mut__h7f1511a2915e72e7(arg0, arg1, addHeapObject(arg2));
}

@@ -374,17 +374,21 @@

/**
* Sets the package's logging level.
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
* @param {WitnessMap} witness_map - A witness map.
* @returns {Uint8Array} A compressed witness map
*/
module.exports.initLogLevel = function(filter) {
module.exports.compressWitness = function(witness_map) {
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);
wasm.compressWitness(retptr, addHeapObject(witness_map));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
if (r1) {
throw takeObject(r0);
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r3 = getInt32Memory0()[retptr / 4 + 3];
if (r3) {
throw takeObject(r2);
}
var v1 = getArrayU8FromWasm0(r0, r1).slice();
wasm.__wbindgen_free(r0, r1 * 1);
return v1;
} finally {

@@ -396,17 +400,14 @@ wasm.__wbindgen_add_to_stack_pointer(16);

/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
* This should be used to only fetch the witness map for the main function.
*
* @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 {Uint8Array} compressed_witness - A compressed witness.
* @returns {WitnessMap} The decompressed witness map.
*/
module.exports.getReturnWitness = function(program, witness_map) {
module.exports.decompressWitness = function(compressed_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
wasm.decompressWitness(retptr, ptr0, len0);
var r0 = getInt32Memory0()[retptr / 4 + 0];

@@ -425,24 +426,21 @@ var r1 = getInt32Memory0()[retptr / 4 + 1];

/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
*
* @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 {WitnessStack} witness_stack - A witness stack.
* @returns {Uint8Array} A compressed witness stack
*/
module.exports.getPublicParametersWitness = function(program, solved_witness) {
module.exports.compressWitnessStack = function(witness_stack) {
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));
wasm.compressWitnessStack(retptr, addHeapObject(witness_stack));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
if (r2) {
throw takeObject(r1);
var r3 = getInt32Memory0()[retptr / 4 + 3];
if (r3) {
throw takeObject(r2);
}
return takeObject(r0);
var v1 = getArrayU8FromWasm0(r0, r1).slice();
wasm.__wbindgen_free(r0, r1 * 1);
return v1;
} finally {

@@ -454,17 +452,13 @@ wasm.__wbindgen_add_to_stack_pointer(16);

/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
*
* @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} compressed_witness - A compressed witness.
* @returns {WitnessStack} The decompressed witness stack.
*/
module.exports.getPublicWitness = function(program, solved_witness) {
module.exports.decompressWitnessStack = function(compressed_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
wasm.decompressWitnessStack(retptr, ptr0, len0);
var r0 = getInt32Memory0()[retptr / 4 + 0];

@@ -483,21 +477,17 @@ var r1 = getInt32Memory0()[retptr / 4 + 1];

/**
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
* Sets the package's logging level.
*
* @param {WitnessMap} witness_map - A witness map.
* @returns {Uint8Array} A compressed witness map
* @param {LogLevel} level - The maximum level of logging to be emitted.
*/
module.exports.compressWitness = function(witness_map) {
module.exports.initLogLevel = function(filter) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.compressWitness(retptr, addHeapObject(witness_map));
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];
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r3 = getInt32Memory0()[retptr / 4 + 3];
if (r3) {
throw takeObject(r2);
if (r1) {
throw takeObject(r0);
}
var v1 = getArrayU8FromWasm0(r0, r1).slice();
wasm.__wbindgen_free(r0, r1 * 1);
return v1;
} finally {

@@ -509,14 +499,17 @@ wasm.__wbindgen_add_to_stack_pointer(16);

/**
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
* This should be used to only fetch the witness map for the main function.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
*
* @param {Uint8Array} compressed_witness - A compressed witness.
* @returns {WitnessMap} The decompressed witness map.
* @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}
*/
module.exports.decompressWitness = function(compressed_witness) {
module.exports.getReturnWitness = function(program, witness_map) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.decompressWitness(retptr, ptr0, len0);
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
var r0 = getInt32Memory0()[retptr / 4 + 0];

@@ -535,21 +528,24 @@ var r1 = getInt32Memory0()[retptr / 4 + 1];

/**
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
*
* @param {WitnessStack} witness_stack - A witness stack.
* @returns {Uint8Array} A compressed witness stack
* @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.compressWitnessStack = function(witness_stack) {
module.exports.getPublicParametersWitness = function(program, solved_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.compressWitnessStack(retptr, addHeapObject(witness_stack));
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];
var r3 = getInt32Memory0()[retptr / 4 + 3];
if (r3) {
throw takeObject(r2);
if (r2) {
throw takeObject(r1);
}
var v1 = getArrayU8FromWasm0(r0, r1).slice();
wasm.__wbindgen_free(r0, r1 * 1);
return v1;
return takeObject(r0);
} finally {

@@ -561,13 +557,17 @@ wasm.__wbindgen_add_to_stack_pointer(16);

/**
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
*
* @param {Uint8Array} compressed_witness - A compressed witness.
* @returns {WitnessStack} The decompressed witness stack.
* @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.decompressWitnessStack = function(compressed_witness) {
module.exports.getPublicWitness = function(program, solved_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.decompressWitnessStack(retptr, ptr0, len0);
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
var r0 = getInt32Memory0()[retptr / 4 + 0];

@@ -632,3 +632,3 @@ var r1 = getInt32Memory0()[retptr / 4 + 1];

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

@@ -644,3 +644,3 @@

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

@@ -652,9 +652,2 @@

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

@@ -670,3 +663,10 @@ const obj = takeObject(arg0).original;

module.exports.__wbg_constructor_f8f83aa6ec3644b9 = function(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.__wbg_constructor_a10f2b77c63b8d5e = function(arg0) {
const ret = new Error(takeObject(arg0));

@@ -681,12 +681,2 @@ return addHeapObject(ret);

module.exports.__wbg_new_1549a44c58f2740a = function() {
const ret = new Array();
return addHeapObject(ret);
};
module.exports.__wbindgen_number_new = function(arg0) {
const ret = arg0;
return addHeapObject(ret);
};
module.exports.__wbindgen_is_array = function(arg0) {

@@ -697,9 +687,9 @@ const ret = Array.isArray(getObject(arg0));

module.exports.__wbindgen_is_string = function(arg0) {
const ret = typeof(getObject(arg0)) === 'string';
return ret;
module.exports.__wbg_new_d86d15722f6b14a4 = function() {
const ret = new Map();
return addHeapObject(ret);
};
module.exports.__wbg_new_d9156d5ca3339252 = function() {
const ret = new Map();
module.exports.__wbindgen_number_new = function(arg0) {
const ret = arg0;
return addHeapObject(ret);

@@ -717,2 +707,12 @@ };

module.exports.__wbg_new_a16954212d33afab = function() {
const ret = new Array();
return addHeapObject(ret);
};
module.exports.__wbindgen_is_string = function(arg0) {
const ret = typeof(getObject(arg0)) === 'string';
return ret;
};
module.exports.__wbg_new_abda76e883ba8a5f = function() {

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

module.exports.__wbindgen_closure_wrapper730 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 268, __wbg_adapter_22);
module.exports.__wbindgen_closure_wrapper766 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 303, __wbg_adapter_22);
return addHeapObject(ret);

@@ -940,0 +940,0 @@ };

{
"name": "@noir-lang/acvm_js",
"version": "1.0.0-beta.0-fd816cf.nightly",
"version": "1.0.0-beta.1-0007992.nightly",
"publishConfig": {

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

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

export function buildInfo(): number;
export function compressWitness(a: number, b: number): void;
export function decompressWitness(a: number, b: number, c: number): void;
export function compressWitnessStack(a: number, b: number): void;
export function decompressWitnessStack(a: number, b: number, c: number): void;
export function initLogLevel(a: number, b: number, c: number): void;

@@ -16,6 +20,2 @@ export function getReturnWitness(a: number, b: number, c: number, d: number): void;

export function getPublicWitness(a: number, b: number, c: number, d: number): void;
export function compressWitness(a: number, b: number): void;
export function decompressWitness(a: number, b: number, c: number): void;
export function compressWitnessStack(a: number, b: number): void;
export function decompressWitnessStack(a: number, b: number, c: number): void;
export function executeCircuit(a: number, b: number, c: number, d: number): number;

@@ -27,7 +27,7 @@ export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number;

export const __wbindgen_export_2: WebAssembly.Table;
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h624a3dfbf78ca22a(a: number, b: number, c: number): void;
export function wasm_bindgen__convert__closures__invoke1_mut__h7f1511a2915e72e7(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__h45040feada3ebb25(a: number, b: number, c: number, d: number, e: number): void;
export function wasm_bindgen__convert__closures__invoke3_mut__h0ccbefcb4d729e69(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__h3f07259b3eb55784(a: number, b: number, c: number, d: number): void;
export function wasm_bindgen__convert__closures__invoke2_mut__h2ed79be2e23ac22f(a: number, b: number, c: number, d: number): void;

@@ -54,2 +54,31 @@ /* tslint:disable */

/**
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
*
* @param {WitnessMap} witness_map - A witness map.
* @returns {Uint8Array} A compressed witness map
*/
export function compressWitness(witness_map: WitnessMap): Uint8Array;
/**
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
* This should be used to only fetch the witness map for the main function.
*
* @param {Uint8Array} compressed_witness - A compressed witness.
* @returns {WitnessMap} The decompressed witness map.
*/
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
/**
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
*
* @param {WitnessStack} witness_stack - A witness stack.
* @returns {Uint8Array} A compressed witness stack
*/
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
/**
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
*
* @param {Uint8Array} compressed_witness - A compressed witness.
* @returns {WitnessStack} The decompressed witness stack.
*/
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
/**
* Sets the package's logging level.

@@ -94,31 +123,2 @@ *

/**
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
*
* @param {WitnessMap} witness_map - A witness map.
* @returns {Uint8Array} A compressed witness map
*/
export function compressWitness(witness_map: WitnessMap): Uint8Array;
/**
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
* This should be used to only fetch the witness map for the main function.
*
* @param {Uint8Array} compressed_witness - A compressed witness.
* @returns {WitnessMap} The decompressed witness map.
*/
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
/**
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
*
* @param {WitnessStack} witness_stack - A witness stack.
* @returns {Uint8Array} A compressed witness stack
*/
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
/**
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
*
* @param {Uint8Array} compressed_witness - A compressed witness.
* @returns {WitnessStack} The decompressed witness stack.
*/
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
/**
* Executes an ACIR circuit to generate the solved witness from the initial witness.

@@ -166,16 +166,2 @@ *

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 RawAssertionPayload = {

@@ -194,11 +180,2 @@ selector: string;

export type StackItem = {
index: number;
witness: WitnessMap;
}
export type WitnessStack = Array<StackItem>;
// Map from witness index to hex string value of witness.

@@ -219,2 +196,25 @@ export type WitnessMap = Map<number, string>;

export type StackItem = {
index: number;
witness: WitnessMap;
}
export type WitnessStack = Array<StackItem>;
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;

@@ -231,2 +231,6 @@

readonly buildInfo: () => number;
readonly compressWitness: (a: number, b: number) => void;
readonly decompressWitness: (a: number, b: number, c: number) => void;
readonly compressWitnessStack: (a: number, b: number) => void;
readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
readonly initLogLevel: (a: number, b: number, c: number) => void;

@@ -236,6 +240,2 @@ readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;

readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
readonly compressWitness: (a: number, b: number) => void;
readonly decompressWitness: (a: number, b: number, c: number) => void;
readonly compressWitnessStack: (a: number, b: number) => void;
readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;

@@ -247,8 +247,8 @@ readonly executeCircuitWithReturnWitness: (a: number, b: number, c: number, d: number) => number;

readonly __wbindgen_export_2: WebAssembly.Table;
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h624a3dfbf78ca22a: (a: number, b: number, c: number) => void;
readonly wasm_bindgen__convert__closures__invoke1_mut__h7f1511a2915e72e7: (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__h45040feada3ebb25: (a: number, b: number, c: number, d: number, e: number) => void;
readonly wasm_bindgen__convert__closures__invoke3_mut__h0ccbefcb4d729e69: (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__h3f07259b3eb55784: (a: number, b: number, c: number, d: number) => void;
readonly wasm_bindgen__convert__closures__invoke2_mut__h2ed79be2e23ac22f: (a: number, b: number, c: number, d: number) => void;
}

@@ -255,0 +255,0 @@

@@ -217,3 +217,3 @@ let wasm;

function __wbg_adapter_22(arg0, arg1, arg2) {
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h624a3dfbf78ca22a(arg0, arg1, addHeapObject(arg2));
wasm.wasm_bindgen__convert__closures__invoke1_mut__h7f1511a2915e72e7(arg0, arg1, addHeapObject(arg2));
}

@@ -371,17 +371,21 @@

/**
* Sets the package's logging level.
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
*
* @param {LogLevel} level - The maximum level of logging to be emitted.
* @param {WitnessMap} witness_map - A witness map.
* @returns {Uint8Array} A compressed witness map
*/
export function initLogLevel(filter) {
export function compressWitness(witness_map) {
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);
wasm.compressWitness(retptr, addHeapObject(witness_map));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
if (r1) {
throw takeObject(r0);
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r3 = getInt32Memory0()[retptr / 4 + 3];
if (r3) {
throw takeObject(r2);
}
var v1 = getArrayU8FromWasm0(r0, r1).slice();
wasm.__wbindgen_free(r0, r1 * 1);
return v1;
} finally {

@@ -393,17 +397,14 @@ wasm.__wbindgen_add_to_stack_pointer(16);

/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
* This should be used to only fetch the witness map for the main function.
*
* @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 {Uint8Array} compressed_witness - A compressed witness.
* @returns {WitnessMap} The decompressed witness map.
*/
export function getReturnWitness(program, witness_map) {
export function decompressWitness(compressed_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
wasm.decompressWitness(retptr, ptr0, len0);
var r0 = getInt32Memory0()[retptr / 4 + 0];

@@ -422,24 +423,21 @@ var r1 = getInt32Memory0()[retptr / 4 + 1];

/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
*
* @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 {WitnessStack} witness_stack - A witness stack.
* @returns {Uint8Array} A compressed witness stack
*/
export function getPublicParametersWitness(program, solved_witness) {
export function compressWitnessStack(witness_stack) {
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));
wasm.compressWitnessStack(retptr, addHeapObject(witness_stack));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
if (r2) {
throw takeObject(r1);
var r3 = getInt32Memory0()[retptr / 4 + 3];
if (r3) {
throw takeObject(r2);
}
return takeObject(r0);
var v1 = getArrayU8FromWasm0(r0, r1).slice();
wasm.__wbindgen_free(r0, r1 * 1);
return v1;
} finally {

@@ -451,17 +449,13 @@ wasm.__wbindgen_add_to_stack_pointer(16);

/**
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
*
* @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} compressed_witness - A compressed witness.
* @returns {WitnessStack} The decompressed witness stack.
*/
export function getPublicWitness(program, solved_witness) {
export function decompressWitnessStack(compressed_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
wasm.decompressWitnessStack(retptr, ptr0, len0);
var r0 = getInt32Memory0()[retptr / 4 + 0];

@@ -480,21 +474,17 @@ var r1 = getInt32Memory0()[retptr / 4 + 1];

/**
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
* Sets the package's logging level.
*
* @param {WitnessMap} witness_map - A witness map.
* @returns {Uint8Array} A compressed witness map
* @param {LogLevel} level - The maximum level of logging to be emitted.
*/
export function compressWitness(witness_map) {
export function initLogLevel(filter) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.compressWitness(retptr, addHeapObject(witness_map));
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];
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r3 = getInt32Memory0()[retptr / 4 + 3];
if (r3) {
throw takeObject(r2);
if (r1) {
throw takeObject(r0);
}
var v1 = getArrayU8FromWasm0(r0, r1).slice();
wasm.__wbindgen_free(r0, r1 * 1);
return v1;
} finally {

@@ -506,14 +496,17 @@ wasm.__wbindgen_add_to_stack_pointer(16);

/**
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
* This should be used to only fetch the witness map for the main function.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
*
* @param {Uint8Array} compressed_witness - A compressed witness.
* @returns {WitnessMap} The decompressed witness map.
* @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}
*/
export function decompressWitness(compressed_witness) {
export function getReturnWitness(program, witness_map) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.decompressWitness(retptr, ptr0, len0);
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
var r0 = getInt32Memory0()[retptr / 4 + 0];

@@ -532,21 +525,24 @@ var r1 = getInt32Memory0()[retptr / 4 + 1];

/**
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
*
* @param {WitnessStack} witness_stack - A witness stack.
* @returns {Uint8Array} A compressed witness stack
* @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 compressWitnessStack(witness_stack) {
export function getPublicParametersWitness(program, solved_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.compressWitnessStack(retptr, addHeapObject(witness_stack));
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];
var r3 = getInt32Memory0()[retptr / 4 + 3];
if (r3) {
throw takeObject(r2);
if (r2) {
throw takeObject(r1);
}
var v1 = getArrayU8FromWasm0(r0, r1).slice();
wasm.__wbindgen_free(r0, r1 * 1);
return v1;
return takeObject(r0);
} finally {

@@ -558,13 +554,17 @@ wasm.__wbindgen_add_to_stack_pointer(16);

/**
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
*
* @param {Uint8Array} compressed_witness - A compressed witness.
* @returns {WitnessStack} The decompressed witness stack.
* @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 decompressWitnessStack(compressed_witness) {
export function getPublicWitness(program, solved_witness) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.decompressWitnessStack(retptr, ptr0, len0);
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
var r0 = getInt32Memory0()[retptr / 4 + 0];

@@ -629,3 +629,3 @@ var r1 = getInt32Memory0()[retptr / 4 + 1];

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

@@ -641,3 +641,3 @@

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

@@ -682,8 +682,2 @@

};
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof(obj) === 'number' ? obj : undefined;
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
};
imports.wbg.__wbindgen_cb_drop = function(arg0) {

@@ -698,3 +692,9 @@ const obj = takeObject(arg0).original;

};
imports.wbg.__wbg_constructor_f8f83aa6ec3644b9 = function(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_constructor_a10f2b77c63b8d5e = function(arg0) {
const ret = new Error(takeObject(arg0));

@@ -707,10 +707,2 @@ return addHeapObject(ret);

};
imports.wbg.__wbg_new_1549a44c58f2740a = function() {
const ret = new Array();
return addHeapObject(ret);
};
imports.wbg.__wbindgen_number_new = function(arg0) {
const ret = arg0;
return addHeapObject(ret);
};
imports.wbg.__wbindgen_is_array = function(arg0) {

@@ -720,10 +712,10 @@ const ret = Array.isArray(getObject(arg0));

};
imports.wbg.__wbindgen_is_string = function(arg0) {
const ret = typeof(getObject(arg0)) === 'string';
return ret;
};
imports.wbg.__wbg_new_d9156d5ca3339252 = function() {
imports.wbg.__wbg_new_d86d15722f6b14a4 = function() {
const ret = new Map();
return addHeapObject(ret);
};
imports.wbg.__wbindgen_number_new = function(arg0) {
const ret = arg0;
return addHeapObject(ret);
};
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {

@@ -737,2 +729,10 @@ const obj = getObject(arg1);

};
imports.wbg.__wbg_new_a16954212d33afab = function() {
const ret = new Array();
return addHeapObject(ret);
};
imports.wbg.__wbindgen_is_string = function(arg0) {
const ret = typeof(getObject(arg0)) === 'string';
return ret;
};
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {

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

};
imports.wbg.__wbindgen_closure_wrapper730 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 268, __wbg_adapter_22);
imports.wbg.__wbindgen_closure_wrapper766 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 303, __wbg_adapter_22);
return addHeapObject(ret);

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