Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@noir-lang/acvm_js

Package Overview
Dependencies
Maintainers
1
Versions
283
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.53.0 to 0.54.0-0fc0c53.nightly

24

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

@@ -14,7 +15,6 @@ export function xor(a: number, b: number): number;

export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
export function buildInfo(): number;
export function compressWitness(a: number, b: number): void;
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;
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;

@@ -26,7 +26,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__h21c8ca3eb6ab9385(a: number, b: number, c: number): void;
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 __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__h17fc532521b46256(a: number, b: number, c: number, d: number, e: number): void;
export function wasm_bindgen__convert__closures__invoke3_mut__h45040feada3ebb25(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__h0d187b0f08495587(a: number, b: number, c: number, d: number): void;
export function wasm_bindgen__convert__closures__invoke2_mut__h3f07259b3eb55784(a: number, b: number, c: number, d: number): void;
/* tslint:disable */
/* eslint-disable */
/**
* 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: string): void;
export function compressWitness(witness_map: WitnessMap): Uint8Array;
/**
* 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: Uint8Array, witness_map: WitnessMap): WitnessMap;
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
/**
* 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: Uint8Array, solved_witness: WitnessMap): WitnessMap;
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
/**
* 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: Uint8Array, solved_witness: WitnessMap): WitnessMap;
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
/**
* Returns the `BuildInfo` object containing information about how the installed package was built.
* @returns {BuildInfo} - Information on how the installed package was built.
*/
export function buildInfo(): BuildInfo;
/**
* Performs a bitwise AND operation between `lhs` and `rhs`

@@ -88,35 +83,40 @@ * @param {string} lhs

/**
* Returns the `BuildInfo` object containing information about how the installed package was built.
* @returns {BuildInfo} - Information on how the installed package was built.
*/
export function buildInfo(): BuildInfo;
/**
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
* 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: WitnessMap): Uint8Array;
export function initLogLevel(filter: string): void;
/**
* 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: Uint8Array): WitnessMap;
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
/**
* 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: WitnessStack): Uint8Array;
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
/**
* 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: Uint8Array): WitnessStack;
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
/**

@@ -151,24 +151,2 @@ * Executes an ACIR circuit to generate the solved witness from the initial witness.

export type RawAssertionPayload = {
selector: string;
data: string[];
};
export type ExecutionError = Error & {
callStack?: string[];
rawAssertionPayload?: RawAssertionPayload;
brilligFunctionId?: number;
};
export type StackItem = {
index: number;
witness: WitnessMap;
}
export type WitnessStack = Array<StackItem>;
/**

@@ -202,2 +180,24 @@ * @typedef {Object} BuildInfo - Information about how the installed package was built

export type RawAssertionPayload = {
selector: string;
data: string[];
};
export type ExecutionError = Error & {
callStack?: string[];
rawAssertionPayload?: RawAssertionPayload;
brilligFunctionId?: number;
};
export type StackItem = {
index: number;
witness: WitnessMap;
}
export type WitnessStack = Array<StackItem>;
// Map from witness index to hex string value of witness.

@@ -204,0 +204,0 @@ export type WitnessMap = Map<number, string>;

@@ -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 });

@@ -54,24 +76,2 @@

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

@@ -222,21 +222,29 @@

function __wbg_adapter_22(arg0, arg1, arg2) {
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h21c8ca3eb6ab9385(arg0, arg1, addHeapObject(arg2));
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h624a3dfbf78ca22a(arg0, arg1, addHeapObject(arg2));
}
function getArrayU8FromWasm0(ptr, len) {
ptr = ptr >>> 0;
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
}
/**
* 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 {

@@ -254,17 +262,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];

@@ -283,24 +288,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 {

@@ -312,17 +314,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];

@@ -341,2 +339,11 @@ var r1 = getInt32Memory0()[retptr / 4 + 1];

/**
* Returns the `BuildInfo` object containing information about how the installed package was built.
* @returns {BuildInfo} - Information on how the installed package was built.
*/
module.exports.buildInfo = function() {
const ret = wasm.buildInfo();
return takeObject(ret);
};
/**
* Performs a bitwise AND operation between `lhs` and `rhs`

@@ -407,6 +414,2 @@ * @param {string} lhs

function getArrayU8FromWasm0(ptr, len) {
ptr = ptr >>> 0;
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
}
/**

@@ -476,30 +479,17 @@ * Calculates the Blake2s256 hash of the input bytes

/**
* Returns the `BuildInfo` object containing information about how the installed package was built.
* @returns {BuildInfo} - Information on how the installed package was built.
*/
module.exports.buildInfo = function() {
const ret = wasm.buildInfo();
return takeObject(ret);
};
/**
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
* 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 {

@@ -511,14 +501,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];

@@ -537,21 +530,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 {

@@ -563,13 +559,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];

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

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

@@ -646,3 +646,3 @@

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

@@ -654,2 +654,19 @@

module.exports.__wbindgen_number_get = function(arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof(obj) === 'number' ? obj : undefined;
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
};
module.exports.__wbindgen_is_string = function(arg0) {
const ret = typeof(getObject(arg0)) === 'string';
return ret;
};
module.exports.__wbindgen_is_array = function(arg0) {
const ret = Array.isArray(getObject(arg0));
return ret;
};
module.exports.__wbindgen_cb_drop = function(arg0) {

@@ -665,3 +682,3 @@ const obj = takeObject(arg0).original;

module.exports.__wbg_constructor_01cf62506201187d = function(arg0) {
module.exports.__wbg_constructor_79bab16c42849d1b = function(arg0) {
const ret = new Error(takeObject(arg0));

@@ -676,3 +693,3 @@ return addHeapObject(ret);

module.exports.__wbg_new_0d58cd3f85c51a07 = function() {
module.exports.__wbg_new_610492d70b2d4e55 = function() {
const ret = new Array();

@@ -687,20 +704,3 @@ return addHeapObject(ret);

module.exports.__wbindgen_number_get = function(arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof(obj) === 'number' ? obj : undefined;
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
};
module.exports.__wbindgen_is_string = function(arg0) {
const ret = typeof(getObject(arg0)) === 'string';
return ret;
};
module.exports.__wbindgen_is_array = function(arg0) {
const ret = Array.isArray(getObject(arg0));
return ret;
};
module.exports.__wbg_new_ced18ca7e58573af = function() {
module.exports.__wbg_new_7b5514a697f386eb = function() {
const ret = new Map();

@@ -937,4 +937,4 @@ return addHeapObject(ret);

module.exports.__wbindgen_closure_wrapper736 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 269, __wbg_adapter_22);
module.exports.__wbindgen_closure_wrapper737 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 265, __wbg_adapter_22);
return addHeapObject(ret);

@@ -941,0 +941,0 @@ };

{
"name": "@noir-lang/acvm_js",
"version": "0.53.0",
"version": "0.54.0-0fc0c53.nightly",
"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 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 buildInfo(): number;
export function and(a: number, b: number): number;

@@ -14,7 +15,6 @@ export function xor(a: number, b: number): number;

export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
export function buildInfo(): number;
export function compressWitness(a: number, b: number): void;
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;
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;

@@ -26,7 +26,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__h21c8ca3eb6ab9385(a: number, b: number, c: number): void;
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 __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__h17fc532521b46256(a: number, b: number, c: number, d: number, e: number): void;
export function wasm_bindgen__convert__closures__invoke3_mut__h45040feada3ebb25(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__h0d187b0f08495587(a: number, b: number, c: number, d: number): void;
export function wasm_bindgen__convert__closures__invoke2_mut__h3f07259b3eb55784(a: number, b: number, c: number, d: number): void;
/* tslint:disable */
/* eslint-disable */
/**
* 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: string): void;
export function compressWitness(witness_map: WitnessMap): Uint8Array;
/**
* 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: Uint8Array, witness_map: WitnessMap): WitnessMap;
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
/**
* 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: Uint8Array, solved_witness: WitnessMap): WitnessMap;
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
/**
* 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: Uint8Array, solved_witness: WitnessMap): WitnessMap;
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
/**
* Returns the `BuildInfo` object containing information about how the installed package was built.
* @returns {BuildInfo} - Information on how the installed package was built.
*/
export function buildInfo(): BuildInfo;
/**
* Performs a bitwise AND operation between `lhs` and `rhs`

@@ -88,35 +83,40 @@ * @param {string} lhs

/**
* Returns the `BuildInfo` object containing information about how the installed package was built.
* @returns {BuildInfo} - Information on how the installed package was built.
*/
export function buildInfo(): BuildInfo;
/**
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
* 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: WitnessMap): Uint8Array;
export function initLogLevel(filter: string): void;
/**
* 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: Uint8Array): WitnessMap;
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
/**
* 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: WitnessStack): Uint8Array;
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
/**
* 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: Uint8Array): WitnessStack;
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
/**

@@ -151,24 +151,2 @@ * Executes an ACIR circuit to generate the solved witness from the initial witness.

export type RawAssertionPayload = {
selector: string;
data: string[];
};
export type ExecutionError = Error & {
callStack?: string[];
rawAssertionPayload?: RawAssertionPayload;
brilligFunctionId?: number;
};
export type StackItem = {
index: number;
witness: WitnessMap;
}
export type WitnessStack = Array<StackItem>;
/**

@@ -202,2 +180,24 @@ * @typedef {Object} BuildInfo - Information about how the installed package was built

export type RawAssertionPayload = {
selector: string;
data: string[];
};
export type ExecutionError = Error & {
callStack?: string[];
rawAssertionPayload?: RawAssertionPayload;
brilligFunctionId?: number;
};
export type StackItem = {
index: number;
witness: WitnessMap;
}
export type WitnessStack = Array<StackItem>;
// Map from witness index to hex string value of witness.

@@ -222,6 +222,7 @@ export type WitnessMap = Map<number, string>;

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

@@ -233,7 +234,6 @@ readonly xor: (a: number, b: number) => number;

readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
readonly buildInfo: () => number;
readonly compressWitness: (a: number, b: number) => void;
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;
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;

@@ -245,8 +245,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__h21c8ca3eb6ab9385: (a: number, b: number, c: number) => void;
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 __wbindgen_add_to_stack_pointer: (a: number) => number;
readonly __wbindgen_free: (a: number, b: number) => void;
readonly wasm_bindgen__convert__closures__invoke3_mut__h17fc532521b46256: (a: number, b: number, c: number, d: number, e: number) => void;
readonly wasm_bindgen__convert__closures__invoke3_mut__h45040feada3ebb25: (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__h0d187b0f08495587: (a: number, b: number, c: number, d: number) => void;
readonly wasm_bindgen__convert__closures__invoke2_mut__h3f07259b3eb55784: (a: number, b: number, c: number, d: number) => void;
}

@@ -253,0 +253,0 @@

@@ -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') } } );

@@ -51,24 +73,2 @@

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;

@@ -219,21 +219,29 @@

function __wbg_adapter_22(arg0, arg1, arg2) {
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h21c8ca3eb6ab9385(arg0, arg1, addHeapObject(arg2));
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h624a3dfbf78ca22a(arg0, arg1, addHeapObject(arg2));
}
function getArrayU8FromWasm0(ptr, len) {
ptr = ptr >>> 0;
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
}
/**
* 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 {

@@ -251,17 +259,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];

@@ -280,24 +285,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 {

@@ -309,17 +311,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];

@@ -338,2 +336,11 @@ var r1 = getInt32Memory0()[retptr / 4 + 1];

/**
* Returns the `BuildInfo` object containing information about how the installed package was built.
* @returns {BuildInfo} - Information on how the installed package was built.
*/
export function buildInfo() {
const ret = wasm.buildInfo();
return takeObject(ret);
}
/**
* Performs a bitwise AND operation between `lhs` and `rhs`

@@ -404,6 +411,2 @@ * @param {string} lhs

function getArrayU8FromWasm0(ptr, len) {
ptr = ptr >>> 0;
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
}
/**

@@ -473,30 +476,17 @@ * Calculates the Blake2s256 hash of the input bytes

/**
* Returns the `BuildInfo` object containing information about how the installed package was built.
* @returns {BuildInfo} - Information on how the installed package was built.
*/
export function buildInfo() {
const ret = wasm.buildInfo();
return takeObject(ret);
}
/**
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
* 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 {

@@ -508,14 +498,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];

@@ -534,21 +527,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 {

@@ -560,13 +556,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];

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

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

@@ -643,3 +643,3 @@

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

@@ -684,2 +684,16 @@

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

@@ -694,3 +708,3 @@ const obj = takeObject(arg0).original;

};
imports.wbg.__wbg_constructor_01cf62506201187d = function(arg0) {
imports.wbg.__wbg_constructor_79bab16c42849d1b = function(arg0) {
const ret = new Error(takeObject(arg0));

@@ -703,3 +717,3 @@ return addHeapObject(ret);

};
imports.wbg.__wbg_new_0d58cd3f85c51a07 = function() {
imports.wbg.__wbg_new_610492d70b2d4e55 = function() {
const ret = new Array();

@@ -712,17 +726,3 @@ 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_string = function(arg0) {
const ret = typeof(getObject(arg0)) === 'string';
return ret;
};
imports.wbg.__wbindgen_is_array = function(arg0) {
const ret = Array.isArray(getObject(arg0));
return ret;
};
imports.wbg.__wbg_new_ced18ca7e58573af = function() {
imports.wbg.__wbg_new_7b5514a697f386eb = function() {
const ret = new Map();

@@ -922,4 +922,4 @@ return addHeapObject(ret);

};
imports.wbg.__wbindgen_closure_wrapper736 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 269, __wbg_adapter_22);
imports.wbg.__wbindgen_closure_wrapper737 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 265, __wbg_adapter_22);
return addHeapObject(ret);

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