@noir-lang/acvm_js 0.30.0 → 0.31.0
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 +81 -81
- package/nodejs/acvm_js.js +238 -238
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +12 -12
- package/package.json +1 -1
- package/web/acvm_js.d.ts +93 -93
- package/web/acvm_js.js +229 -229
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +12 -12
package/web/acvm_js.js
CHANGED
|
@@ -20,9 +20,7 @@ function takeObject(idx) {
|
|
|
20
20
|
return ret;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
23
|
+
let WASM_VECTOR_LEN = 0;
|
|
26
24
|
|
|
27
25
|
let cachedUint8Memory0 = null;
|
|
28
26
|
|
|
@@ -33,44 +31,6 @@ function getUint8Memory0() {
|
|
|
33
31
|
return cachedUint8Memory0;
|
|
34
32
|
}
|
|
35
33
|
|
|
36
|
-
function getStringFromWasm0(ptr, len) {
|
|
37
|
-
ptr = ptr >>> 0;
|
|
38
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function addHeapObject(obj) {
|
|
42
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
43
|
-
const idx = heap_next;
|
|
44
|
-
heap_next = heap[idx];
|
|
45
|
-
|
|
46
|
-
heap[idx] = obj;
|
|
47
|
-
return idx;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function isLikeNone(x) {
|
|
51
|
-
return x === undefined || x === null;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
let cachedFloat64Memory0 = null;
|
|
55
|
-
|
|
56
|
-
function getFloat64Memory0() {
|
|
57
|
-
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
58
|
-
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
59
|
-
}
|
|
60
|
-
return cachedFloat64Memory0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
let cachedInt32Memory0 = null;
|
|
64
|
-
|
|
65
|
-
function getInt32Memory0() {
|
|
66
|
-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
67
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
68
|
-
}
|
|
69
|
-
return cachedInt32Memory0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
let WASM_VECTOR_LEN = 0;
|
|
73
|
-
|
|
74
34
|
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
75
35
|
|
|
76
36
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -124,6 +84,46 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
124
84
|
return ptr;
|
|
125
85
|
}
|
|
126
86
|
|
|
87
|
+
function isLikeNone(x) {
|
|
88
|
+
return x === undefined || x === null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
let cachedInt32Memory0 = null;
|
|
92
|
+
|
|
93
|
+
function getInt32Memory0() {
|
|
94
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
95
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
96
|
+
}
|
|
97
|
+
return cachedInt32Memory0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function addHeapObject(obj) {
|
|
101
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
102
|
+
const idx = heap_next;
|
|
103
|
+
heap_next = heap[idx];
|
|
104
|
+
|
|
105
|
+
heap[idx] = obj;
|
|
106
|
+
return idx;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
let cachedFloat64Memory0 = null;
|
|
110
|
+
|
|
111
|
+
function getFloat64Memory0() {
|
|
112
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
113
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
114
|
+
}
|
|
115
|
+
return cachedFloat64Memory0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
119
|
+
|
|
120
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
121
|
+
|
|
122
|
+
function getStringFromWasm0(ptr, len) {
|
|
123
|
+
ptr = ptr >>> 0;
|
|
124
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
127
|
let cachedBigInt64Memory0 = null;
|
|
128
128
|
|
|
129
129
|
function getBigInt64Memory0() {
|
|
@@ -223,7 +223,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
223
223
|
return real;
|
|
224
224
|
}
|
|
225
225
|
function __wbg_adapter_54(arg0, arg1, arg2) {
|
|
226
|
-
wasm.
|
|
226
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3d2354449e918783(arg0, arg1, addHeapObject(arg2));
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
function passArray8ToWasm0(arg, malloc) {
|
|
@@ -233,17 +233,21 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
233
233
|
return ptr;
|
|
234
234
|
}
|
|
235
235
|
/**
|
|
236
|
-
*
|
|
236
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
237
237
|
*
|
|
238
|
-
* @param {Uint8Array}
|
|
239
|
-
* @
|
|
238
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
239
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
240
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
241
|
+
* @param {Uint8Array} circuit
|
|
242
|
+
* @param {WitnessMap} solved_witness
|
|
243
|
+
* @returns {WitnessMap}
|
|
240
244
|
*/
|
|
241
|
-
export function
|
|
245
|
+
export function getPublicWitness(circuit, solved_witness) {
|
|
242
246
|
try {
|
|
243
247
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
244
|
-
const ptr0 = passArray8ToWasm0(
|
|
248
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
245
249
|
const len0 = WASM_VECTOR_LEN;
|
|
246
|
-
wasm.
|
|
250
|
+
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
247
251
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
248
252
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
249
253
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -256,35 +260,117 @@ export function decompressWitness(compressed_witness) {
|
|
|
256
260
|
}
|
|
257
261
|
}
|
|
258
262
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
263
|
+
/**
|
|
264
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
265
|
+
*
|
|
266
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
267
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
268
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
269
|
+
* @param {Uint8Array} circuit
|
|
270
|
+
* @param {WitnessMap} solved_witness
|
|
271
|
+
* @returns {WitnessMap}
|
|
272
|
+
*/
|
|
273
|
+
export function getPublicParametersWitness(circuit, solved_witness) {
|
|
274
|
+
try {
|
|
275
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
276
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
277
|
+
const len0 = WASM_VECTOR_LEN;
|
|
278
|
+
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
279
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
280
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
281
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
282
|
+
if (r2) {
|
|
283
|
+
throw takeObject(r1);
|
|
284
|
+
}
|
|
285
|
+
return takeObject(r0);
|
|
286
|
+
} finally {
|
|
287
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
288
|
+
}
|
|
262
289
|
}
|
|
290
|
+
|
|
263
291
|
/**
|
|
264
|
-
*
|
|
292
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
265
293
|
*
|
|
266
|
-
* @param {Uint8Array}
|
|
267
|
-
* @
|
|
294
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
295
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
296
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
297
|
+
* @param {Uint8Array} circuit
|
|
298
|
+
* @param {WitnessMap} witness_map
|
|
299
|
+
* @returns {WitnessMap}
|
|
268
300
|
*/
|
|
269
|
-
export function
|
|
301
|
+
export function getReturnWitness(circuit, witness_map) {
|
|
270
302
|
try {
|
|
271
303
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
272
|
-
|
|
304
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
305
|
+
const len0 = WASM_VECTOR_LEN;
|
|
306
|
+
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
273
307
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
274
308
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
275
309
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
throw takeObject(r2);
|
|
310
|
+
if (r2) {
|
|
311
|
+
throw takeObject(r1);
|
|
279
312
|
}
|
|
280
|
-
|
|
281
|
-
wasm.__wbindgen_free(r0, r1 * 1);
|
|
282
|
-
return v1;
|
|
313
|
+
return takeObject(r0);
|
|
283
314
|
} finally {
|
|
284
315
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
285
316
|
}
|
|
286
317
|
}
|
|
287
318
|
|
|
319
|
+
function _assertClass(instance, klass) {
|
|
320
|
+
if (!(instance instanceof klass)) {
|
|
321
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
322
|
+
}
|
|
323
|
+
return instance.ptr;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
327
|
+
*
|
|
328
|
+
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
329
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
330
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
331
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
332
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
333
|
+
*/
|
|
334
|
+
export function executeCircuitWithBlackBoxSolver(solver, circuit, initial_witness, foreign_call_handler) {
|
|
335
|
+
_assertClass(solver, WasmBlackBoxFunctionSolver);
|
|
336
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
337
|
+
const len0 = WASM_VECTOR_LEN;
|
|
338
|
+
const ret = wasm.executeCircuitWithBlackBoxSolver(solver.__wbg_ptr, ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
339
|
+
return takeObject(ret);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
344
|
+
*
|
|
345
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
346
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
347
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
348
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
349
|
+
*/
|
|
350
|
+
export function executeCircuit(circuit, initial_witness, foreign_call_handler) {
|
|
351
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
352
|
+
const len0 = WASM_VECTOR_LEN;
|
|
353
|
+
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
354
|
+
return takeObject(ret);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
359
|
+
*/
|
|
360
|
+
export function createBlackBoxSolver() {
|
|
361
|
+
const ret = wasm.createBlackBoxSolver();
|
|
362
|
+
return takeObject(ret);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Sets the package's logging level.
|
|
367
|
+
*
|
|
368
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
369
|
+
*/
|
|
370
|
+
export function initLogLevel(level) {
|
|
371
|
+
wasm.initLogLevel(addHeapObject(level));
|
|
372
|
+
}
|
|
373
|
+
|
|
288
374
|
/**
|
|
289
375
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
290
376
|
* @param {Uint8Array} hashed_msg
|
|
@@ -328,6 +414,10 @@ export function ecdsa_secp256k1_verify(hashed_msg, public_key_x_bytes, public_ke
|
|
|
328
414
|
return ret !== 0;
|
|
329
415
|
}
|
|
330
416
|
|
|
417
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
418
|
+
ptr = ptr >>> 0;
|
|
419
|
+
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
420
|
+
}
|
|
331
421
|
/**
|
|
332
422
|
* Calculates the Keccak256 hash of the input bytes
|
|
333
423
|
* @param {Uint8Array} inputs
|
|
@@ -414,85 +504,17 @@ export function and(lhs, rhs) {
|
|
|
414
504
|
}
|
|
415
505
|
|
|
416
506
|
/**
|
|
417
|
-
*
|
|
418
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
419
|
-
*/
|
|
420
|
-
export function buildInfo() {
|
|
421
|
-
const ret = wasm.buildInfo();
|
|
422
|
-
return takeObject(ret);
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
function _assertClass(instance, klass) {
|
|
426
|
-
if (!(instance instanceof klass)) {
|
|
427
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
428
|
-
}
|
|
429
|
-
return instance.ptr;
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
433
|
-
*
|
|
434
|
-
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
435
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
436
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
437
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
438
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
439
|
-
*/
|
|
440
|
-
export function executeCircuitWithBlackBoxSolver(solver, circuit, initial_witness, foreign_call_handler) {
|
|
441
|
-
_assertClass(solver, WasmBlackBoxFunctionSolver);
|
|
442
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
443
|
-
const len0 = WASM_VECTOR_LEN;
|
|
444
|
-
const ret = wasm.executeCircuitWithBlackBoxSolver(solver.__wbg_ptr, ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
445
|
-
return takeObject(ret);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
450
|
-
*
|
|
451
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
452
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
453
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
454
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
455
|
-
*/
|
|
456
|
-
export function executeCircuit(circuit, initial_witness, foreign_call_handler) {
|
|
457
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
458
|
-
const len0 = WASM_VECTOR_LEN;
|
|
459
|
-
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
460
|
-
return takeObject(ret);
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
/**
|
|
464
|
-
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
465
|
-
*/
|
|
466
|
-
export function createBlackBoxSolver() {
|
|
467
|
-
const ret = wasm.createBlackBoxSolver();
|
|
468
|
-
return takeObject(ret);
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* Sets the package's logging level.
|
|
473
|
-
*
|
|
474
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
475
|
-
*/
|
|
476
|
-
export function initLogLevel(level) {
|
|
477
|
-
wasm.initLogLevel(addHeapObject(level));
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
/**
|
|
481
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
507
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
482
508
|
*
|
|
483
|
-
* @param {Uint8Array}
|
|
484
|
-
* @
|
|
485
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
486
|
-
* @param {Uint8Array} circuit
|
|
487
|
-
* @param {WitnessMap} solved_witness
|
|
488
|
-
* @returns {WitnessMap}
|
|
509
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
510
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
489
511
|
*/
|
|
490
|
-
export function
|
|
512
|
+
export function decompressWitness(compressed_witness) {
|
|
491
513
|
try {
|
|
492
514
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
493
|
-
const ptr0 = passArray8ToWasm0(
|
|
515
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
494
516
|
const len0 = WASM_VECTOR_LEN;
|
|
495
|
-
wasm.
|
|
517
|
+
wasm.decompressWitness(retptr, ptr0, len0);
|
|
496
518
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
497
519
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
498
520
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -506,59 +528,37 @@ export function getPublicWitness(circuit, solved_witness) {
|
|
|
506
528
|
}
|
|
507
529
|
|
|
508
530
|
/**
|
|
509
|
-
*
|
|
531
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
510
532
|
*
|
|
511
|
-
* @param {Uint8Array}
|
|
512
|
-
* @
|
|
513
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
514
|
-
* @param {Uint8Array} circuit
|
|
515
|
-
* @param {WitnessMap} solved_witness
|
|
516
|
-
* @returns {WitnessMap}
|
|
533
|
+
* @param {Uint8Array} compressed_witness - A witness map.
|
|
534
|
+
* @returns {WitnessMap} A compressed witness map
|
|
517
535
|
*/
|
|
518
|
-
export function
|
|
536
|
+
export function compressWitness(witness_map) {
|
|
519
537
|
try {
|
|
520
538
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
521
|
-
|
|
522
|
-
const len0 = WASM_VECTOR_LEN;
|
|
523
|
-
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
539
|
+
wasm.compressWitness(retptr, addHeapObject(witness_map));
|
|
524
540
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
525
541
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
526
542
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
527
|
-
|
|
528
|
-
|
|
543
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
544
|
+
if (r3) {
|
|
545
|
+
throw takeObject(r2);
|
|
529
546
|
}
|
|
530
|
-
|
|
547
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
548
|
+
wasm.__wbindgen_free(r0, r1 * 1);
|
|
549
|
+
return v1;
|
|
531
550
|
} finally {
|
|
532
551
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
533
552
|
}
|
|
534
553
|
}
|
|
535
554
|
|
|
536
555
|
/**
|
|
537
|
-
*
|
|
538
|
-
*
|
|
539
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
540
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
541
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
542
|
-
* @param {Uint8Array} circuit
|
|
543
|
-
* @param {WitnessMap} witness_map
|
|
544
|
-
* @returns {WitnessMap}
|
|
556
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
557
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
545
558
|
*/
|
|
546
|
-
export function
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
550
|
-
const len0 = WASM_VECTOR_LEN;
|
|
551
|
-
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
552
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
553
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
554
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
555
|
-
if (r2) {
|
|
556
|
-
throw takeObject(r1);
|
|
557
|
-
}
|
|
558
|
-
return takeObject(r0);
|
|
559
|
-
} finally {
|
|
560
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
561
|
-
}
|
|
559
|
+
export function buildInfo() {
|
|
560
|
+
const ret = wasm.buildInfo();
|
|
561
|
+
return takeObject(ret);
|
|
562
562
|
}
|
|
563
563
|
|
|
564
564
|
function handleError(f, args) {
|
|
@@ -569,7 +569,7 @@ function handleError(f, args) {
|
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
571
|
function __wbg_adapter_155(arg0, arg1, arg2, arg3) {
|
|
572
|
-
wasm.
|
|
572
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__ha676a05262f43687(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
573
573
|
}
|
|
574
574
|
|
|
575
575
|
/**
|
|
@@ -658,28 +658,32 @@ function __wbg_get_imports() {
|
|
|
658
658
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
659
659
|
takeObject(arg0);
|
|
660
660
|
};
|
|
661
|
-
imports.wbg.
|
|
662
|
-
const ret =
|
|
661
|
+
imports.wbg.__wbg_wasmblackboxfunctionsolver_new = function(arg0) {
|
|
662
|
+
const ret = WasmBlackBoxFunctionSolver.__wrap(arg0);
|
|
663
663
|
return addHeapObject(ret);
|
|
664
664
|
};
|
|
665
|
-
imports.wbg.
|
|
666
|
-
const ret = getObject(arg0);
|
|
667
|
-
return
|
|
665
|
+
imports.wbg.__wbindgen_is_array = function(arg0) {
|
|
666
|
+
const ret = Array.isArray(getObject(arg0));
|
|
667
|
+
return ret;
|
|
668
|
+
};
|
|
669
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
670
|
+
const obj = getObject(arg1);
|
|
671
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
672
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
673
|
+
var len1 = WASM_VECTOR_LEN;
|
|
674
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
675
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
668
676
|
};
|
|
669
677
|
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
670
678
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
671
679
|
return ret;
|
|
672
680
|
};
|
|
673
|
-
imports.wbg.
|
|
674
|
-
const ret =
|
|
675
|
-
return ret;
|
|
676
|
-
};
|
|
677
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
678
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
681
|
+
imports.wbg.__wbg_new_3a350aed96e43abb = function() {
|
|
682
|
+
const ret = new Map();
|
|
679
683
|
return addHeapObject(ret);
|
|
680
684
|
};
|
|
681
|
-
imports.wbg.
|
|
682
|
-
const ret =
|
|
685
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
686
|
+
const ret = arg0;
|
|
683
687
|
return addHeapObject(ret);
|
|
684
688
|
};
|
|
685
689
|
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
@@ -688,17 +692,21 @@ function __wbg_get_imports() {
|
|
|
688
692
|
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
689
693
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
690
694
|
};
|
|
691
|
-
imports.wbg.
|
|
692
|
-
const ret =
|
|
693
|
-
return ret;
|
|
695
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
696
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
697
|
+
return addHeapObject(ret);
|
|
694
698
|
};
|
|
695
|
-
imports.wbg.
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
699
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
700
|
+
const ret = getObject(arg0);
|
|
701
|
+
return addHeapObject(ret);
|
|
702
|
+
};
|
|
703
|
+
imports.wbg.__wbg_constructor_e2f72a91b4e3ce37 = function(arg0) {
|
|
704
|
+
const ret = new Error(takeObject(arg0));
|
|
705
|
+
return addHeapObject(ret);
|
|
706
|
+
};
|
|
707
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
708
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
709
|
+
return addHeapObject(ret);
|
|
702
710
|
};
|
|
703
711
|
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
704
712
|
const obj = takeObject(arg0).original;
|
|
@@ -709,17 +717,9 @@ function __wbg_get_imports() {
|
|
|
709
717
|
const ret = false;
|
|
710
718
|
return ret;
|
|
711
719
|
};
|
|
712
|
-
imports.wbg.
|
|
713
|
-
const ret =
|
|
714
|
-
return
|
|
715
|
-
};
|
|
716
|
-
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
717
|
-
const ret = arg0;
|
|
718
|
-
return addHeapObject(ret);
|
|
719
|
-
};
|
|
720
|
-
imports.wbg.__wbg_constructor_6e18ba778d67e20b = function(arg0) {
|
|
721
|
-
const ret = new Error(takeObject(arg0));
|
|
722
|
-
return addHeapObject(ret);
|
|
720
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
721
|
+
const ret = getObject(arg0) === undefined;
|
|
722
|
+
return ret;
|
|
723
723
|
};
|
|
724
724
|
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
|
|
725
725
|
const ret = new Error();
|
|
@@ -755,14 +755,6 @@ function __wbg_get_imports() {
|
|
|
755
755
|
const ret = getObject(arg0) >= getObject(arg1);
|
|
756
756
|
return ret;
|
|
757
757
|
};
|
|
758
|
-
imports.wbg.__wbindgen_is_bigint = function(arg0) {
|
|
759
|
-
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
760
|
-
return ret;
|
|
761
|
-
};
|
|
762
|
-
imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
|
|
763
|
-
const ret = getObject(arg0) === getObject(arg1);
|
|
764
|
-
return ret;
|
|
765
|
-
};
|
|
766
758
|
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
767
759
|
const ret = BigInt.asUintN(64, arg0);
|
|
768
760
|
return addHeapObject(ret);
|
|
@@ -771,16 +763,19 @@ function __wbg_get_imports() {
|
|
|
771
763
|
const ret = getObject(arg0) >> getObject(arg1);
|
|
772
764
|
return addHeapObject(ret);
|
|
773
765
|
};
|
|
774
|
-
imports.wbg.
|
|
775
|
-
const
|
|
776
|
-
|
|
766
|
+
imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
|
|
767
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
768
|
+
return ret;
|
|
769
|
+
};
|
|
770
|
+
imports.wbg.__wbindgen_is_bigint = function(arg0) {
|
|
771
|
+
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
777
772
|
return ret;
|
|
778
773
|
};
|
|
779
774
|
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
780
775
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
781
776
|
return ret;
|
|
782
777
|
};
|
|
783
|
-
imports.wbg.
|
|
778
|
+
imports.wbg.__wbg_instanceof_Global_f190e0e5a44a62df = function(arg0) {
|
|
784
779
|
let result;
|
|
785
780
|
try {
|
|
786
781
|
result = getObject(arg0) instanceof WebAssembly.Global;
|
|
@@ -790,6 +785,11 @@ function __wbg_get_imports() {
|
|
|
790
785
|
const ret = result;
|
|
791
786
|
return ret;
|
|
792
787
|
};
|
|
788
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
789
|
+
const val = getObject(arg0);
|
|
790
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
791
|
+
return ret;
|
|
792
|
+
};
|
|
793
793
|
imports.wbg.__wbg_static_accessor_SYMBOL_45d4d15e3c4aeb33 = function() {
|
|
794
794
|
const ret = Symbol;
|
|
795
795
|
return addHeapObject(ret);
|
|
@@ -798,12 +798,6 @@ function __wbg_get_imports() {
|
|
|
798
798
|
const ret = typeof(getObject(arg0)) === 'symbol';
|
|
799
799
|
return ret;
|
|
800
800
|
};
|
|
801
|
-
imports.wbg.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) {
|
|
802
|
-
getObject(arg0).getRandomValues(getObject(arg1));
|
|
803
|
-
}, arguments) };
|
|
804
|
-
imports.wbg.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) {
|
|
805
|
-
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
806
|
-
}, arguments) };
|
|
807
801
|
imports.wbg.__wbg_crypto_c48a774b022d20ac = function(arg0) {
|
|
808
802
|
const ret = getObject(arg0).crypto;
|
|
809
803
|
return addHeapObject(ret);
|
|
@@ -828,6 +822,12 @@ function __wbg_get_imports() {
|
|
|
828
822
|
const ret = module.require;
|
|
829
823
|
return addHeapObject(ret);
|
|
830
824
|
}, arguments) };
|
|
825
|
+
imports.wbg.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) {
|
|
826
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
827
|
+
}, arguments) };
|
|
828
|
+
imports.wbg.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) {
|
|
829
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
830
|
+
}, arguments) };
|
|
831
831
|
imports.wbg.__wbg_debug_efabe4eb183aa5d4 = function(arg0, arg1, arg2, arg3) {
|
|
832
832
|
console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
833
833
|
};
|
|
@@ -1119,8 +1119,8 @@ function __wbg_get_imports() {
|
|
|
1119
1119
|
const ret = wasm.__wbindgen_export_2;
|
|
1120
1120
|
return addHeapObject(ret);
|
|
1121
1121
|
};
|
|
1122
|
-
imports.wbg.
|
|
1123
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1122
|
+
imports.wbg.__wbindgen_closure_wrapper503 = function(arg0, arg1, arg2) {
|
|
1123
|
+
const ret = makeMutClosure(arg0, arg1, 160, __wbg_adapter_54);
|
|
1124
1124
|
return addHeapObject(ret);
|
|
1125
1125
|
};
|
|
1126
1126
|
|
package/web/acvm_js_bg.wasm
CHANGED
|
Binary file
|