@noir-lang/acvm_js 1.0.0-beta.2-97afa52.nightly → 1.0.0-beta.2-b7ace68.nightly
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nodejs/acvm_js.d.ts +20 -20
- package/nodejs/acvm_js.js +28 -28
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +1 -1
- package/package.json +1 -1
- package/web/acvm_js.d.ts +21 -21
- package/web/acvm_js.js +27 -27
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +1 -1
package/nodejs/acvm_js.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
+
* Sets the package's logging level.
|
|
5
|
+
*
|
|
6
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
7
|
+
*/
|
|
8
|
+
export function initLogLevel(filter: string): void;
|
|
9
|
+
/**
|
|
4
10
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
11
|
*
|
|
6
12
|
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
@@ -29,12 +35,6 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
|
|
|
29
35
|
*/
|
|
30
36
|
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
31
37
|
/**
|
|
32
|
-
* Sets the package's logging level.
|
|
33
|
-
*
|
|
34
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
35
|
-
*/
|
|
36
|
-
export function initLogLevel(filter: string): void;
|
|
37
|
-
/**
|
|
38
38
|
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
39
39
|
*
|
|
40
40
|
* @param {WitnessMap} witness_map - A witness map.
|
|
@@ -147,6 +147,20 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
|
|
|
147
147
|
*/
|
|
148
148
|
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
149
149
|
|
|
150
|
+
export type ForeignCallInput = string[]
|
|
151
|
+
export type ForeignCallOutput = string | string[]
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* A callback which performs an foreign call and returns the response.
|
|
155
|
+
* @callback ForeignCallHandler
|
|
156
|
+
* @param {string} name - The identifier for the type of foreign call being performed.
|
|
157
|
+
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
|
|
158
|
+
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
|
|
159
|
+
*/
|
|
160
|
+
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
150
164
|
// Map from witness index to hex string value of witness.
|
|
151
165
|
export type WitnessMap = Map<number, string>;
|
|
152
166
|
|
|
@@ -162,20 +176,6 @@ export type SolvedAndReturnWitness = {
|
|
|
162
176
|
|
|
163
177
|
|
|
164
178
|
|
|
165
|
-
export type ForeignCallInput = string[]
|
|
166
|
-
export type ForeignCallOutput = string | string[]
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* A callback which performs an foreign call and returns the response.
|
|
170
|
-
* @callback ForeignCallHandler
|
|
171
|
-
* @param {string} name - The identifier for the type of foreign call being performed.
|
|
172
|
-
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
|
|
173
|
-
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
|
|
174
|
-
*/
|
|
175
|
-
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
179
|
/**
|
|
180
180
|
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
181
181
|
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
package/nodejs/acvm_js.js
CHANGED
|
@@ -220,6 +220,27 @@ function __wbg_adapter_22(arg0, arg1, arg2) {
|
|
|
220
220
|
wasm.wasm_bindgen__convert__closures__invoke1_mut__hec5660d9489c77a2(arg0, arg1, addHeapObject(arg2));
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
/**
|
|
224
|
+
* Sets the package's logging level.
|
|
225
|
+
*
|
|
226
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
227
|
+
*/
|
|
228
|
+
module.exports.initLogLevel = function(filter) {
|
|
229
|
+
try {
|
|
230
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
231
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
232
|
+
const len0 = WASM_VECTOR_LEN;
|
|
233
|
+
wasm.initLogLevel(retptr, ptr0, len0);
|
|
234
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
235
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
236
|
+
if (r1) {
|
|
237
|
+
throw takeObject(r0);
|
|
238
|
+
}
|
|
239
|
+
} finally {
|
|
240
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
|
|
223
244
|
function passArray8ToWasm0(arg, malloc) {
|
|
224
245
|
const ptr = malloc(arg.length * 1) >>> 0;
|
|
225
246
|
getUint8Memory0().set(arg, ptr / 1);
|
|
@@ -272,27 +293,6 @@ module.exports.executeProgram = function(program, initial_witness, foreign_call_
|
|
|
272
293
|
return takeObject(ret);
|
|
273
294
|
};
|
|
274
295
|
|
|
275
|
-
/**
|
|
276
|
-
* Sets the package's logging level.
|
|
277
|
-
*
|
|
278
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
279
|
-
*/
|
|
280
|
-
module.exports.initLogLevel = function(filter) {
|
|
281
|
-
try {
|
|
282
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
283
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
284
|
-
const len0 = WASM_VECTOR_LEN;
|
|
285
|
-
wasm.initLogLevel(retptr, ptr0, len0);
|
|
286
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
287
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
288
|
-
if (r1) {
|
|
289
|
-
throw takeObject(r0);
|
|
290
|
-
}
|
|
291
|
-
} finally {
|
|
292
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
|
|
296
296
|
function getArrayU8FromWasm0(ptr, len) {
|
|
297
297
|
ptr = ptr >>> 0;
|
|
298
298
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
@@ -637,6 +637,11 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
|
637
637
|
takeObject(arg0);
|
|
638
638
|
};
|
|
639
639
|
|
|
640
|
+
module.exports.__wbindgen_is_string = function(arg0) {
|
|
641
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
642
|
+
return ret;
|
|
643
|
+
};
|
|
644
|
+
|
|
640
645
|
module.exports.__wbindgen_is_array = function(arg0) {
|
|
641
646
|
const ret = Array.isArray(getObject(arg0));
|
|
642
647
|
return ret;
|
|
@@ -681,11 +686,6 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
|
681
686
|
return ret;
|
|
682
687
|
};
|
|
683
688
|
|
|
684
|
-
module.exports.__wbindgen_is_string = function(arg0) {
|
|
685
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
|
686
|
-
return ret;
|
|
687
|
-
};
|
|
688
|
-
|
|
689
689
|
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
690
690
|
const obj = getObject(arg1);
|
|
691
691
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
@@ -916,8 +916,8 @@ module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
|
916
916
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
917
917
|
};
|
|
918
918
|
|
|
919
|
-
module.exports.
|
|
920
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
919
|
+
module.exports.__wbindgen_closure_wrapper782 = function(arg0, arg1, arg2) {
|
|
920
|
+
const ret = makeMutClosure(arg0, arg1, 300, __wbg_adapter_22);
|
|
921
921
|
return addHeapObject(ret);
|
|
922
922
|
};
|
|
923
923
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export function initLogLevel(a: number, b: number, c: number): void;
|
|
4
5
|
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
5
6
|
export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number;
|
|
6
7
|
export function executeProgram(a: number, b: number, c: number, d: number): number;
|
|
7
|
-
export function initLogLevel(a: number, b: number, c: number): void;
|
|
8
8
|
export function compressWitness(a: number, b: number): void;
|
|
9
9
|
export function decompressWitness(a: number, b: number, c: number): void;
|
|
10
10
|
export function compressWitnessStack(a: number, b: number): void;
|
package/package.json
CHANGED
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
+
* Sets the package's logging level.
|
|
5
|
+
*
|
|
6
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
7
|
+
*/
|
|
8
|
+
export function initLogLevel(filter: string): void;
|
|
9
|
+
/**
|
|
4
10
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
11
|
*
|
|
6
12
|
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
@@ -29,12 +35,6 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
|
|
|
29
35
|
*/
|
|
30
36
|
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
31
37
|
/**
|
|
32
|
-
* Sets the package's logging level.
|
|
33
|
-
*
|
|
34
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
35
|
-
*/
|
|
36
|
-
export function initLogLevel(filter: string): void;
|
|
37
|
-
/**
|
|
38
38
|
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
39
39
|
*
|
|
40
40
|
* @param {WitnessMap} witness_map - A witness map.
|
|
@@ -147,6 +147,20 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
|
|
|
147
147
|
*/
|
|
148
148
|
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
149
149
|
|
|
150
|
+
export type ForeignCallInput = string[]
|
|
151
|
+
export type ForeignCallOutput = string | string[]
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* A callback which performs an foreign call and returns the response.
|
|
155
|
+
* @callback ForeignCallHandler
|
|
156
|
+
* @param {string} name - The identifier for the type of foreign call being performed.
|
|
157
|
+
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
|
|
158
|
+
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
|
|
159
|
+
*/
|
|
160
|
+
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
150
164
|
// Map from witness index to hex string value of witness.
|
|
151
165
|
export type WitnessMap = Map<number, string>;
|
|
152
166
|
|
|
@@ -162,20 +176,6 @@ export type SolvedAndReturnWitness = {
|
|
|
162
176
|
|
|
163
177
|
|
|
164
178
|
|
|
165
|
-
export type ForeignCallInput = string[]
|
|
166
|
-
export type ForeignCallOutput = string | string[]
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* A callback which performs an foreign call and returns the response.
|
|
170
|
-
* @callback ForeignCallHandler
|
|
171
|
-
* @param {string} name - The identifier for the type of foreign call being performed.
|
|
172
|
-
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
|
|
173
|
-
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
|
|
174
|
-
*/
|
|
175
|
-
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
179
|
/**
|
|
180
180
|
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
181
181
|
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
@@ -216,10 +216,10 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
216
216
|
|
|
217
217
|
export interface InitOutput {
|
|
218
218
|
readonly memory: WebAssembly.Memory;
|
|
219
|
+
readonly initLogLevel: (a: number, b: number, c: number) => void;
|
|
219
220
|
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
|
|
220
221
|
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: number, d: number) => number;
|
|
221
222
|
readonly executeProgram: (a: number, b: number, c: number, d: number) => number;
|
|
222
|
-
readonly initLogLevel: (a: number, b: number, c: number) => void;
|
|
223
223
|
readonly compressWitness: (a: number, b: number) => void;
|
|
224
224
|
readonly decompressWitness: (a: number, b: number, c: number) => void;
|
|
225
225
|
readonly compressWitnessStack: (a: number, b: number) => void;
|
package/web/acvm_js.js
CHANGED
|
@@ -217,6 +217,27 @@ function __wbg_adapter_22(arg0, arg1, arg2) {
|
|
|
217
217
|
wasm.wasm_bindgen__convert__closures__invoke1_mut__hec5660d9489c77a2(arg0, arg1, addHeapObject(arg2));
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
+
/**
|
|
221
|
+
* Sets the package's logging level.
|
|
222
|
+
*
|
|
223
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
224
|
+
*/
|
|
225
|
+
export function initLogLevel(filter) {
|
|
226
|
+
try {
|
|
227
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
228
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
229
|
+
const len0 = WASM_VECTOR_LEN;
|
|
230
|
+
wasm.initLogLevel(retptr, ptr0, len0);
|
|
231
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
232
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
233
|
+
if (r1) {
|
|
234
|
+
throw takeObject(r0);
|
|
235
|
+
}
|
|
236
|
+
} finally {
|
|
237
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
220
241
|
function passArray8ToWasm0(arg, malloc) {
|
|
221
242
|
const ptr = malloc(arg.length * 1) >>> 0;
|
|
222
243
|
getUint8Memory0().set(arg, ptr / 1);
|
|
@@ -269,27 +290,6 @@ export function executeProgram(program, initial_witness, foreign_call_handler) {
|
|
|
269
290
|
return takeObject(ret);
|
|
270
291
|
}
|
|
271
292
|
|
|
272
|
-
/**
|
|
273
|
-
* Sets the package's logging level.
|
|
274
|
-
*
|
|
275
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
276
|
-
*/
|
|
277
|
-
export function initLogLevel(filter) {
|
|
278
|
-
try {
|
|
279
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
280
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
281
|
-
const len0 = WASM_VECTOR_LEN;
|
|
282
|
-
wasm.initLogLevel(retptr, ptr0, len0);
|
|
283
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
284
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
285
|
-
if (r1) {
|
|
286
|
-
throw takeObject(r0);
|
|
287
|
-
}
|
|
288
|
-
} finally {
|
|
289
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
293
|
function getArrayU8FromWasm0(ptr, len) {
|
|
294
294
|
ptr = ptr >>> 0;
|
|
295
295
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
@@ -667,6 +667,10 @@ function __wbg_get_imports() {
|
|
|
667
667
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
668
668
|
takeObject(arg0);
|
|
669
669
|
};
|
|
670
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
671
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
672
|
+
return ret;
|
|
673
|
+
};
|
|
670
674
|
imports.wbg.__wbindgen_is_array = function(arg0) {
|
|
671
675
|
const ret = Array.isArray(getObject(arg0));
|
|
672
676
|
return ret;
|
|
@@ -704,10 +708,6 @@ function __wbg_get_imports() {
|
|
|
704
708
|
const ret = false;
|
|
705
709
|
return ret;
|
|
706
710
|
};
|
|
707
|
-
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
708
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
|
709
|
-
return ret;
|
|
710
|
-
};
|
|
711
711
|
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
712
712
|
const obj = getObject(arg1);
|
|
713
713
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
@@ -901,8 +901,8 @@ function __wbg_get_imports() {
|
|
|
901
901
|
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
902
902
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
903
903
|
};
|
|
904
|
-
imports.wbg.
|
|
905
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
904
|
+
imports.wbg.__wbindgen_closure_wrapper782 = function(arg0, arg1, arg2) {
|
|
905
|
+
const ret = makeMutClosure(arg0, arg1, 300, __wbg_adapter_22);
|
|
906
906
|
return addHeapObject(ret);
|
|
907
907
|
};
|
|
908
908
|
|
package/web/acvm_js_bg.wasm
CHANGED
|
Binary file
|
package/web/acvm_js_bg.wasm.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export function initLogLevel(a: number, b: number, c: number): void;
|
|
4
5
|
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
5
6
|
export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number;
|
|
6
7
|
export function executeProgram(a: number, b: number, c: number, d: number): number;
|
|
7
|
-
export function initLogLevel(a: number, b: number, c: number): void;
|
|
8
8
|
export function compressWitness(a: number, b: number): void;
|
|
9
9
|
export function decompressWitness(a: number, b: number, c: number): void;
|
|
10
10
|
export function compressWitnessStack(a: number, b: number): void;
|