@aztec/noir-acvm_js 0.0.1-commit.21caa21 → 0.0.1-commit.21ecf947b
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 +82 -82
- package/nodejs/acvm_js.js +200 -200
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +14 -14
- package/package.json +6 -6
- package/web/acvm_js.d.ts +96 -96
- package/web/acvm_js.js +199 -199
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +14 -14
package/web/acvm_js.js
CHANGED
|
@@ -197,56 +197,12 @@ function debugString(val) {
|
|
|
197
197
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
198
198
|
return className;
|
|
199
199
|
}
|
|
200
|
-
|
|
201
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
202
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
203
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
204
|
-
WASM_VECTOR_LEN = arg.length;
|
|
205
|
-
return ptr;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
209
|
-
*
|
|
210
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
211
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
212
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
213
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
214
|
-
*/
|
|
215
|
-
export function executeCircuit(program, initial_witness, foreign_call_handler) {
|
|
216
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
217
|
-
const len0 = WASM_VECTOR_LEN;
|
|
218
|
-
const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
|
|
219
|
-
return ret;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
224
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
225
|
-
*
|
|
226
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
227
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
228
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
229
|
-
* @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.
|
|
230
|
-
*/
|
|
231
|
-
export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
|
|
232
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
233
|
-
const len0 = WASM_VECTOR_LEN;
|
|
234
|
-
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
|
|
235
|
-
return ret;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
200
|
/**
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
242
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
243
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
244
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
201
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
202
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
245
203
|
*/
|
|
246
|
-
export function
|
|
247
|
-
const
|
|
248
|
-
const len0 = WASM_VECTOR_LEN;
|
|
249
|
-
const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
|
|
204
|
+
export function buildInfo() {
|
|
205
|
+
const ret = wasm.buildInfo();
|
|
250
206
|
return ret;
|
|
251
207
|
}
|
|
252
208
|
|
|
@@ -269,144 +225,6 @@ export function initLogLevel(filter) {
|
|
|
269
225
|
}
|
|
270
226
|
}
|
|
271
227
|
|
|
272
|
-
/**
|
|
273
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
274
|
-
*
|
|
275
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
276
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
277
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
278
|
-
* @param {Uint8Array} program
|
|
279
|
-
* @param {WitnessMap} witness_map
|
|
280
|
-
* @returns {WitnessMap}
|
|
281
|
-
*/
|
|
282
|
-
export function getReturnWitness(program, witness_map) {
|
|
283
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
284
|
-
const len0 = WASM_VECTOR_LEN;
|
|
285
|
-
const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
|
|
286
|
-
if (ret[2]) {
|
|
287
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
288
|
-
}
|
|
289
|
-
return takeFromExternrefTable0(ret[0]);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
294
|
-
*
|
|
295
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
296
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
297
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
298
|
-
* @param {Uint8Array} program
|
|
299
|
-
* @param {WitnessMap} solved_witness
|
|
300
|
-
* @returns {WitnessMap}
|
|
301
|
-
*/
|
|
302
|
-
export function getPublicParametersWitness(program, solved_witness) {
|
|
303
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
304
|
-
const len0 = WASM_VECTOR_LEN;
|
|
305
|
-
const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
|
|
306
|
-
if (ret[2]) {
|
|
307
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
308
|
-
}
|
|
309
|
-
return takeFromExternrefTable0(ret[0]);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
314
|
-
*
|
|
315
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
316
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
317
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
318
|
-
* @param {Uint8Array} program
|
|
319
|
-
* @param {WitnessMap} solved_witness
|
|
320
|
-
* @returns {WitnessMap}
|
|
321
|
-
*/
|
|
322
|
-
export function getPublicWitness(program, solved_witness) {
|
|
323
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
324
|
-
const len0 = WASM_VECTOR_LEN;
|
|
325
|
-
const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
|
|
326
|
-
if (ret[2]) {
|
|
327
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
328
|
-
}
|
|
329
|
-
return takeFromExternrefTable0(ret[0]);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
334
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
335
|
-
*/
|
|
336
|
-
export function buildInfo() {
|
|
337
|
-
const ret = wasm.buildInfo();
|
|
338
|
-
return ret;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
342
|
-
ptr = ptr >>> 0;
|
|
343
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
347
|
-
*
|
|
348
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
349
|
-
* @returns {Uint8Array} A compressed witness map
|
|
350
|
-
*/
|
|
351
|
-
export function compressWitness(witness_map) {
|
|
352
|
-
const ret = wasm.compressWitness(witness_map);
|
|
353
|
-
if (ret[3]) {
|
|
354
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
355
|
-
}
|
|
356
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
357
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
358
|
-
return v1;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
363
|
-
* This should be used to only fetch the witness map for the main function.
|
|
364
|
-
*
|
|
365
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
366
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
367
|
-
*/
|
|
368
|
-
export function decompressWitness(compressed_witness) {
|
|
369
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
370
|
-
const len0 = WASM_VECTOR_LEN;
|
|
371
|
-
const ret = wasm.decompressWitness(ptr0, len0);
|
|
372
|
-
if (ret[2]) {
|
|
373
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
374
|
-
}
|
|
375
|
-
return takeFromExternrefTable0(ret[0]);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
380
|
-
*
|
|
381
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
382
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
383
|
-
*/
|
|
384
|
-
export function compressWitnessStack(witness_stack) {
|
|
385
|
-
const ret = wasm.compressWitnessStack(witness_stack);
|
|
386
|
-
if (ret[3]) {
|
|
387
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
388
|
-
}
|
|
389
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
390
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
391
|
-
return v1;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
396
|
-
*
|
|
397
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
398
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
399
|
-
*/
|
|
400
|
-
export function decompressWitnessStack(compressed_witness) {
|
|
401
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
402
|
-
const len0 = WASM_VECTOR_LEN;
|
|
403
|
-
const ret = wasm.decompressWitnessStack(ptr0, len0);
|
|
404
|
-
if (ret[2]) {
|
|
405
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
406
|
-
}
|
|
407
|
-
return takeFromExternrefTable0(ret[0]);
|
|
408
|
-
}
|
|
409
|
-
|
|
410
228
|
/**
|
|
411
229
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
412
230
|
* @param {string} lhs
|
|
@@ -466,6 +284,17 @@ export function sha256_compression(inputs, state) {
|
|
|
466
284
|
return v3;
|
|
467
285
|
}
|
|
468
286
|
|
|
287
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
288
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
289
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
290
|
+
WASM_VECTOR_LEN = arg.length;
|
|
291
|
+
return ptr;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
295
|
+
ptr = ptr >>> 0;
|
|
296
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
297
|
+
}
|
|
469
298
|
/**
|
|
470
299
|
* Calculates the Blake2s256 hash of the input bytes
|
|
471
300
|
* @param {Uint8Array} inputs
|
|
@@ -522,16 +351,187 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
|
|
|
522
351
|
return ret !== 0;
|
|
523
352
|
}
|
|
524
353
|
|
|
354
|
+
/**
|
|
355
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
356
|
+
*
|
|
357
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
358
|
+
* @returns {Uint8Array} A compressed witness map
|
|
359
|
+
*/
|
|
360
|
+
export function compressWitness(witness_map) {
|
|
361
|
+
const ret = wasm.compressWitness(witness_map);
|
|
362
|
+
if (ret[3]) {
|
|
363
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
364
|
+
}
|
|
365
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
366
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
367
|
+
return v1;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
372
|
+
* This should be used to only fetch the witness map for the main function.
|
|
373
|
+
*
|
|
374
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
375
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
376
|
+
*/
|
|
377
|
+
export function decompressWitness(compressed_witness) {
|
|
378
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
379
|
+
const len0 = WASM_VECTOR_LEN;
|
|
380
|
+
const ret = wasm.decompressWitness(ptr0, len0);
|
|
381
|
+
if (ret[2]) {
|
|
382
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
383
|
+
}
|
|
384
|
+
return takeFromExternrefTable0(ret[0]);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
389
|
+
*
|
|
390
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
391
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
392
|
+
*/
|
|
393
|
+
export function compressWitnessStack(witness_stack) {
|
|
394
|
+
const ret = wasm.compressWitnessStack(witness_stack);
|
|
395
|
+
if (ret[3]) {
|
|
396
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
397
|
+
}
|
|
398
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
399
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
400
|
+
return v1;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
405
|
+
*
|
|
406
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
407
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
408
|
+
*/
|
|
409
|
+
export function decompressWitnessStack(compressed_witness) {
|
|
410
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
411
|
+
const len0 = WASM_VECTOR_LEN;
|
|
412
|
+
const ret = wasm.decompressWitnessStack(ptr0, len0);
|
|
413
|
+
if (ret[2]) {
|
|
414
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
415
|
+
}
|
|
416
|
+
return takeFromExternrefTable0(ret[0]);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
421
|
+
*
|
|
422
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
423
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
424
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
425
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
426
|
+
*/
|
|
427
|
+
export function executeCircuit(program, initial_witness, foreign_call_handler) {
|
|
428
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
429
|
+
const len0 = WASM_VECTOR_LEN;
|
|
430
|
+
const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
|
|
431
|
+
return ret;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
436
|
+
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
437
|
+
*
|
|
438
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
439
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
440
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
441
|
+
* @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.
|
|
442
|
+
*/
|
|
443
|
+
export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
|
|
444
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
445
|
+
const len0 = WASM_VECTOR_LEN;
|
|
446
|
+
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
|
|
447
|
+
return ret;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
452
|
+
*
|
|
453
|
+
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
454
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
455
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
456
|
+
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
457
|
+
*/
|
|
458
|
+
export function executeProgram(program, initial_witness, foreign_call_handler) {
|
|
459
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
460
|
+
const len0 = WASM_VECTOR_LEN;
|
|
461
|
+
const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
|
|
462
|
+
return ret;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
467
|
+
*
|
|
468
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
469
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
470
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
471
|
+
* @param {Uint8Array} program
|
|
472
|
+
* @param {WitnessMap} witness_map
|
|
473
|
+
* @returns {WitnessMap}
|
|
474
|
+
*/
|
|
475
|
+
export function getReturnWitness(program, witness_map) {
|
|
476
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
477
|
+
const len0 = WASM_VECTOR_LEN;
|
|
478
|
+
const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
|
|
479
|
+
if (ret[2]) {
|
|
480
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
481
|
+
}
|
|
482
|
+
return takeFromExternrefTable0(ret[0]);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
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 parameters.
|
|
491
|
+
* @param {Uint8Array} program
|
|
492
|
+
* @param {WitnessMap} solved_witness
|
|
493
|
+
* @returns {WitnessMap}
|
|
494
|
+
*/
|
|
495
|
+
export function getPublicParametersWitness(program, solved_witness) {
|
|
496
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
497
|
+
const len0 = WASM_VECTOR_LEN;
|
|
498
|
+
const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
|
|
499
|
+
if (ret[2]) {
|
|
500
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
501
|
+
}
|
|
502
|
+
return takeFromExternrefTable0(ret[0]);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
507
|
+
*
|
|
508
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
509
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
510
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
511
|
+
* @param {Uint8Array} program
|
|
512
|
+
* @param {WitnessMap} solved_witness
|
|
513
|
+
* @returns {WitnessMap}
|
|
514
|
+
*/
|
|
515
|
+
export function getPublicWitness(program, solved_witness) {
|
|
516
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
517
|
+
const len0 = WASM_VECTOR_LEN;
|
|
518
|
+
const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
|
|
519
|
+
if (ret[2]) {
|
|
520
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
521
|
+
}
|
|
522
|
+
return takeFromExternrefTable0(ret[0]);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
525
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
526
|
-
wasm.
|
|
526
|
+
wasm.closure445_externref_shim(arg0, arg1, arg2);
|
|
527
527
|
}
|
|
528
528
|
|
|
529
529
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
530
|
-
wasm.
|
|
530
|
+
wasm.closure924_externref_shim(arg0, arg1, arg2, arg3, arg4);
|
|
531
531
|
}
|
|
532
532
|
|
|
533
533
|
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
534
|
-
wasm.
|
|
534
|
+
wasm.closure928_externref_shim(arg0, arg1, arg2, arg3);
|
|
535
535
|
}
|
|
536
536
|
|
|
537
537
|
async function __wbg_load(module, imports) {
|
|
@@ -580,11 +580,11 @@ function __wbg_get_imports() {
|
|
|
580
580
|
const ret = arg0.call(arg1, arg2, arg3);
|
|
581
581
|
return ret;
|
|
582
582
|
}, arguments) };
|
|
583
|
-
imports.wbg.
|
|
583
|
+
imports.wbg.__wbg_constructor_536364f6bcd4616b = function(arg0) {
|
|
584
584
|
const ret = new Error(arg0);
|
|
585
585
|
return ret;
|
|
586
586
|
};
|
|
587
|
-
imports.wbg.
|
|
587
|
+
imports.wbg.__wbg_constructor_66e92e9c3ecae9e8 = function(arg0) {
|
|
588
588
|
const ret = new Error(arg0);
|
|
589
589
|
return ret;
|
|
590
590
|
};
|
|
@@ -685,10 +685,6 @@ function __wbg_get_imports() {
|
|
|
685
685
|
state0.a = state0.b = 0;
|
|
686
686
|
}
|
|
687
687
|
};
|
|
688
|
-
imports.wbg.__wbg_new_36c79b224aeafbf0 = function() {
|
|
689
|
-
const ret = new Array();
|
|
690
|
-
return ret;
|
|
691
|
-
};
|
|
692
688
|
imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
|
|
693
689
|
const ret = new Map();
|
|
694
690
|
return ret;
|
|
@@ -701,14 +697,18 @@ function __wbg_get_imports() {
|
|
|
701
697
|
const ret = new Error();
|
|
702
698
|
return ret;
|
|
703
699
|
};
|
|
704
|
-
imports.wbg.
|
|
705
|
-
const ret = new
|
|
700
|
+
imports.wbg.__wbg_new_9f501325818b4158 = function() {
|
|
701
|
+
const ret = new Array();
|
|
706
702
|
return ret;
|
|
707
703
|
};
|
|
708
704
|
imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
|
|
709
705
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
710
706
|
return ret;
|
|
711
707
|
};
|
|
708
|
+
imports.wbg.__wbg_new_ec40611a7805f1f0 = function() {
|
|
709
|
+
const ret = new Map();
|
|
710
|
+
return ret;
|
|
711
|
+
};
|
|
712
712
|
imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
713
713
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
714
714
|
return ret;
|
|
@@ -797,8 +797,8 @@ function __wbg_get_imports() {
|
|
|
797
797
|
const ret = false;
|
|
798
798
|
return ret;
|
|
799
799
|
};
|
|
800
|
-
imports.wbg.
|
|
801
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
800
|
+
imports.wbg.__wbindgen_closure_wrapper1364 = function(arg0, arg1, arg2) {
|
|
801
|
+
const ret = makeMutClosure(arg0, arg1, 446, __wbg_adapter_30);
|
|
802
802
|
return ret;
|
|
803
803
|
};
|
|
804
804
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
package/web/acvm_js_bg.wasm
CHANGED
|
Binary file
|
package/web/acvm_js_bg.wasm.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
5
|
-
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
6
|
-
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
7
|
-
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
8
|
-
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
9
|
-
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
10
|
-
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
11
4
|
export const buildInfo: () => any;
|
|
12
|
-
export const
|
|
13
|
-
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
14
|
-
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
15
|
-
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
5
|
+
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
16
6
|
export const and: (a: any, b: any) => any;
|
|
17
7
|
export const xor: (a: any, b: any) => any;
|
|
18
8
|
export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
19
9
|
export const blake2s256: (a: number, b: number) => [number, number];
|
|
20
10
|
export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
21
11
|
export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
12
|
+
export const compressWitness: (a: any) => [number, number, number, number];
|
|
13
|
+
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
14
|
+
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
15
|
+
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
16
|
+
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
17
|
+
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
18
|
+
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
19
|
+
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
20
|
+
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
21
|
+
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
22
22
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
23
23
|
export const __externref_table_alloc: () => number;
|
|
24
24
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -27,7 +27,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
|
27
27
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
28
28
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
29
29
|
export const __externref_table_dealloc: (a: number) => void;
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
30
|
+
export const closure445_externref_shim: (a: number, b: number, c: any) => void;
|
|
31
|
+
export const closure924_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
32
|
+
export const closure928_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
33
33
|
export const __wbindgen_start: () => void;
|