@noir-lang/acvm_js 0.39.0 → 0.40.0-16d5f18.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 +48 -48
- package/nodejs/acvm_js.js +192 -183
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +7 -7
- package/package.json +2 -2
- package/web/acvm_js.d.ts +55 -55
- package/web/acvm_js.js +184 -175
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +7 -7
package/nodejs/acvm_js.d.ts
CHANGED
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
5
|
+
*
|
|
6
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
7
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
8
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
9
|
+
* @param {Uint8Array} circuit
|
|
10
|
+
* @param {WitnessMap} solved_witness
|
|
11
|
+
* @returns {WitnessMap}
|
|
12
|
+
*/
|
|
13
|
+
export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
14
|
+
/**
|
|
15
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
16
|
+
*
|
|
17
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
18
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
19
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
20
|
+
* @param {Uint8Array} circuit
|
|
21
|
+
* @param {WitnessMap} solved_witness
|
|
22
|
+
* @returns {WitnessMap}
|
|
23
|
+
*/
|
|
24
|
+
export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
25
|
+
/**
|
|
26
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
27
|
+
*
|
|
28
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
29
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
30
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
31
|
+
* @param {Uint8Array} circuit
|
|
32
|
+
* @param {WitnessMap} witness_map
|
|
33
|
+
* @returns {WitnessMap}
|
|
34
|
+
*/
|
|
35
|
+
export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
36
|
+
/**
|
|
4
37
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
38
|
*
|
|
6
39
|
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
@@ -24,6 +57,12 @@ export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap,
|
|
|
24
57
|
*/
|
|
25
58
|
export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
|
|
26
59
|
/**
|
|
60
|
+
* Sets the package's logging level.
|
|
61
|
+
*
|
|
62
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
63
|
+
*/
|
|
64
|
+
export function initLogLevel(filter: string): void;
|
|
65
|
+
/**
|
|
27
66
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
28
67
|
* @param {Uint8Array} hashed_msg
|
|
29
68
|
* @param {Uint8Array} public_key_x_bytes
|
|
@@ -74,11 +113,10 @@ export function xor(lhs: string, rhs: string): string;
|
|
|
74
113
|
*/
|
|
75
114
|
export function and(lhs: string, rhs: string): string;
|
|
76
115
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
116
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
117
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
80
118
|
*/
|
|
81
|
-
export function
|
|
119
|
+
export function buildInfo(): BuildInfo;
|
|
82
120
|
/**
|
|
83
121
|
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
84
122
|
*
|
|
@@ -93,56 +131,12 @@ export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
|
93
131
|
* @returns {WitnessMap} A compressed witness map
|
|
94
132
|
*/
|
|
95
133
|
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
96
|
-
/**
|
|
97
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
98
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
99
|
-
*/
|
|
100
|
-
export function buildInfo(): BuildInfo;
|
|
101
|
-
/**
|
|
102
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
103
|
-
*
|
|
104
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
105
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
106
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
107
|
-
* @param {Uint8Array} circuit
|
|
108
|
-
* @param {WitnessMap} solved_witness
|
|
109
|
-
* @returns {WitnessMap}
|
|
110
|
-
*/
|
|
111
|
-
export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
112
|
-
/**
|
|
113
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
114
|
-
*
|
|
115
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
116
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
117
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
118
|
-
* @param {Uint8Array} circuit
|
|
119
|
-
* @param {WitnessMap} solved_witness
|
|
120
|
-
* @returns {WitnessMap}
|
|
121
|
-
*/
|
|
122
|
-
export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
123
|
-
/**
|
|
124
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
125
|
-
*
|
|
126
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
127
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
128
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
129
|
-
* @param {Uint8Array} circuit
|
|
130
|
-
* @param {WitnessMap} witness_map
|
|
131
|
-
* @returns {WitnessMap}
|
|
132
|
-
*/
|
|
133
|
-
export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
134
134
|
|
|
135
135
|
// Map from witness index to hex string value of witness.
|
|
136
136
|
export type WitnessMap = Map<number, string>;
|
|
137
137
|
|
|
138
138
|
|
|
139
139
|
|
|
140
|
-
export type ExecutionError = Error & {
|
|
141
|
-
callStack?: string[];
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
140
|
export type ForeignCallInput = string[]
|
|
147
141
|
export type ForeignCallOutput = string | string[]
|
|
148
142
|
|
|
@@ -170,6 +164,12 @@ export type BuildInfo = {
|
|
|
170
164
|
}
|
|
171
165
|
|
|
172
166
|
|
|
167
|
+
|
|
168
|
+
export type ExecutionError = Error & {
|
|
169
|
+
callStack?: string[];
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
|
|
173
173
|
/**
|
|
174
174
|
*/
|
|
175
175
|
export class WasmBlackBoxFunctionSolver {
|
package/nodejs/acvm_js.js
CHANGED
|
@@ -50,28 +50,6 @@ function addHeapObject(obj) {
|
|
|
50
50
|
return idx;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
function isLikeNone(x) {
|
|
54
|
-
return x === undefined || x === null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
let cachedFloat64Memory0 = null;
|
|
58
|
-
|
|
59
|
-
function getFloat64Memory0() {
|
|
60
|
-
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
61
|
-
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
62
|
-
}
|
|
63
|
-
return cachedFloat64Memory0;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
let cachedInt32Memory0 = null;
|
|
67
|
-
|
|
68
|
-
function getInt32Memory0() {
|
|
69
|
-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
70
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
71
|
-
}
|
|
72
|
-
return cachedInt32Memory0;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
53
|
let WASM_VECTOR_LEN = 0;
|
|
76
54
|
|
|
77
55
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
@@ -127,6 +105,28 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
127
105
|
return ptr;
|
|
128
106
|
}
|
|
129
107
|
|
|
108
|
+
function isLikeNone(x) {
|
|
109
|
+
return x === undefined || x === null;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
let cachedInt32Memory0 = null;
|
|
113
|
+
|
|
114
|
+
function getInt32Memory0() {
|
|
115
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
116
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
117
|
+
}
|
|
118
|
+
return cachedInt32Memory0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let cachedFloat64Memory0 = null;
|
|
122
|
+
|
|
123
|
+
function getFloat64Memory0() {
|
|
124
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
125
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
126
|
+
}
|
|
127
|
+
return cachedFloat64Memory0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
130
|
let cachedBigInt64Memory0 = null;
|
|
131
131
|
|
|
132
132
|
function getBigInt64Memory0() {
|
|
@@ -226,14 +226,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
226
226
|
return real;
|
|
227
227
|
}
|
|
228
228
|
function __wbg_adapter_52(arg0, arg1, arg2) {
|
|
229
|
-
wasm.
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
function _assertClass(instance, klass) {
|
|
233
|
-
if (!(instance instanceof klass)) {
|
|
234
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
235
|
-
}
|
|
236
|
-
return instance.ptr;
|
|
229
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hfdf1d0fa4debaf70(arg0, arg1, addHeapObject(arg2));
|
|
237
230
|
}
|
|
238
231
|
|
|
239
232
|
function passArray8ToWasm0(arg, malloc) {
|
|
@@ -243,6 +236,96 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
243
236
|
return ptr;
|
|
244
237
|
}
|
|
245
238
|
/**
|
|
239
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
240
|
+
*
|
|
241
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
242
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
243
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
244
|
+
* @param {Uint8Array} circuit
|
|
245
|
+
* @param {WitnessMap} solved_witness
|
|
246
|
+
* @returns {WitnessMap}
|
|
247
|
+
*/
|
|
248
|
+
module.exports.getPublicWitness = function(circuit, solved_witness) {
|
|
249
|
+
try {
|
|
250
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
251
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
252
|
+
const len0 = WASM_VECTOR_LEN;
|
|
253
|
+
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
254
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
255
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
256
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
257
|
+
if (r2) {
|
|
258
|
+
throw takeObject(r1);
|
|
259
|
+
}
|
|
260
|
+
return takeObject(r0);
|
|
261
|
+
} finally {
|
|
262
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
268
|
+
*
|
|
269
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
270
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
271
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
272
|
+
* @param {Uint8Array} circuit
|
|
273
|
+
* @param {WitnessMap} solved_witness
|
|
274
|
+
* @returns {WitnessMap}
|
|
275
|
+
*/
|
|
276
|
+
module.exports.getPublicParametersWitness = function(circuit, solved_witness) {
|
|
277
|
+
try {
|
|
278
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
279
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
280
|
+
const len0 = WASM_VECTOR_LEN;
|
|
281
|
+
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
282
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
283
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
284
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
285
|
+
if (r2) {
|
|
286
|
+
throw takeObject(r1);
|
|
287
|
+
}
|
|
288
|
+
return takeObject(r0);
|
|
289
|
+
} finally {
|
|
290
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
296
|
+
*
|
|
297
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
298
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
299
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
300
|
+
* @param {Uint8Array} circuit
|
|
301
|
+
* @param {WitnessMap} witness_map
|
|
302
|
+
* @returns {WitnessMap}
|
|
303
|
+
*/
|
|
304
|
+
module.exports.getReturnWitness = function(circuit, witness_map) {
|
|
305
|
+
try {
|
|
306
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
307
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
308
|
+
const len0 = WASM_VECTOR_LEN;
|
|
309
|
+
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
310
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
311
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
312
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
313
|
+
if (r2) {
|
|
314
|
+
throw takeObject(r1);
|
|
315
|
+
}
|
|
316
|
+
return takeObject(r0);
|
|
317
|
+
} finally {
|
|
318
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
function _assertClass(instance, klass) {
|
|
323
|
+
if (!(instance instanceof klass)) {
|
|
324
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
325
|
+
}
|
|
326
|
+
return instance.ptr;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
246
329
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
247
330
|
*
|
|
248
331
|
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
@@ -282,6 +365,27 @@ module.exports.createBlackBoxSolver = function() {
|
|
|
282
365
|
return takeObject(ret);
|
|
283
366
|
};
|
|
284
367
|
|
|
368
|
+
/**
|
|
369
|
+
* Sets the package's logging level.
|
|
370
|
+
*
|
|
371
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
372
|
+
*/
|
|
373
|
+
module.exports.initLogLevel = function(filter) {
|
|
374
|
+
try {
|
|
375
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
376
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
377
|
+
const len0 = WASM_VECTOR_LEN;
|
|
378
|
+
wasm.initLogLevel(retptr, ptr0, len0);
|
|
379
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
380
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
381
|
+
if (r1) {
|
|
382
|
+
throw takeObject(r0);
|
|
383
|
+
}
|
|
384
|
+
} finally {
|
|
385
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
|
|
285
389
|
/**
|
|
286
390
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
287
391
|
* @param {Uint8Array} hashed_msg
|
|
@@ -414,14 +518,12 @@ module.exports.and = function(lhs, rhs) {
|
|
|
414
518
|
};
|
|
415
519
|
|
|
416
520
|
/**
|
|
417
|
-
*
|
|
418
|
-
*
|
|
419
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
521
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
522
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
420
523
|
*/
|
|
421
|
-
module.exports.
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
wasm.initLogLevel(ptr0, len0);
|
|
524
|
+
module.exports.buildInfo = function() {
|
|
525
|
+
const ret = wasm.buildInfo();
|
|
526
|
+
return takeObject(ret);
|
|
425
527
|
};
|
|
426
528
|
|
|
427
529
|
/**
|
|
@@ -473,99 +575,6 @@ module.exports.compressWitness = function(witness_map) {
|
|
|
473
575
|
}
|
|
474
576
|
};
|
|
475
577
|
|
|
476
|
-
/**
|
|
477
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
478
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
479
|
-
*/
|
|
480
|
-
module.exports.buildInfo = function() {
|
|
481
|
-
const ret = wasm.buildInfo();
|
|
482
|
-
return takeObject(ret);
|
|
483
|
-
};
|
|
484
|
-
|
|
485
|
-
/**
|
|
486
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
487
|
-
*
|
|
488
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
489
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
490
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
491
|
-
* @param {Uint8Array} circuit
|
|
492
|
-
* @param {WitnessMap} solved_witness
|
|
493
|
-
* @returns {WitnessMap}
|
|
494
|
-
*/
|
|
495
|
-
module.exports.getPublicWitness = function(circuit, solved_witness) {
|
|
496
|
-
try {
|
|
497
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
498
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
499
|
-
const len0 = WASM_VECTOR_LEN;
|
|
500
|
-
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
501
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
502
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
503
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
504
|
-
if (r2) {
|
|
505
|
-
throw takeObject(r1);
|
|
506
|
-
}
|
|
507
|
-
return takeObject(r0);
|
|
508
|
-
} finally {
|
|
509
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
510
|
-
}
|
|
511
|
-
};
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
515
|
-
*
|
|
516
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
517
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
518
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
519
|
-
* @param {Uint8Array} circuit
|
|
520
|
-
* @param {WitnessMap} solved_witness
|
|
521
|
-
* @returns {WitnessMap}
|
|
522
|
-
*/
|
|
523
|
-
module.exports.getPublicParametersWitness = function(circuit, solved_witness) {
|
|
524
|
-
try {
|
|
525
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
526
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
527
|
-
const len0 = WASM_VECTOR_LEN;
|
|
528
|
-
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
529
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
530
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
531
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
532
|
-
if (r2) {
|
|
533
|
-
throw takeObject(r1);
|
|
534
|
-
}
|
|
535
|
-
return takeObject(r0);
|
|
536
|
-
} finally {
|
|
537
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
538
|
-
}
|
|
539
|
-
};
|
|
540
|
-
|
|
541
|
-
/**
|
|
542
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
543
|
-
*
|
|
544
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
545
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
546
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
547
|
-
* @param {Uint8Array} circuit
|
|
548
|
-
* @param {WitnessMap} witness_map
|
|
549
|
-
* @returns {WitnessMap}
|
|
550
|
-
*/
|
|
551
|
-
module.exports.getReturnWitness = function(circuit, witness_map) {
|
|
552
|
-
try {
|
|
553
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
554
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
555
|
-
const len0 = WASM_VECTOR_LEN;
|
|
556
|
-
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
557
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
558
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
559
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
560
|
-
if (r2) {
|
|
561
|
-
throw takeObject(r1);
|
|
562
|
-
}
|
|
563
|
-
return takeObject(r0);
|
|
564
|
-
} finally {
|
|
565
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
566
|
-
}
|
|
567
|
-
};
|
|
568
|
-
|
|
569
578
|
function handleError(f, args) {
|
|
570
579
|
try {
|
|
571
580
|
return f.apply(this, args);
|
|
@@ -574,7 +583,7 @@ function handleError(f, args) {
|
|
|
574
583
|
}
|
|
575
584
|
}
|
|
576
585
|
function __wbg_adapter_159(arg0, arg1, arg2, arg3) {
|
|
577
|
-
wasm.
|
|
586
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h79f8a29187e94f15(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
578
587
|
}
|
|
579
588
|
|
|
580
589
|
/**
|
|
@@ -632,44 +641,42 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
|
632
641
|
takeObject(arg0);
|
|
633
642
|
};
|
|
634
643
|
|
|
635
|
-
module.exports.
|
|
636
|
-
const ret =
|
|
644
|
+
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
645
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
637
646
|
return addHeapObject(ret);
|
|
638
647
|
};
|
|
639
648
|
|
|
640
|
-
module.exports.
|
|
641
|
-
const ret =
|
|
642
|
-
return ret;
|
|
643
|
-
};
|
|
644
|
-
|
|
645
|
-
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
646
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
649
|
+
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
650
|
+
const ret = getObject(arg0);
|
|
647
651
|
return addHeapObject(ret);
|
|
648
652
|
};
|
|
649
653
|
|
|
650
|
-
module.exports.
|
|
651
|
-
const obj =
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
654
|
+
module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
655
|
+
const obj = takeObject(arg0).original;
|
|
656
|
+
if (obj.cnt-- == 1) {
|
|
657
|
+
obj.a = 0;
|
|
658
|
+
return true;
|
|
659
|
+
}
|
|
660
|
+
const ret = false;
|
|
661
|
+
return ret;
|
|
655
662
|
};
|
|
656
663
|
|
|
657
|
-
module.exports.
|
|
658
|
-
const ret =
|
|
664
|
+
module.exports.__wbg_wasmblackboxfunctionsolver_new = function(arg0) {
|
|
665
|
+
const ret = WasmBlackBoxFunctionSolver.__wrap(arg0);
|
|
659
666
|
return addHeapObject(ret);
|
|
660
667
|
};
|
|
661
668
|
|
|
662
|
-
module.exports.
|
|
663
|
-
const ret =
|
|
664
|
-
return
|
|
669
|
+
module.exports.__wbindgen_is_array = function(arg0) {
|
|
670
|
+
const ret = Array.isArray(getObject(arg0));
|
|
671
|
+
return ret;
|
|
665
672
|
};
|
|
666
673
|
|
|
667
|
-
module.exports.
|
|
668
|
-
const ret =
|
|
669
|
-
return ret;
|
|
674
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
675
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
676
|
+
return addHeapObject(ret);
|
|
670
677
|
};
|
|
671
678
|
|
|
672
|
-
module.exports.
|
|
679
|
+
module.exports.__wbg_new_12499e712355d566 = function() {
|
|
673
680
|
const ret = new Map();
|
|
674
681
|
return addHeapObject(ret);
|
|
675
682
|
};
|
|
@@ -688,21 +695,23 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
|
688
695
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
689
696
|
};
|
|
690
697
|
|
|
691
|
-
module.exports.
|
|
692
|
-
const obj = takeObject(arg0).original;
|
|
693
|
-
if (obj.cnt-- == 1) {
|
|
694
|
-
obj.a = 0;
|
|
695
|
-
return true;
|
|
696
|
-
}
|
|
697
|
-
const ret = false;
|
|
698
|
-
return ret;
|
|
699
|
-
};
|
|
700
|
-
|
|
701
|
-
module.exports.__wbg_constructor_6648e7ae005cd460 = function(arg0) {
|
|
698
|
+
module.exports.__wbg_constructor_8444207292d12e94 = function(arg0) {
|
|
702
699
|
const ret = new Error(takeObject(arg0));
|
|
703
700
|
return addHeapObject(ret);
|
|
704
701
|
};
|
|
705
702
|
|
|
703
|
+
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
704
|
+
const obj = getObject(arg1);
|
|
705
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
706
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
707
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
708
|
+
};
|
|
709
|
+
|
|
710
|
+
module.exports.__wbindgen_is_string = function(arg0) {
|
|
711
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
712
|
+
return ret;
|
|
713
|
+
};
|
|
714
|
+
|
|
706
715
|
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
707
716
|
const ret = getObject(arg0) === undefined;
|
|
708
717
|
return ret;
|
|
@@ -768,14 +777,9 @@ module.exports.__wbindgen_is_bigint = function(arg0) {
|
|
|
768
777
|
return ret;
|
|
769
778
|
};
|
|
770
779
|
|
|
771
|
-
module.exports.
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
result = getObject(arg0) instanceof WebAssembly.Global;
|
|
775
|
-
} catch {
|
|
776
|
-
result = false;
|
|
777
|
-
}
|
|
778
|
-
const ret = result;
|
|
780
|
+
module.exports.__wbindgen_is_object = function(arg0) {
|
|
781
|
+
const val = getObject(arg0);
|
|
782
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
779
783
|
return ret;
|
|
780
784
|
};
|
|
781
785
|
|
|
@@ -784,9 +788,14 @@ module.exports.__wbindgen_is_function = function(arg0) {
|
|
|
784
788
|
return ret;
|
|
785
789
|
};
|
|
786
790
|
|
|
787
|
-
module.exports.
|
|
788
|
-
|
|
789
|
-
|
|
791
|
+
module.exports.__wbg_instanceof_Global_1c3b64df1a5c886c = function(arg0) {
|
|
792
|
+
let result;
|
|
793
|
+
try {
|
|
794
|
+
result = getObject(arg0) instanceof WebAssembly.Global;
|
|
795
|
+
} catch {
|
|
796
|
+
result = false;
|
|
797
|
+
}
|
|
798
|
+
const ret = result;
|
|
790
799
|
return ret;
|
|
791
800
|
};
|
|
792
801
|
|
|
@@ -1120,6 +1129,11 @@ module.exports.__wbg_subarray_d82be056deb4ad27 = function(arg0, arg1, arg2) {
|
|
|
1120
1129
|
return addHeapObject(ret);
|
|
1121
1130
|
};
|
|
1122
1131
|
|
|
1132
|
+
module.exports.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {
|
|
1133
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
1134
|
+
return addHeapObject(ret);
|
|
1135
|
+
}, arguments) };
|
|
1136
|
+
|
|
1123
1137
|
module.exports.__wbg_compile_eefe73dfb19bff3d = function(arg0) {
|
|
1124
1138
|
const ret = WebAssembly.compile(getObject(arg0));
|
|
1125
1139
|
return addHeapObject(ret);
|
|
@@ -1187,11 +1201,6 @@ module.exports.__wbg_set_07da13cc24b69217 = function() { return handleError(func
|
|
|
1187
1201
|
return ret;
|
|
1188
1202
|
}, arguments) };
|
|
1189
1203
|
|
|
1190
|
-
module.exports.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {
|
|
1191
|
-
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
1192
|
-
return addHeapObject(ret);
|
|
1193
|
-
}, arguments) };
|
|
1194
|
-
|
|
1195
1204
|
module.exports.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
|
|
1196
1205
|
const v = getObject(arg1);
|
|
1197
1206
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
@@ -1221,8 +1230,8 @@ module.exports.__wbindgen_function_table = function() {
|
|
|
1221
1230
|
return addHeapObject(ret);
|
|
1222
1231
|
};
|
|
1223
1232
|
|
|
1224
|
-
module.exports.
|
|
1225
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1233
|
+
module.exports.__wbindgen_closure_wrapper1374 = function(arg0, arg1, arg2) {
|
|
1234
|
+
const ret = makeMutClosure(arg0, arg1, 483, __wbg_adapter_52);
|
|
1226
1235
|
return addHeapObject(ret);
|
|
1227
1236
|
};
|
|
1228
1237
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
5
|
+
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
6
|
+
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
4
7
|
export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
|
|
5
8
|
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
6
9
|
export function createBlackBoxSolver(): number;
|
|
7
10
|
export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
|
|
11
|
+
export function initLogLevel(a: number, b: number, c: number): void;
|
|
8
12
|
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
9
13
|
export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
10
14
|
export function keccak256(a: number, b: number, c: number): void;
|
|
@@ -12,20 +16,16 @@ export function blake2s256(a: number, b: number, c: number): void;
|
|
|
12
16
|
export function sha256(a: number, b: number, c: number): void;
|
|
13
17
|
export function xor(a: number, b: number): number;
|
|
14
18
|
export function and(a: number, b: number): number;
|
|
15
|
-
export function
|
|
19
|
+
export function buildInfo(): number;
|
|
16
20
|
export function decompressWitness(a: number, b: number, c: number): void;
|
|
17
21
|
export function compressWitness(a: number, b: number): void;
|
|
18
|
-
export function buildInfo(): number;
|
|
19
|
-
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
20
|
-
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
21
|
-
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
22
22
|
export function __wbg_trap_free(a: number): void;
|
|
23
23
|
export function trap___wbg_wasmer_trap(): void;
|
|
24
24
|
export function __wbindgen_malloc(a: number): number;
|
|
25
25
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
26
26
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
27
|
-
export function
|
|
27
|
+
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hfdf1d0fa4debaf70(a: number, b: number, c: number): void;
|
|
28
28
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
29
29
|
export function __wbindgen_free(a: number, b: number): void;
|
|
30
30
|
export function __wbindgen_exn_store(a: number): void;
|
|
31
|
-
export function
|
|
31
|
+
export function wasm_bindgen__convert__closures__invoke2_mut__h79f8a29187e94f15(a: number, b: number, c: number, d: number): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noir-lang/acvm_js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0-16d5f18.nightly",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@web/test-runner": "^0.15.3",
|
|
45
45
|
"@web/test-runner-playwright": "^0.10.0",
|
|
46
46
|
"chai": "^4.3.7",
|
|
47
|
-
"eslint": "^8.
|
|
47
|
+
"eslint": "^8.56.0",
|
|
48
48
|
"eslint-plugin-prettier": "^5.0.0",
|
|
49
49
|
"mocha": "^10.2.0",
|
|
50
50
|
"prettier": "3.0.3",
|