@noir-lang/acvm_js 0.54.0 → 0.55.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 +88 -88
- package/nodejs/acvm_js.js +177 -177
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +14 -14
- package/package.json +1 -1
- package/web/acvm_js.d.ts +102 -102
- package/web/acvm_js.js +176 -176
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +14 -14
package/nodejs/acvm_js.js
CHANGED
|
@@ -23,22 +23,26 @@ function takeObject(idx) {
|
|
|
23
23
|
return ret;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
function isLikeNone(x) {
|
|
27
|
+
return x === undefined || x === null;
|
|
28
|
+
}
|
|
29
29
|
|
|
30
|
-
let
|
|
30
|
+
let cachedFloat64Memory0 = null;
|
|
31
31
|
|
|
32
|
-
function
|
|
33
|
-
if (
|
|
34
|
-
|
|
32
|
+
function getFloat64Memory0() {
|
|
33
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
34
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return cachedFloat64Memory0;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
let cachedInt32Memory0 = null;
|
|
40
|
+
|
|
41
|
+
function getInt32Memory0() {
|
|
42
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
43
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
44
|
+
}
|
|
45
|
+
return cachedInt32Memory0;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
function addHeapObject(obj) {
|
|
@@ -50,26 +54,22 @@ function addHeapObject(obj) {
|
|
|
50
54
|
return idx;
|
|
51
55
|
}
|
|
52
56
|
|
|
53
|
-
|
|
54
|
-
return x === undefined || x === null;
|
|
55
|
-
}
|
|
57
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
cachedTextDecoder.decode();
|
|
58
60
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
let cachedUint8Memory0 = null;
|
|
62
|
+
|
|
63
|
+
function getUint8Memory0() {
|
|
64
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
65
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
62
66
|
}
|
|
63
|
-
return
|
|
67
|
+
return cachedUint8Memory0;
|
|
64
68
|
}
|
|
65
69
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
70
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
71
|
-
}
|
|
72
|
-
return cachedInt32Memory0;
|
|
70
|
+
function getStringFromWasm0(ptr, len) {
|
|
71
|
+
ptr = ptr >>> 0;
|
|
72
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
let WASM_VECTOR_LEN = 0;
|
|
@@ -217,25 +217,33 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
217
217
|
return real;
|
|
218
218
|
}
|
|
219
219
|
function __wbg_adapter_22(arg0, arg1, arg2) {
|
|
220
|
-
wasm.
|
|
220
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h624a3dfbf78ca22a(arg0, arg1, addHeapObject(arg2));
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
224
|
+
ptr = ptr >>> 0;
|
|
225
|
+
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
226
|
+
}
|
|
223
227
|
/**
|
|
224
|
-
*
|
|
228
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
225
229
|
*
|
|
226
|
-
* @param {
|
|
230
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
231
|
+
* @returns {Uint8Array} A compressed witness map
|
|
227
232
|
*/
|
|
228
|
-
module.exports.
|
|
233
|
+
module.exports.compressWitness = function(witness_map) {
|
|
229
234
|
try {
|
|
230
235
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
231
|
-
|
|
232
|
-
const len0 = WASM_VECTOR_LEN;
|
|
233
|
-
wasm.initLogLevel(retptr, ptr0, len0);
|
|
236
|
+
wasm.compressWitness(retptr, addHeapObject(witness_map));
|
|
234
237
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
235
238
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
236
|
-
|
|
237
|
-
|
|
239
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
240
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
241
|
+
if (r3) {
|
|
242
|
+
throw takeObject(r2);
|
|
238
243
|
}
|
|
244
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
245
|
+
wasm.__wbindgen_free(r0, r1 * 1);
|
|
246
|
+
return v1;
|
|
239
247
|
} finally {
|
|
240
248
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
241
249
|
}
|
|
@@ -248,21 +256,18 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
248
256
|
return ptr;
|
|
249
257
|
}
|
|
250
258
|
/**
|
|
251
|
-
*
|
|
259
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
260
|
+
* This should be used to only fetch the witness map for the main function.
|
|
252
261
|
*
|
|
253
|
-
* @param {Uint8Array}
|
|
254
|
-
* @
|
|
255
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
256
|
-
* @param {Uint8Array} program
|
|
257
|
-
* @param {WitnessMap} witness_map
|
|
258
|
-
* @returns {WitnessMap}
|
|
262
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
263
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
259
264
|
*/
|
|
260
|
-
module.exports.
|
|
265
|
+
module.exports.decompressWitness = function(compressed_witness) {
|
|
261
266
|
try {
|
|
262
267
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
263
|
-
const ptr0 = passArray8ToWasm0(
|
|
268
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
264
269
|
const len0 = WASM_VECTOR_LEN;
|
|
265
|
-
wasm.
|
|
270
|
+
wasm.decompressWitness(retptr, ptr0, len0);
|
|
266
271
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
267
272
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
268
273
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -276,49 +281,42 @@ module.exports.getReturnWitness = function(program, witness_map) {
|
|
|
276
281
|
};
|
|
277
282
|
|
|
278
283
|
/**
|
|
279
|
-
*
|
|
284
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
280
285
|
*
|
|
281
|
-
* @param {
|
|
282
|
-
* @
|
|
283
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
284
|
-
* @param {Uint8Array} program
|
|
285
|
-
* @param {WitnessMap} solved_witness
|
|
286
|
-
* @returns {WitnessMap}
|
|
286
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
287
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
287
288
|
*/
|
|
288
|
-
module.exports.
|
|
289
|
+
module.exports.compressWitnessStack = function(witness_stack) {
|
|
289
290
|
try {
|
|
290
291
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
291
|
-
|
|
292
|
-
const len0 = WASM_VECTOR_LEN;
|
|
293
|
-
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
292
|
+
wasm.compressWitnessStack(retptr, addHeapObject(witness_stack));
|
|
294
293
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
295
294
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
296
295
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
297
|
-
|
|
298
|
-
|
|
296
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
297
|
+
if (r3) {
|
|
298
|
+
throw takeObject(r2);
|
|
299
299
|
}
|
|
300
|
-
|
|
300
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
301
|
+
wasm.__wbindgen_free(r0, r1 * 1);
|
|
302
|
+
return v1;
|
|
301
303
|
} finally {
|
|
302
304
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
303
305
|
}
|
|
304
306
|
};
|
|
305
307
|
|
|
306
308
|
/**
|
|
307
|
-
*
|
|
309
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
308
310
|
*
|
|
309
|
-
* @param {Uint8Array}
|
|
310
|
-
* @
|
|
311
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
312
|
-
* @param {Uint8Array} program
|
|
313
|
-
* @param {WitnessMap} solved_witness
|
|
314
|
-
* @returns {WitnessMap}
|
|
311
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
312
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
315
313
|
*/
|
|
316
|
-
module.exports.
|
|
314
|
+
module.exports.decompressWitnessStack = function(compressed_witness) {
|
|
317
315
|
try {
|
|
318
316
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
319
|
-
const ptr0 = passArray8ToWasm0(
|
|
317
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
320
318
|
const len0 = WASM_VECTOR_LEN;
|
|
321
|
-
wasm.
|
|
319
|
+
wasm.decompressWitnessStack(retptr, ptr0, len0);
|
|
322
320
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
323
321
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
324
322
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -331,6 +329,52 @@ module.exports.getPublicWitness = function(program, solved_witness) {
|
|
|
331
329
|
}
|
|
332
330
|
};
|
|
333
331
|
|
|
332
|
+
/**
|
|
333
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
334
|
+
*
|
|
335
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
336
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
337
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
338
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
339
|
+
*/
|
|
340
|
+
module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
|
|
341
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
342
|
+
const len0 = WASM_VECTOR_LEN;
|
|
343
|
+
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
344
|
+
return takeObject(ret);
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
349
|
+
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
350
|
+
*
|
|
351
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
352
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
353
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
354
|
+
* @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
|
|
355
|
+
*/
|
|
356
|
+
module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
|
|
357
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
358
|
+
const len0 = WASM_VECTOR_LEN;
|
|
359
|
+
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
360
|
+
return takeObject(ret);
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
365
|
+
*
|
|
366
|
+
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
367
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
368
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
369
|
+
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
370
|
+
*/
|
|
371
|
+
module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
|
|
372
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
373
|
+
const len0 = WASM_VECTOR_LEN;
|
|
374
|
+
const ret = wasm.executeProgram(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
375
|
+
return takeObject(ret);
|
|
376
|
+
};
|
|
377
|
+
|
|
334
378
|
/**
|
|
335
379
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
336
380
|
* @param {string} lhs
|
|
@@ -397,10 +441,6 @@ module.exports.sha256_compression = function(inputs, state) {
|
|
|
397
441
|
}
|
|
398
442
|
};
|
|
399
443
|
|
|
400
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
401
|
-
ptr = ptr >>> 0;
|
|
402
|
-
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
403
|
-
}
|
|
404
444
|
/**
|
|
405
445
|
* Calculates the Blake2s256 hash of the input bytes
|
|
406
446
|
* @param {Uint8Array} inputs
|
|
@@ -474,89 +514,42 @@ module.exports.buildInfo = function() {
|
|
|
474
514
|
};
|
|
475
515
|
|
|
476
516
|
/**
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
480
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
481
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
482
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
483
|
-
*/
|
|
484
|
-
module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
|
|
485
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
486
|
-
const len0 = WASM_VECTOR_LEN;
|
|
487
|
-
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
488
|
-
return takeObject(ret);
|
|
489
|
-
};
|
|
490
|
-
|
|
491
|
-
/**
|
|
492
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
493
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
494
|
-
*
|
|
495
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
496
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
497
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
498
|
-
* @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
|
|
499
|
-
*/
|
|
500
|
-
module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
|
|
501
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
502
|
-
const len0 = WASM_VECTOR_LEN;
|
|
503
|
-
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
504
|
-
return takeObject(ret);
|
|
505
|
-
};
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
509
|
-
*
|
|
510
|
-
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
511
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
512
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
513
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
514
|
-
*/
|
|
515
|
-
module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
|
|
516
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
517
|
-
const len0 = WASM_VECTOR_LEN;
|
|
518
|
-
const ret = wasm.executeProgram(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
519
|
-
return takeObject(ret);
|
|
520
|
-
};
|
|
521
|
-
|
|
522
|
-
/**
|
|
523
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
517
|
+
* Sets the package's logging level.
|
|
524
518
|
*
|
|
525
|
-
* @param {
|
|
526
|
-
* @returns {Uint8Array} A compressed witness map
|
|
519
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
527
520
|
*/
|
|
528
|
-
module.exports.
|
|
521
|
+
module.exports.initLogLevel = function(filter) {
|
|
529
522
|
try {
|
|
530
523
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
531
|
-
wasm.
|
|
524
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
525
|
+
const len0 = WASM_VECTOR_LEN;
|
|
526
|
+
wasm.initLogLevel(retptr, ptr0, len0);
|
|
532
527
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
533
528
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
if (r3) {
|
|
537
|
-
throw takeObject(r2);
|
|
529
|
+
if (r1) {
|
|
530
|
+
throw takeObject(r0);
|
|
538
531
|
}
|
|
539
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
540
|
-
wasm.__wbindgen_free(r0, r1 * 1);
|
|
541
|
-
return v1;
|
|
542
532
|
} finally {
|
|
543
533
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
544
534
|
}
|
|
545
535
|
};
|
|
546
536
|
|
|
547
537
|
/**
|
|
548
|
-
*
|
|
549
|
-
* This should be used to only fetch the witness map for the main function.
|
|
538
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
550
539
|
*
|
|
551
|
-
* @param {Uint8Array}
|
|
552
|
-
* @
|
|
540
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
541
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
542
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
543
|
+
* @param {Uint8Array} program
|
|
544
|
+
* @param {WitnessMap} witness_map
|
|
545
|
+
* @returns {WitnessMap}
|
|
553
546
|
*/
|
|
554
|
-
module.exports.
|
|
547
|
+
module.exports.getReturnWitness = function(program, witness_map) {
|
|
555
548
|
try {
|
|
556
549
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
557
|
-
const ptr0 = passArray8ToWasm0(
|
|
550
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
558
551
|
const len0 = WASM_VECTOR_LEN;
|
|
559
|
-
wasm.
|
|
552
|
+
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
560
553
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
561
554
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
562
555
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -570,42 +563,49 @@ module.exports.decompressWitness = function(compressed_witness) {
|
|
|
570
563
|
};
|
|
571
564
|
|
|
572
565
|
/**
|
|
573
|
-
*
|
|
566
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
574
567
|
*
|
|
575
|
-
* @param {
|
|
576
|
-
* @
|
|
568
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
569
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
570
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
571
|
+
* @param {Uint8Array} program
|
|
572
|
+
* @param {WitnessMap} solved_witness
|
|
573
|
+
* @returns {WitnessMap}
|
|
577
574
|
*/
|
|
578
|
-
module.exports.
|
|
575
|
+
module.exports.getPublicParametersWitness = function(program, solved_witness) {
|
|
579
576
|
try {
|
|
580
577
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
581
|
-
|
|
578
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
579
|
+
const len0 = WASM_VECTOR_LEN;
|
|
580
|
+
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
582
581
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
583
582
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
584
583
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
throw takeObject(r2);
|
|
584
|
+
if (r2) {
|
|
585
|
+
throw takeObject(r1);
|
|
588
586
|
}
|
|
589
|
-
|
|
590
|
-
wasm.__wbindgen_free(r0, r1 * 1);
|
|
591
|
-
return v1;
|
|
587
|
+
return takeObject(r0);
|
|
592
588
|
} finally {
|
|
593
589
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
594
590
|
}
|
|
595
591
|
};
|
|
596
592
|
|
|
597
593
|
/**
|
|
598
|
-
*
|
|
594
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
599
595
|
*
|
|
600
|
-
* @param {Uint8Array}
|
|
601
|
-
* @
|
|
596
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
597
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
598
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
599
|
+
* @param {Uint8Array} program
|
|
600
|
+
* @param {WitnessMap} solved_witness
|
|
601
|
+
* @returns {WitnessMap}
|
|
602
602
|
*/
|
|
603
|
-
module.exports.
|
|
603
|
+
module.exports.getPublicWitness = function(program, solved_witness) {
|
|
604
604
|
try {
|
|
605
605
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
606
|
-
const ptr0 = passArray8ToWasm0(
|
|
606
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
607
607
|
const len0 = WASM_VECTOR_LEN;
|
|
608
|
-
wasm.
|
|
608
|
+
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
609
609
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
610
610
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
611
611
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -619,7 +619,7 @@ module.exports.decompressWitnessStack = function(compressed_witness) {
|
|
|
619
619
|
};
|
|
620
620
|
|
|
621
621
|
function __wbg_adapter_75(arg0, arg1, arg2, arg3, arg4) {
|
|
622
|
-
wasm.
|
|
622
|
+
wasm.wasm_bindgen__convert__closures__invoke3_mut__h45040feada3ebb25(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
|
|
623
623
|
}
|
|
624
624
|
|
|
625
625
|
function handleError(f, args) {
|
|
@@ -630,7 +630,7 @@ function handleError(f, args) {
|
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
function __wbg_adapter_92(arg0, arg1, arg2, arg3) {
|
|
633
|
-
wasm.
|
|
633
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h3f07259b3eb55784(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
634
634
|
}
|
|
635
635
|
|
|
636
636
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
@@ -647,17 +647,19 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
|
647
647
|
return ret;
|
|
648
648
|
};
|
|
649
649
|
|
|
650
|
-
module.exports.
|
|
651
|
-
const ret =
|
|
652
|
-
return
|
|
650
|
+
module.exports.__wbindgen_is_array = function(arg0) {
|
|
651
|
+
const ret = Array.isArray(getObject(arg0));
|
|
652
|
+
return ret;
|
|
653
653
|
};
|
|
654
654
|
|
|
655
|
-
module.exports.
|
|
656
|
-
const
|
|
657
|
-
|
|
655
|
+
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
656
|
+
const obj = getObject(arg1);
|
|
657
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
658
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
659
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
658
660
|
};
|
|
659
661
|
|
|
660
|
-
module.exports.
|
|
662
|
+
module.exports.__wbg_new_f4a2f4980eb0a66e = function() {
|
|
661
663
|
const ret = new Array();
|
|
662
664
|
return addHeapObject(ret);
|
|
663
665
|
};
|
|
@@ -667,24 +669,22 @@ module.exports.__wbindgen_number_new = function(arg0) {
|
|
|
667
669
|
return addHeapObject(ret);
|
|
668
670
|
};
|
|
669
671
|
|
|
670
|
-
module.exports.
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
674
|
-
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
672
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
673
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
674
|
+
return addHeapObject(ret);
|
|
675
675
|
};
|
|
676
676
|
|
|
677
|
-
module.exports.
|
|
678
|
-
const ret =
|
|
679
|
-
return ret;
|
|
677
|
+
module.exports.__wbg_constructor_bb18ee055059e54b = function(arg0) {
|
|
678
|
+
const ret = new Error(takeObject(arg0));
|
|
679
|
+
return addHeapObject(ret);
|
|
680
680
|
};
|
|
681
681
|
|
|
682
|
-
module.exports.
|
|
683
|
-
const ret =
|
|
682
|
+
module.exports.__wbindgen_is_string = function(arg0) {
|
|
683
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
684
684
|
return ret;
|
|
685
685
|
};
|
|
686
686
|
|
|
687
|
-
module.exports.
|
|
687
|
+
module.exports.__wbg_new_e0a89522928fc0a3 = function() {
|
|
688
688
|
const ret = new Map();
|
|
689
689
|
return addHeapObject(ret);
|
|
690
690
|
};
|
|
@@ -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_wrapper726 = function(arg0, arg1, arg2) {
|
|
920
|
+
const ret = makeMutClosure(arg0, arg1, 265, __wbg_adapter_22);
|
|
921
921
|
return addHeapObject(ret);
|
|
922
922
|
};
|
|
923
923
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function
|
|
5
|
-
export function
|
|
6
|
-
export function
|
|
7
|
-
export function
|
|
4
|
+
export function compressWitness(a: number, b: number): void;
|
|
5
|
+
export function decompressWitness(a: number, b: number, c: number): void;
|
|
6
|
+
export function compressWitnessStack(a: number, b: number): void;
|
|
7
|
+
export function decompressWitnessStack(a: number, b: number, c: number): void;
|
|
8
|
+
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
9
|
+
export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number;
|
|
10
|
+
export function executeProgram(a: number, b: number, c: number, d: number): number;
|
|
8
11
|
export function and(a: number, b: number): number;
|
|
9
12
|
export function xor(a: number, b: number): number;
|
|
10
13
|
export function sha256_compression(a: number, b: number, c: number, d: number, e: number): void;
|
|
@@ -12,19 +15,16 @@ export function blake2s256(a: number, b: number, c: number): void;
|
|
|
12
15
|
export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
13
16
|
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
14
17
|
export function buildInfo(): number;
|
|
15
|
-
export function
|
|
16
|
-
export function
|
|
17
|
-
export function
|
|
18
|
-
export function
|
|
19
|
-
export function decompressWitness(a: number, b: number, c: number): void;
|
|
20
|
-
export function compressWitnessStack(a: number, b: number): void;
|
|
21
|
-
export function decompressWitnessStack(a: number, b: number, c: number): void;
|
|
18
|
+
export function initLogLevel(a: number, b: number, c: number): void;
|
|
19
|
+
export function getReturnWitness(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 getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
22
22
|
export function __wbindgen_malloc(a: number): number;
|
|
23
23
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
24
24
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
25
|
-
export function
|
|
25
|
+
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h624a3dfbf78ca22a(a: number, b: number, c: number): void;
|
|
26
26
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
27
27
|
export function __wbindgen_free(a: number, b: number): void;
|
|
28
|
-
export function
|
|
28
|
+
export function wasm_bindgen__convert__closures__invoke3_mut__h45040feada3ebb25(a: number, b: number, c: number, d: number, e: number): void;
|
|
29
29
|
export function __wbindgen_exn_store(a: number): void;
|
|
30
|
-
export function
|
|
30
|
+
export function wasm_bindgen__convert__closures__invoke2_mut__h3f07259b3eb55784(a: number, b: number, c: number, d: number): void;
|