@noir-lang/acvm_js
Advanced tools
Comparing version 0.51.0-999071b.nightly to 0.51.0-ae87d28.nightly
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function buildInfo(): number; | ||
export function getReturnWitness(a: number, b: number, c: number, d: number): void; | ||
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void; | ||
export function getPublicWitness(a: number, b: number, c: number, d: number): void; | ||
export function initLogLevel(a: number, b: number, c: number): void; | ||
@@ -19,6 +23,2 @@ export function executeCircuit(a: number, b: number, c: number, d: number): number; | ||
export function decompressWitnessStack(a: number, b: number, c: number): void; | ||
export function buildInfo(): number; | ||
export function getReturnWitness(a: number, b: number, c: number, d: number): void; | ||
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void; | ||
export function getPublicWitness(a: number, b: number, c: number, d: number): void; | ||
export function __wbindgen_malloc(a: number): number; | ||
@@ -25,0 +25,0 @@ export function __wbindgen_realloc(a: number, b: number, c: number): number; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
* @returns {BuildInfo} - Information on how the installed package was built. | ||
*/ | ||
export function buildInfo(): BuildInfo; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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 getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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 getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit. | ||
* @returns {WitnessMap} A witness map containing the circuit's public inputs. | ||
* @param {Uint8Array} program | ||
* @param {WitnessMap} solved_witness | ||
* @returns {WitnessMap} | ||
*/ | ||
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap; | ||
/** | ||
* Sets the package's logging level. | ||
@@ -117,71 +155,4 @@ * | ||
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; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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 getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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 getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit. | ||
* @returns {WitnessMap} A witness map containing the circuit's public inputs. | ||
* @param {Uint8Array} program | ||
* @param {WitnessMap} solved_witness | ||
* @returns {WitnessMap} | ||
*/ | ||
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap; | ||
// Map from witness index to hex string value of witness. | ||
export type WitnessMap = Map<number, string>; | ||
/** | ||
* An execution result containing two witnesses. | ||
* 1. The full solved witness of the execution. | ||
* 2. The return witness which contains the given public return values within the full witness. | ||
*/ | ||
export type SolvedAndReturnWitness = { | ||
solvedWitness: WitnessMap; | ||
returnWitness: WitnessMap; | ||
} | ||
export type ForeignCallInput = string[] | ||
export type ForeignCallOutput = string | string[] | ||
/** | ||
* A callback which performs an foreign call and returns the response. | ||
* @callback ForeignCallHandler | ||
* @param {string} name - The identifier for the type of foreign call being performed. | ||
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call. | ||
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call. | ||
*/ | ||
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>; | ||
/** | ||
* @typedef {Object} BuildInfo - Information about how the installed package was built | ||
@@ -221,1 +192,30 @@ * @property {string} gitHash - The hash of the git commit from which the package was built. | ||
// Map from witness index to hex string value of witness. | ||
export type WitnessMap = Map<number, string>; | ||
/** | ||
* An execution result containing two witnesses. | ||
* 1. The full solved witness of the execution. | ||
* 2. The return witness which contains the given public return values within the full witness. | ||
*/ | ||
export type SolvedAndReturnWitness = { | ||
solvedWitness: WitnessMap; | ||
returnWitness: WitnessMap; | ||
} | ||
export type 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[]>; | ||
@@ -26,22 +26,18 @@ let imports = {}; | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
let cachedFloat64Memory0 = null; | ||
cachedTextDecoder.decode(); | ||
function getFloat64Memory0() { | ||
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { | ||
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); | ||
let cachedUint8Memory0 = null; | ||
function getUint8Memory0() { | ||
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) { | ||
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
} | ||
return cachedFloat64Memory0; | ||
return cachedUint8Memory0; | ||
} | ||
let cachedInt32Memory0 = null; | ||
function getInt32Memory0() { | ||
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
} | ||
return cachedInt32Memory0; | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
@@ -58,18 +54,22 @@ | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
cachedTextDecoder.decode(); | ||
let cachedFloat64Memory0 = null; | ||
let cachedUint8Memory0 = null; | ||
function getUint8Memory0() { | ||
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) { | ||
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
function getFloat64Memory0() { | ||
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { | ||
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); | ||
} | ||
return cachedUint8Memory0; | ||
return cachedFloat64Memory0; | ||
} | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
let cachedInt32Memory0 = null; | ||
function getInt32Memory0() { | ||
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
} | ||
return cachedInt32Memory0; | ||
} | ||
@@ -226,2 +226,101 @@ | ||
/** | ||
* 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); | ||
}; | ||
function passArray8ToWasm0(arg, malloc) { | ||
const ptr = malloc(arg.length * 1) >>> 0; | ||
getUint8Memory0().set(arg, ptr / 1); | ||
WASM_VECTOR_LEN = arg.length; | ||
return ptr; | ||
} | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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.getReturnWitness = function(program, witness_map) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
}; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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.getPublicParametersWitness = function(program, solved_witness) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
}; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit. | ||
* @returns {WitnessMap} A witness map containing the circuit's public inputs. | ||
* @param {Uint8Array} program | ||
* @param {WitnessMap} solved_witness | ||
* @returns {WitnessMap} | ||
*/ | ||
module.exports.getPublicWitness = function(program, solved_witness) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
}; | ||
/** | ||
* Sets the package's logging level. | ||
@@ -247,8 +346,2 @@ * | ||
function passArray8ToWasm0(arg, malloc) { | ||
const ptr = malloc(arg.length * 1) >>> 0; | ||
getUint8Memory0().set(arg, ptr / 1); | ||
WASM_VECTOR_LEN = arg.length; | ||
return ptr; | ||
} | ||
/** | ||
@@ -553,95 +646,2 @@ * Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
* @returns {BuildInfo} - Information on how the installed package was built. | ||
*/ | ||
module.exports.buildInfo = function() { | ||
const ret = wasm.buildInfo(); | ||
return takeObject(ret); | ||
}; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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.getReturnWitness = function(program, witness_map) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
}; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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.getPublicParametersWitness = function(program, solved_witness) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
}; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit. | ||
* @returns {WitnessMap} A witness map containing the circuit's public inputs. | ||
* @param {Uint8Array} program | ||
* @param {WitnessMap} solved_witness | ||
* @returns {WitnessMap} | ||
*/ | ||
module.exports.getPublicWitness = function(program, solved_witness) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
}; | ||
function __wbg_adapter_76(arg0, arg1, arg2, arg3, arg4) { | ||
@@ -672,9 +672,2 @@ wasm.wasm_bindgen__convert__closures__invoke3_mut__h17fc532521b46256(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4)); | ||
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_object_drop_ref = function(arg0) { | ||
@@ -684,7 +677,17 @@ takeObject(arg0); | ||
module.exports.__wbg_new_3b3e21164d5381ca = function() { | ||
const ret = new Map(); | ||
module.exports.__wbg_constructor_f4bcf4c70838c703 = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_string_new = function(arg0, arg1) { | ||
const ret = getStringFromWasm0(arg0, arg1); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_new_e14625531a95427d = function() { | ||
const ret = new Array(); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_number_new = function(arg0) { | ||
@@ -695,4 +698,11 @@ const ret = arg0; | ||
module.exports.__wbindgen_string_new = function(arg0, arg1) { | ||
const ret = getStringFromWasm0(arg0, arg1); | ||
module.exports.__wbindgen_number_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'number' ? obj : undefined; | ||
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; | ||
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); | ||
}; | ||
module.exports.__wbg_new_3b3e21164d5381ca = function() { | ||
const ret = new Map(); | ||
return addHeapObject(ret); | ||
@@ -710,7 +720,2 @@ }; | ||
module.exports.__wbg_constructor_f4bcf4c70838c703 = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_is_array = function(arg0) { | ||
@@ -726,7 +731,2 @@ const ret = Array.isArray(getObject(arg0)); | ||
module.exports.__wbg_new_e14625531a95427d = function() { | ||
const ret = new Array(); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_new_abda76e883ba8a5f = function() { | ||
@@ -733,0 +733,0 @@ const ret = new Error(); |
{ | ||
"name": "@noir-lang/acvm_js", | ||
"version": "0.51.0-999071b.nightly", | ||
"version": "0.51.0-ae87d28.nightly", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function buildInfo(): number; | ||
export function getReturnWitness(a: number, b: number, c: number, d: number): void; | ||
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void; | ||
export function getPublicWitness(a: number, b: number, c: number, d: number): void; | ||
export function initLogLevel(a: number, b: number, c: number): void; | ||
@@ -19,6 +23,2 @@ export function executeCircuit(a: number, b: number, c: number, d: number): number; | ||
export function decompressWitnessStack(a: number, b: number, c: number): void; | ||
export function buildInfo(): number; | ||
export function getReturnWitness(a: number, b: number, c: number, d: number): void; | ||
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void; | ||
export function getPublicWitness(a: number, b: number, c: number, d: number): void; | ||
export function __wbindgen_malloc(a: number): number; | ||
@@ -25,0 +25,0 @@ export function __wbindgen_realloc(a: number, b: number, c: number): number; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
* @returns {BuildInfo} - Information on how the installed package was built. | ||
*/ | ||
export function buildInfo(): BuildInfo; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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 getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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 getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit. | ||
* @returns {WitnessMap} A witness map containing the circuit's public inputs. | ||
* @param {Uint8Array} program | ||
* @param {WitnessMap} solved_witness | ||
* @returns {WitnessMap} | ||
*/ | ||
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap; | ||
/** | ||
* Sets the package's logging level. | ||
@@ -117,71 +155,4 @@ * | ||
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; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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 getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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 getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap; | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit. | ||
* @returns {WitnessMap} A witness map containing the circuit's public inputs. | ||
* @param {Uint8Array} program | ||
* @param {WitnessMap} solved_witness | ||
* @returns {WitnessMap} | ||
*/ | ||
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap; | ||
// Map from witness index to hex string value of witness. | ||
export type WitnessMap = Map<number, string>; | ||
/** | ||
* An execution result containing two witnesses. | ||
* 1. The full solved witness of the execution. | ||
* 2. The return witness which contains the given public return values within the full witness. | ||
*/ | ||
export type SolvedAndReturnWitness = { | ||
solvedWitness: WitnessMap; | ||
returnWitness: WitnessMap; | ||
} | ||
export type ForeignCallInput = string[] | ||
export type ForeignCallOutput = string | string[] | ||
/** | ||
* A callback which performs an foreign call and returns the response. | ||
* @callback ForeignCallHandler | ||
* @param {string} name - The identifier for the type of foreign call being performed. | ||
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call. | ||
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call. | ||
*/ | ||
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>; | ||
/** | ||
* @typedef {Object} BuildInfo - Information about how the installed package was built | ||
@@ -222,2 +193,31 @@ * @property {string} gitHash - The hash of the git commit from which the package was built. | ||
// Map from witness index to hex string value of witness. | ||
export type WitnessMap = Map<number, string>; | ||
/** | ||
* An execution result containing two witnesses. | ||
* 1. The full solved witness of the execution. | ||
* 2. The return witness which contains the given public return values within the full witness. | ||
*/ | ||
export type SolvedAndReturnWitness = { | ||
solvedWitness: WitnessMap; | ||
returnWitness: WitnessMap; | ||
} | ||
export type 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; | ||
@@ -227,2 +227,6 @@ | ||
readonly memory: WebAssembly.Memory; | ||
readonly buildInfo: () => number; | ||
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void; | ||
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void; | ||
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void; | ||
readonly initLogLevel: (a: number, b: number, c: number) => void; | ||
@@ -243,6 +247,2 @@ readonly executeCircuit: (a: number, b: number, c: number, d: number) => number; | ||
readonly decompressWitnessStack: (a: number, b: number, c: number) => void; | ||
readonly buildInfo: () => number; | ||
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void; | ||
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void; | ||
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void; | ||
readonly __wbindgen_malloc: (a: number) => number; | ||
@@ -249,0 +249,0 @@ readonly __wbindgen_realloc: (a: number, b: number, c: number) => number; |
@@ -23,22 +23,18 @@ let wasm; | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); | ||
let cachedFloat64Memory0 = null; | ||
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; | ||
function getFloat64Memory0() { | ||
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { | ||
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); | ||
let cachedUint8Memory0 = null; | ||
function getUint8Memory0() { | ||
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) { | ||
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
} | ||
return cachedFloat64Memory0; | ||
return cachedUint8Memory0; | ||
} | ||
let cachedInt32Memory0 = null; | ||
function getInt32Memory0() { | ||
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
} | ||
return cachedInt32Memory0; | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
@@ -55,18 +51,22 @@ | ||
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; | ||
let cachedFloat64Memory0 = null; | ||
let cachedUint8Memory0 = null; | ||
function getUint8Memory0() { | ||
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) { | ||
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); | ||
function getFloat64Memory0() { | ||
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { | ||
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); | ||
} | ||
return cachedUint8Memory0; | ||
return cachedFloat64Memory0; | ||
} | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
let cachedInt32Memory0 = null; | ||
function getInt32Memory0() { | ||
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
} | ||
return cachedInt32Memory0; | ||
} | ||
@@ -223,2 +223,101 @@ | ||
/** | ||
* 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); | ||
} | ||
function passArray8ToWasm0(arg, malloc) { | ||
const ptr = malloc(arg.length * 1) >>> 0; | ||
getUint8Memory0().set(arg, ptr / 1); | ||
WASM_VECTOR_LEN = arg.length; | ||
return ptr; | ||
} | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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 getReturnWitness(program, witness_map) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
} | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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 getPublicParametersWitness(program, solved_witness) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
} | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit. | ||
* @returns {WitnessMap} A witness map containing the circuit's public inputs. | ||
* @param {Uint8Array} program | ||
* @param {WitnessMap} solved_witness | ||
* @returns {WitnessMap} | ||
*/ | ||
export function getPublicWitness(program, solved_witness) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
} | ||
/** | ||
* Sets the package's logging level. | ||
@@ -244,8 +343,2 @@ * | ||
function passArray8ToWasm0(arg, malloc) { | ||
const ptr = malloc(arg.length * 1) >>> 0; | ||
getUint8Memory0().set(arg, ptr / 1); | ||
WASM_VECTOR_LEN = arg.length; | ||
return ptr; | ||
} | ||
/** | ||
@@ -550,95 +643,2 @@ * Executes an ACIR circuit to generate the solved witness from the initial witness. | ||
/** | ||
* Returns the `BuildInfo` object containing information about how the installed package was built. | ||
* @returns {BuildInfo} - Information on how the installed package was built. | ||
*/ | ||
export function buildInfo() { | ||
const ret = wasm.buildInfo(); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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 getReturnWitness(program, witness_map) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
} | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} 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 getPublicParametersWitness(program, solved_witness) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
} | ||
/** | ||
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs. | ||
* | ||
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit | ||
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit. | ||
* @returns {WitnessMap} A witness map containing the circuit's public inputs. | ||
* @param {Uint8Array} program | ||
* @param {WitnessMap} solved_witness | ||
* @returns {WitnessMap} | ||
*/ | ||
export function getPublicWitness(program, solved_witness) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return takeObject(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
} | ||
function __wbg_adapter_76(arg0, arg1, arg2, arg3, arg4) { | ||
@@ -702,15 +702,17 @@ wasm.wasm_bindgen__convert__closures__invoke3_mut__h17fc532521b46256(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4)); | ||
}; | ||
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_object_drop_ref = function(arg0) { | ||
takeObject(arg0); | ||
}; | ||
imports.wbg.__wbg_new_3b3e21164d5381ca = function() { | ||
const ret = new Map(); | ||
imports.wbg.__wbg_constructor_f4bcf4c70838c703 = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_string_new = function(arg0, arg1) { | ||
const ret = getStringFromWasm0(arg0, arg1); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_new_e14625531a95427d = function() { | ||
const ret = new Array(); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_number_new = function(arg0) { | ||
@@ -720,4 +722,10 @@ const ret = arg0; | ||
}; | ||
imports.wbg.__wbindgen_string_new = function(arg0, arg1) { | ||
const ret = getStringFromWasm0(arg0, arg1); | ||
imports.wbg.__wbindgen_number_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'number' ? obj : undefined; | ||
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; | ||
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); | ||
}; | ||
imports.wbg.__wbg_new_3b3e21164d5381ca = function() { | ||
const ret = new Map(); | ||
return addHeapObject(ret); | ||
@@ -733,6 +741,2 @@ }; | ||
}; | ||
imports.wbg.__wbg_constructor_f4bcf4c70838c703 = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_is_array = function(arg0) { | ||
@@ -746,6 +750,2 @@ const ret = Array.isArray(getObject(arg0)); | ||
}; | ||
imports.wbg.__wbg_new_e14625531a95427d = function() { | ||
const ret = new Array(); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_new_abda76e883ba8a5f = function() { | ||
@@ -752,0 +752,0 @@ const ret = new Error(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4108083
3