@noir-lang/acvm_js 0.30.0-dbb6cf0.nightly → 0.30.0-e89f364.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 +78 -78
- package/nodejs/acvm_js.js +209 -209
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +13 -13
- package/package.json +1 -1
- package/web/acvm_js.d.ts +91 -91
- package/web/acvm_js.js +203 -203
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +13 -13
package/web/acvm_js.js
CHANGED
|
@@ -47,28 +47,6 @@ function addHeapObject(obj) {
|
|
|
47
47
|
return idx;
|
|
48
48
|
}
|
|
49
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
50
|
let WASM_VECTOR_LEN = 0;
|
|
73
51
|
|
|
74
52
|
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
@@ -124,6 +102,28 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
124
102
|
return ptr;
|
|
125
103
|
}
|
|
126
104
|
|
|
105
|
+
function isLikeNone(x) {
|
|
106
|
+
return x === undefined || x === null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
let cachedInt32Memory0 = null;
|
|
110
|
+
|
|
111
|
+
function getInt32Memory0() {
|
|
112
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
113
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
114
|
+
}
|
|
115
|
+
return cachedInt32Memory0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
let cachedFloat64Memory0 = null;
|
|
119
|
+
|
|
120
|
+
function getFloat64Memory0() {
|
|
121
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
122
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
123
|
+
}
|
|
124
|
+
return cachedFloat64Memory0;
|
|
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__h52952476ed423c11(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,126 @@ 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
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
376
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
377
|
+
*/
|
|
378
|
+
export function buildInfo() {
|
|
379
|
+
const ret = wasm.buildInfo();
|
|
380
|
+
return takeObject(ret);
|
|
381
|
+
}
|
|
382
|
+
|
|
288
383
|
/**
|
|
289
384
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
290
385
|
* @param {Uint8Array} hashed_msg
|
|
@@ -328,6 +423,10 @@ export function ecdsa_secp256k1_verify(hashed_msg, public_key_x_bytes, public_ke
|
|
|
328
423
|
return ret !== 0;
|
|
329
424
|
}
|
|
330
425
|
|
|
426
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
427
|
+
ptr = ptr >>> 0;
|
|
428
|
+
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
429
|
+
}
|
|
331
430
|
/**
|
|
332
431
|
* Calculates the Keccak256 hash of the input bytes
|
|
333
432
|
* @param {Uint8Array} inputs
|
|
@@ -414,113 +513,17 @@ export function and(lhs, rhs) {
|
|
|
414
513
|
}
|
|
415
514
|
|
|
416
515
|
/**
|
|
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.
|
|
482
|
-
*
|
|
483
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
484
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
485
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
486
|
-
* @param {Uint8Array} circuit
|
|
487
|
-
* @param {WitnessMap} solved_witness
|
|
488
|
-
* @returns {WitnessMap}
|
|
489
|
-
*/
|
|
490
|
-
export function getPublicWitness(circuit, solved_witness) {
|
|
491
|
-
try {
|
|
492
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
493
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
494
|
-
const len0 = WASM_VECTOR_LEN;
|
|
495
|
-
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
496
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
497
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
498
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
499
|
-
if (r2) {
|
|
500
|
-
throw takeObject(r1);
|
|
501
|
-
}
|
|
502
|
-
return takeObject(r0);
|
|
503
|
-
} finally {
|
|
504
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
/**
|
|
509
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
516
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
510
517
|
*
|
|
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}
|
|
518
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
519
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
517
520
|
*/
|
|
518
|
-
export function
|
|
521
|
+
export function decompressWitness(compressed_witness) {
|
|
519
522
|
try {
|
|
520
523
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
521
|
-
const ptr0 = passArray8ToWasm0(
|
|
524
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
522
525
|
const len0 = WASM_VECTOR_LEN;
|
|
523
|
-
wasm.
|
|
526
|
+
wasm.decompressWitness(retptr, ptr0, len0);
|
|
524
527
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
525
528
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
526
529
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -534,28 +537,25 @@ export function getPublicParametersWitness(circuit, solved_witness) {
|
|
|
534
537
|
}
|
|
535
538
|
|
|
536
539
|
/**
|
|
537
|
-
*
|
|
540
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
538
541
|
*
|
|
539
|
-
* @param {Uint8Array}
|
|
540
|
-
* @
|
|
541
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
542
|
-
* @param {Uint8Array} circuit
|
|
543
|
-
* @param {WitnessMap} witness_map
|
|
544
|
-
* @returns {WitnessMap}
|
|
542
|
+
* @param {Uint8Array} compressed_witness - A witness map.
|
|
543
|
+
* @returns {WitnessMap} A compressed witness map
|
|
545
544
|
*/
|
|
546
|
-
export function
|
|
545
|
+
export function compressWitness(witness_map) {
|
|
547
546
|
try {
|
|
548
547
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
549
|
-
|
|
550
|
-
const len0 = WASM_VECTOR_LEN;
|
|
551
|
-
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
548
|
+
wasm.compressWitness(retptr, addHeapObject(witness_map));
|
|
552
549
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
553
550
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
554
551
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
555
|
-
|
|
556
|
-
|
|
552
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
553
|
+
if (r3) {
|
|
554
|
+
throw takeObject(r2);
|
|
557
555
|
}
|
|
558
|
-
|
|
556
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
557
|
+
wasm.__wbindgen_free(r0, r1 * 1);
|
|
558
|
+
return v1;
|
|
559
559
|
} finally {
|
|
560
560
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
561
561
|
}
|
|
@@ -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__h59b9f7ecd67d6688(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
573
573
|
}
|
|
574
574
|
|
|
575
575
|
/**
|
|
@@ -658,6 +658,14 @@ function __wbg_get_imports() {
|
|
|
658
658
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
659
659
|
takeObject(arg0);
|
|
660
660
|
};
|
|
661
|
+
imports.wbg.__wbg_wasmblackboxfunctionsolver_new = function(arg0) {
|
|
662
|
+
const ret = WasmBlackBoxFunctionSolver.__wrap(arg0);
|
|
663
|
+
return addHeapObject(ret);
|
|
664
|
+
};
|
|
665
|
+
imports.wbg.__wbindgen_is_array = function(arg0) {
|
|
666
|
+
const ret = Array.isArray(getObject(arg0));
|
|
667
|
+
return ret;
|
|
668
|
+
};
|
|
661
669
|
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
662
670
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
663
671
|
return addHeapObject(ret);
|
|
@@ -666,20 +674,24 @@ function __wbg_get_imports() {
|
|
|
666
674
|
const ret = getObject(arg0);
|
|
667
675
|
return addHeapObject(ret);
|
|
668
676
|
};
|
|
677
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
678
|
+
const obj = getObject(arg1);
|
|
679
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
680
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
681
|
+
var len1 = WASM_VECTOR_LEN;
|
|
682
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
683
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
684
|
+
};
|
|
669
685
|
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
670
686
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
671
687
|
return ret;
|
|
672
688
|
};
|
|
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);
|
|
689
|
+
imports.wbg.__wbg_new_e290c3c041336f87 = function() {
|
|
690
|
+
const ret = new Map();
|
|
679
691
|
return addHeapObject(ret);
|
|
680
692
|
};
|
|
681
|
-
imports.wbg.
|
|
682
|
-
const ret =
|
|
693
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
694
|
+
const ret = arg0;
|
|
683
695
|
return addHeapObject(ret);
|
|
684
696
|
};
|
|
685
697
|
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
@@ -688,17 +700,13 @@ function __wbg_get_imports() {
|
|
|
688
700
|
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
689
701
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
690
702
|
};
|
|
691
|
-
imports.wbg.
|
|
692
|
-
const ret =
|
|
693
|
-
return ret;
|
|
703
|
+
imports.wbg.__wbg_constructor_6e18ba778d67e20b = function(arg0) {
|
|
704
|
+
const ret = new Error(takeObject(arg0));
|
|
705
|
+
return addHeapObject(ret);
|
|
694
706
|
};
|
|
695
|
-
imports.wbg.
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
699
|
-
var len1 = WASM_VECTOR_LEN;
|
|
700
|
-
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
701
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
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);
|
|
@@ -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_wrapper504 = function(arg0, arg1, arg2) {
|
|
1123
|
+
const ret = makeMutClosure(arg0, arg1, 161, __wbg_adapter_54);
|
|
1124
1124
|
return addHeapObject(ret);
|
|
1125
1125
|
};
|
|
1126
1126
|
|
package/web/acvm_js_bg.wasm
CHANGED
|
Binary file
|
package/web/acvm_js_bg.wasm.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function
|
|
5
|
-
export function
|
|
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;
|
|
7
|
+
export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
|
|
8
|
+
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
9
|
+
export function createBlackBoxSolver(): number;
|
|
10
|
+
export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
|
|
11
|
+
export function initLogLevel(a: number): void;
|
|
12
|
+
export function buildInfo(): number;
|
|
6
13
|
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
7
14
|
export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
8
15
|
export function keccak256(a: number, b: number, c: number): void;
|
|
@@ -10,22 +17,15 @@ export function blake2s256(a: number, b: number, c: number): void;
|
|
|
10
17
|
export function sha256(a: number, b: number, c: number): void;
|
|
11
18
|
export function xor(a: number, b: number): number;
|
|
12
19
|
export function and(a: number, b: number): number;
|
|
13
|
-
export function
|
|
14
|
-
export function
|
|
15
|
-
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
16
|
-
export function createBlackBoxSolver(): number;
|
|
17
|
-
export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
|
|
18
|
-
export function initLogLevel(a: number): void;
|
|
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;
|
|
20
|
+
export function decompressWitness(a: number, b: number, c: number): void;
|
|
21
|
+
export function compressWitness(a: number, b: number): void;
|
|
22
22
|
export function __wbg_trap_free(a: number): void;
|
|
23
23
|
export function trap___wbgd_downcast_token(): number;
|
|
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__h52952476ed423c11(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__h59b9f7ecd67d6688(a: number, b: number, c: number, d: number): void;
|