@aztec/noir-acvm_js 0.0.1-commit.c7c42ec → 0.0.1-commit.d1f2d6c

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.
@@ -35,39 +35,29 @@ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
35
35
  */
36
36
  export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
37
37
  /**
38
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
39
- *
40
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
41
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
42
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
43
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
38
+ * Performs a bitwise AND operation between `lhs` and `rhs`
44
39
  */
45
- export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
40
+ export function and(lhs: string, rhs: string): string;
46
41
  /**
47
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
48
- * This method also extracts the public return values from the solved witness into its own return witness.
49
- *
50
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
51
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
52
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
53
- * @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.
42
+ * Performs a bitwise XOR operation between `lhs` and `rhs`
54
43
  */
55
- export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
44
+ export function xor(lhs: string, rhs: string): string;
56
45
  /**
57
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
58
- *
59
- * @param {Uint8Array} program - A serialized representation of an ACIR program
60
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
61
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
62
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
46
+ * Sha256 compression function
63
47
  */
64
- export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
48
+ export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
65
49
  /**
66
- * Sets the package's logging level.
67
- *
68
- * @param {LogLevel} level - The maximum level of logging to be emitted.
50
+ * Calculates the Blake2s256 hash of the input bytes
69
51
  */
70
- export function initLogLevel(filter: string): void;
52
+ export function blake2s256(inputs: Uint8Array): Uint8Array;
53
+ /**
54
+ * Verifies a ECDSA signature over the secp256k1 curve.
55
+ */
56
+ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
57
+ /**
58
+ * Verifies a ECDSA signature over the secp256r1 curve.
59
+ */
60
+ export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
71
61
  /**
72
62
  * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
73
63
  *
@@ -93,29 +83,48 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
93
83
  */
94
84
  export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
95
85
  /**
96
- * Performs a bitwise AND operation between `lhs` and `rhs`
97
- */
98
- export function and(lhs: string, rhs: string): string;
99
- /**
100
- * Performs a bitwise XOR operation between `lhs` and `rhs`
101
- */
102
- export function xor(lhs: string, rhs: string): string;
103
- /**
104
- * Sha256 compression function
86
+ * Sets the package's logging level.
87
+ *
88
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
105
89
  */
106
- export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
90
+ export function initLogLevel(filter: string): void;
107
91
  /**
108
- * Calculates the Blake2s256 hash of the input bytes
92
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
93
+ *
94
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
95
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
96
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
97
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
109
98
  */
110
- export function blake2s256(inputs: Uint8Array): Uint8Array;
99
+ export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
111
100
  /**
112
- * Verifies a ECDSA signature over the secp256k1 curve.
101
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
102
+ * This method also extracts the public return values from the solved witness into its own return witness.
103
+ *
104
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
105
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
106
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
107
+ * @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.
113
108
  */
114
- export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
109
+ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
115
110
  /**
116
- * Verifies a ECDSA signature over the secp256r1 curve.
111
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
112
+ *
113
+ * @param {Uint8Array} program - A serialized representation of an ACIR program
114
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
115
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
116
+ * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
117
117
  */
118
- export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
118
+ export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
119
+
120
+ export type StackItem = {
121
+ index: number;
122
+ witness: WitnessMap;
123
+ }
124
+
125
+ export type WitnessStack = Array<StackItem>;
126
+
127
+
119
128
 
120
129
  /**
121
130
  * @typedef {Object} BuildInfo - Information about how the installed package was built
@@ -146,12 +155,17 @@ export type SolvedAndReturnWitness = {
146
155
 
147
156
 
148
157
 
149
- export type StackItem = {
150
- index: number;
151
- witness: WitnessMap;
152
- }
158
+ export type RawAssertionPayload = {
159
+ selector: string;
160
+ data: string[];
161
+ };
153
162
 
154
- export type WitnessStack = Array<StackItem>;
163
+ export type ExecutionError = Error & {
164
+ callStack?: string[];
165
+ rawAssertionPayload?: RawAssertionPayload;
166
+ acirFunctionId?: number;
167
+ brilligFunctionId?: number;
168
+ };
155
169
 
156
170
 
157
171
 
@@ -168,17 +182,3 @@ export type ForeignCallOutput = string | string[]
168
182
  export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
169
183
 
170
184
 
171
-
172
- export type RawAssertionPayload = {
173
- selector: string;
174
- data: string[];
175
- };
176
-
177
- export type ExecutionError = Error & {
178
- callStack?: string[];
179
- rawAssertionPayload?: RawAssertionPayload;
180
- acirFunctionId?: number;
181
- brilligFunctionId?: number;
182
- };
183
-
184
-
package/nodejs/acvm_js.js CHANGED
@@ -291,126 +291,6 @@ module.exports.decompressWitnessStack = function(compressed_witness) {
291
291
  return takeFromExternrefTable0(ret[0]);
292
292
  };
293
293
 
294
- /**
295
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
296
- *
297
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
298
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
299
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
300
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
301
- */
302
- module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
303
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
304
- const len0 = WASM_VECTOR_LEN;
305
- const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
306
- return ret;
307
- };
308
-
309
- /**
310
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
311
- * This method also extracts the public return values from the solved witness into its own return witness.
312
- *
313
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
314
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
315
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
316
- * @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.
317
- */
318
- module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
319
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
320
- const len0 = WASM_VECTOR_LEN;
321
- const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
322
- return ret;
323
- };
324
-
325
- /**
326
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
327
- *
328
- * @param {Uint8Array} program - A serialized representation of an ACIR program
329
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
330
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
331
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
332
- */
333
- module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
334
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
335
- const len0 = WASM_VECTOR_LEN;
336
- const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
337
- return ret;
338
- };
339
-
340
- /**
341
- * Sets the package's logging level.
342
- *
343
- * @param {LogLevel} level - The maximum level of logging to be emitted.
344
- */
345
- module.exports.initLogLevel = function(filter) {
346
- const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
347
- const len0 = WASM_VECTOR_LEN;
348
- const ret = wasm.initLogLevel(ptr0, len0);
349
- if (ret[1]) {
350
- throw takeFromExternrefTable0(ret[0]);
351
- }
352
- };
353
-
354
- /**
355
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
356
- *
357
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
358
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
359
- * @returns {WitnessMap} A witness map containing the circuit's return values.
360
- * @param {Uint8Array} program
361
- * @param {WitnessMap} witness_map
362
- * @returns {WitnessMap}
363
- */
364
- module.exports.getReturnWitness = function(program, witness_map) {
365
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
366
- const len0 = WASM_VECTOR_LEN;
367
- const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
368
- if (ret[2]) {
369
- throw takeFromExternrefTable0(ret[1]);
370
- }
371
- return takeFromExternrefTable0(ret[0]);
372
- };
373
-
374
- /**
375
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
376
- *
377
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
378
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
379
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
380
- * @param {Uint8Array} program
381
- * @param {WitnessMap} solved_witness
382
- * @returns {WitnessMap}
383
- */
384
- module.exports.getPublicParametersWitness = function(program, solved_witness) {
385
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
386
- const len0 = WASM_VECTOR_LEN;
387
- const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
388
- if (ret[2]) {
389
- throw takeFromExternrefTable0(ret[1]);
390
- }
391
- return takeFromExternrefTable0(ret[0]);
392
- };
393
-
394
- /**
395
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
396
- *
397
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
398
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
399
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
400
- * @param {Uint8Array} program
401
- * @param {WitnessMap} solved_witness
402
- * @returns {WitnessMap}
403
- */
404
- module.exports.getPublicWitness = function(program, solved_witness) {
405
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
406
- const len0 = WASM_VECTOR_LEN;
407
- const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
408
- if (ret[2]) {
409
- throw takeFromExternrefTable0(ret[1]);
410
- }
411
- return takeFromExternrefTable0(ret[0]);
412
- };
413
-
414
294
  /**
415
295
  * Performs a bitwise AND operation between `lhs` and `rhs`
416
296
  * @param {string} lhs
@@ -526,16 +406,136 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
526
406
  return ret !== 0;
527
407
  };
528
408
 
409
+ /**
410
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
411
+ *
412
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
413
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
414
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
415
+ * @param {Uint8Array} program
416
+ * @param {WitnessMap} witness_map
417
+ * @returns {WitnessMap}
418
+ */
419
+ module.exports.getReturnWitness = function(program, witness_map) {
420
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
421
+ const len0 = WASM_VECTOR_LEN;
422
+ const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
423
+ if (ret[2]) {
424
+ throw takeFromExternrefTable0(ret[1]);
425
+ }
426
+ return takeFromExternrefTable0(ret[0]);
427
+ };
428
+
429
+ /**
430
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
431
+ *
432
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
433
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
434
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
435
+ * @param {Uint8Array} program
436
+ * @param {WitnessMap} solved_witness
437
+ * @returns {WitnessMap}
438
+ */
439
+ module.exports.getPublicParametersWitness = function(program, solved_witness) {
440
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
441
+ const len0 = WASM_VECTOR_LEN;
442
+ const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
443
+ if (ret[2]) {
444
+ throw takeFromExternrefTable0(ret[1]);
445
+ }
446
+ return takeFromExternrefTable0(ret[0]);
447
+ };
448
+
449
+ /**
450
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
451
+ *
452
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
453
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
454
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
455
+ * @param {Uint8Array} program
456
+ * @param {WitnessMap} solved_witness
457
+ * @returns {WitnessMap}
458
+ */
459
+ module.exports.getPublicWitness = function(program, solved_witness) {
460
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
461
+ const len0 = WASM_VECTOR_LEN;
462
+ const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
463
+ if (ret[2]) {
464
+ throw takeFromExternrefTable0(ret[1]);
465
+ }
466
+ return takeFromExternrefTable0(ret[0]);
467
+ };
468
+
469
+ /**
470
+ * Sets the package's logging level.
471
+ *
472
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
473
+ */
474
+ module.exports.initLogLevel = function(filter) {
475
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
476
+ const len0 = WASM_VECTOR_LEN;
477
+ const ret = wasm.initLogLevel(ptr0, len0);
478
+ if (ret[1]) {
479
+ throw takeFromExternrefTable0(ret[0]);
480
+ }
481
+ };
482
+
483
+ /**
484
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
485
+ *
486
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
487
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
488
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
489
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
490
+ */
491
+ module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
492
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
493
+ const len0 = WASM_VECTOR_LEN;
494
+ const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
495
+ return ret;
496
+ };
497
+
498
+ /**
499
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
500
+ * This method also extracts the public return values from the solved witness into its own return witness.
501
+ *
502
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
503
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
504
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
505
+ * @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.
506
+ */
507
+ module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
508
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
509
+ const len0 = WASM_VECTOR_LEN;
510
+ const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
511
+ return ret;
512
+ };
513
+
514
+ /**
515
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
516
+ *
517
+ * @param {Uint8Array} program - A serialized representation of an ACIR program
518
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
519
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
520
+ * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
521
+ */
522
+ module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
523
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
524
+ const len0 = WASM_VECTOR_LEN;
525
+ const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
526
+ return ret;
527
+ };
528
+
529
529
  function __wbg_adapter_30(arg0, arg1, arg2) {
530
- wasm.closure576_externref_shim(arg0, arg1, arg2);
530
+ wasm.closure448_externref_shim(arg0, arg1, arg2);
531
531
  }
532
532
 
533
533
  function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
534
- wasm.closure1171_externref_shim(arg0, arg1, arg2, arg3, arg4);
534
+ wasm.closure933_externref_shim(arg0, arg1, arg2, arg3, arg4);
535
535
  }
536
536
 
537
537
  function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
538
- wasm.closure1175_externref_shim(arg0, arg1, arg2, arg3);
538
+ wasm.closure937_externref_shim(arg0, arg1, arg2, arg3);
539
539
  }
540
540
 
541
541
  module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
@@ -553,12 +553,12 @@ module.exports.__wbg_call_833bed5770ea2041 = function() { return handleError(fun
553
553
  return ret;
554
554
  }, arguments) };
555
555
 
556
- module.exports.__wbg_constructor_3aef6db465a4d40f = function(arg0) {
556
+ module.exports.__wbg_constructor_536364f6bcd4616b = function(arg0) {
557
557
  const ret = new Error(arg0);
558
558
  return ret;
559
559
  };
560
560
 
561
- module.exports.__wbg_constructor_9cd41836d6991f28 = function(arg0) {
561
+ module.exports.__wbg_constructor_66e92e9c3ecae9e8 = function(arg0) {
562
562
  const ret = new Error(arg0);
563
563
  return ret;
564
564
  };
@@ -689,7 +689,7 @@ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
689
689
  return ret;
690
690
  };
691
691
 
692
- module.exports.__wbg_new_8e773a1674584163 = function() {
692
+ module.exports.__wbg_new_9f501325818b4158 = function() {
693
693
  const ret = new Array();
694
694
  return ret;
695
695
  };
@@ -699,7 +699,7 @@ module.exports.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
699
699
  return ret;
700
700
  };
701
701
 
702
- module.exports.__wbg_new_dd245daac54dc568 = function() {
702
+ module.exports.__wbg_new_ec40611a7805f1f0 = function() {
703
703
  const ret = new Map();
704
704
  return ret;
705
705
  };
@@ -813,8 +813,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
813
813
  return ret;
814
814
  };
815
815
 
816
- module.exports.__wbindgen_closure_wrapper1971 = function(arg0, arg1, arg2) {
817
- const ret = makeMutClosure(arg0, arg1, 577, __wbg_adapter_30);
816
+ module.exports.__wbindgen_closure_wrapper1446 = function(arg0, arg1, arg2) {
817
+ const ret = makeMutClosure(arg0, arg1, 449, __wbg_adapter_30);
818
818
  return ret;
819
819
  };
820
820
 
Binary file
@@ -6,19 +6,19 @@ export const compressWitness: (a: any) => [number, number, number, number];
6
6
  export const decompressWitness: (a: number, b: number) => [number, number, number];
7
7
  export const compressWitnessStack: (a: any) => [number, number, number, number];
8
8
  export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
9
- export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
10
- export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
11
- export const executeProgram: (a: number, b: number, c: any, d: any) => any;
12
- export const initLogLevel: (a: number, b: number) => [number, number];
13
- export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
14
- export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
15
- export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
16
9
  export const and: (a: any, b: any) => any;
17
10
  export const xor: (a: any, b: any) => any;
18
11
  export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
19
12
  export const blake2s256: (a: number, b: number) => [number, number];
20
13
  export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
21
14
  export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
15
+ export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
16
+ export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
17
+ export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
18
+ export const initLogLevel: (a: number, b: number) => [number, number];
19
+ export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
20
+ export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
21
+ export const executeProgram: (a: number, b: number, c: any, d: any) => any;
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 closure576_externref_shim: (a: number, b: number, c: any) => void;
31
- export const closure1171_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
- export const closure1175_externref_shim: (a: number, b: number, c: any, d: any) => void;
30
+ export const closure448_externref_shim: (a: number, b: number, c: any) => void;
31
+ export const closure933_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
+ export const closure937_externref_shim: (a: number, b: number, c: any, d: any) => void;
33
33
  export const __wbindgen_start: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/noir-acvm_js",
3
- "version": "0.0.1-commit.c7c42ec",
3
+ "version": "0.0.1-commit.d1f2d6c",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -41,11 +41,11 @@
41
41
  "@web/dev-server-esbuild": "^1.0.4",
42
42
  "@web/test-runner": "^0.20.2",
43
43
  "@web/test-runner-playwright": "^0.11.1",
44
- "chai": "^4.5.0",
45
- "eslint": "^9.39.1",
46
- "eslint-plugin-prettier": "^5.5.4",
47
- "mocha": "^11.5.0",
48
- "prettier": "3.7.3",
44
+ "chai": "^6.2.2",
45
+ "eslint": "^9.39.2",
46
+ "eslint-plugin-prettier": "^5.5.5",
47
+ "mocha": "^11.7.5",
48
+ "prettier": "3.8.0",
49
49
  "ts-node": "^10.9.2",
50
50
  "typescript": "^5.8.3"
51
51
  }
package/web/acvm_js.d.ts CHANGED
@@ -35,39 +35,29 @@ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
35
35
  */
36
36
  export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
37
37
  /**
38
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
39
- *
40
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
41
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
42
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
43
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
38
+ * Performs a bitwise AND operation between `lhs` and `rhs`
44
39
  */
45
- export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
40
+ export function and(lhs: string, rhs: string): string;
46
41
  /**
47
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
48
- * This method also extracts the public return values from the solved witness into its own return witness.
49
- *
50
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
51
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
52
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
53
- * @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.
42
+ * Performs a bitwise XOR operation between `lhs` and `rhs`
54
43
  */
55
- export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
44
+ export function xor(lhs: string, rhs: string): string;
56
45
  /**
57
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
58
- *
59
- * @param {Uint8Array} program - A serialized representation of an ACIR program
60
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
61
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
62
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
46
+ * Sha256 compression function
63
47
  */
64
- export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
48
+ export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
65
49
  /**
66
- * Sets the package's logging level.
67
- *
68
- * @param {LogLevel} level - The maximum level of logging to be emitted.
50
+ * Calculates the Blake2s256 hash of the input bytes
69
51
  */
70
- export function initLogLevel(filter: string): void;
52
+ export function blake2s256(inputs: Uint8Array): Uint8Array;
53
+ /**
54
+ * Verifies a ECDSA signature over the secp256k1 curve.
55
+ */
56
+ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
57
+ /**
58
+ * Verifies a ECDSA signature over the secp256r1 curve.
59
+ */
60
+ export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
71
61
  /**
72
62
  * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
73
63
  *
@@ -93,29 +83,48 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
93
83
  */
94
84
  export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
95
85
  /**
96
- * Performs a bitwise AND operation between `lhs` and `rhs`
97
- */
98
- export function and(lhs: string, rhs: string): string;
99
- /**
100
- * Performs a bitwise XOR operation between `lhs` and `rhs`
101
- */
102
- export function xor(lhs: string, rhs: string): string;
103
- /**
104
- * Sha256 compression function
86
+ * Sets the package's logging level.
87
+ *
88
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
105
89
  */
106
- export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
90
+ export function initLogLevel(filter: string): void;
107
91
  /**
108
- * Calculates the Blake2s256 hash of the input bytes
92
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
93
+ *
94
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
95
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
96
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
97
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
109
98
  */
110
- export function blake2s256(inputs: Uint8Array): Uint8Array;
99
+ export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
111
100
  /**
112
- * Verifies a ECDSA signature over the secp256k1 curve.
101
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
102
+ * This method also extracts the public return values from the solved witness into its own return witness.
103
+ *
104
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
105
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
106
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
107
+ * @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.
113
108
  */
114
- export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
109
+ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
115
110
  /**
116
- * Verifies a ECDSA signature over the secp256r1 curve.
111
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
112
+ *
113
+ * @param {Uint8Array} program - A serialized representation of an ACIR program
114
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
115
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
116
+ * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
117
117
  */
118
- export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
118
+ export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
119
+
120
+ export type StackItem = {
121
+ index: number;
122
+ witness: WitnessMap;
123
+ }
124
+
125
+ export type WitnessStack = Array<StackItem>;
126
+
127
+
119
128
 
120
129
  /**
121
130
  * @typedef {Object} BuildInfo - Information about how the installed package was built
@@ -146,12 +155,17 @@ export type SolvedAndReturnWitness = {
146
155
 
147
156
 
148
157
 
149
- export type StackItem = {
150
- index: number;
151
- witness: WitnessMap;
152
- }
158
+ export type RawAssertionPayload = {
159
+ selector: string;
160
+ data: string[];
161
+ };
153
162
 
154
- export type WitnessStack = Array<StackItem>;
163
+ export type ExecutionError = Error & {
164
+ callStack?: string[];
165
+ rawAssertionPayload?: RawAssertionPayload;
166
+ acirFunctionId?: number;
167
+ brilligFunctionId?: number;
168
+ };
155
169
 
156
170
 
157
171
 
@@ -169,20 +183,6 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
169
183
 
170
184
 
171
185
 
172
- export type RawAssertionPayload = {
173
- selector: string;
174
- data: string[];
175
- };
176
-
177
- export type ExecutionError = Error & {
178
- callStack?: string[];
179
- rawAssertionPayload?: RawAssertionPayload;
180
- acirFunctionId?: number;
181
- brilligFunctionId?: number;
182
- };
183
-
184
-
185
-
186
186
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
187
187
 
188
188
  export interface InitOutput {
@@ -192,19 +192,19 @@ export interface InitOutput {
192
192
  readonly decompressWitness: (a: number, b: number) => [number, number, number];
193
193
  readonly compressWitnessStack: (a: any) => [number, number, number, number];
194
194
  readonly decompressWitnessStack: (a: number, b: number) => [number, number, number];
195
- readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
196
- readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
197
- readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
198
- readonly initLogLevel: (a: number, b: number) => [number, number];
199
- readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
200
- readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
201
- readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
202
195
  readonly and: (a: any, b: any) => any;
203
196
  readonly xor: (a: any, b: any) => any;
204
197
  readonly sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
205
198
  readonly blake2s256: (a: number, b: number) => [number, number];
206
199
  readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
207
200
  readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
201
+ readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
202
+ readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
203
+ readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
204
+ readonly initLogLevel: (a: number, b: number) => [number, number];
205
+ readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
206
+ readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
207
+ readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
208
208
  readonly __wbindgen_exn_store: (a: number) => void;
209
209
  readonly __externref_table_alloc: () => number;
210
210
  readonly __wbindgen_export_2: WebAssembly.Table;
@@ -213,9 +213,9 @@ export interface InitOutput {
213
213
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
214
214
  readonly __wbindgen_export_6: WebAssembly.Table;
215
215
  readonly __externref_table_dealloc: (a: number) => void;
216
- readonly closure576_externref_shim: (a: number, b: number, c: any) => void;
217
- readonly closure1171_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
218
- readonly closure1175_externref_shim: (a: number, b: number, c: any, d: any) => void;
216
+ readonly closure448_externref_shim: (a: number, b: number, c: any) => void;
217
+ readonly closure933_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
218
+ readonly closure937_externref_shim: (a: number, b: number, c: any, d: any) => void;
219
219
  readonly __wbindgen_start: () => void;
220
220
  }
221
221
 
package/web/acvm_js.js CHANGED
@@ -287,126 +287,6 @@ export function decompressWitnessStack(compressed_witness) {
287
287
  return takeFromExternrefTable0(ret[0]);
288
288
  }
289
289
 
290
- /**
291
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
292
- *
293
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
294
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
295
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
296
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
297
- */
298
- export function executeCircuit(program, initial_witness, foreign_call_handler) {
299
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
300
- const len0 = WASM_VECTOR_LEN;
301
- const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
302
- return ret;
303
- }
304
-
305
- /**
306
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
307
- * This method also extracts the public return values from the solved witness into its own return witness.
308
- *
309
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
310
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
311
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
312
- * @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.
313
- */
314
- export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
315
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
316
- const len0 = WASM_VECTOR_LEN;
317
- const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
318
- return ret;
319
- }
320
-
321
- /**
322
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
323
- *
324
- * @param {Uint8Array} program - A serialized representation of an ACIR program
325
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
326
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
327
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
328
- */
329
- export function executeProgram(program, initial_witness, foreign_call_handler) {
330
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
331
- const len0 = WASM_VECTOR_LEN;
332
- const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
333
- return ret;
334
- }
335
-
336
- /**
337
- * Sets the package's logging level.
338
- *
339
- * @param {LogLevel} level - The maximum level of logging to be emitted.
340
- */
341
- export function initLogLevel(filter) {
342
- const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
343
- const len0 = WASM_VECTOR_LEN;
344
- const ret = wasm.initLogLevel(ptr0, len0);
345
- if (ret[1]) {
346
- throw takeFromExternrefTable0(ret[0]);
347
- }
348
- }
349
-
350
- /**
351
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
352
- *
353
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
354
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
355
- * @returns {WitnessMap} A witness map containing the circuit's return values.
356
- * @param {Uint8Array} program
357
- * @param {WitnessMap} witness_map
358
- * @returns {WitnessMap}
359
- */
360
- export function getReturnWitness(program, witness_map) {
361
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
362
- const len0 = WASM_VECTOR_LEN;
363
- const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
364
- if (ret[2]) {
365
- throw takeFromExternrefTable0(ret[1]);
366
- }
367
- return takeFromExternrefTable0(ret[0]);
368
- }
369
-
370
- /**
371
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
372
- *
373
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
374
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
375
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
376
- * @param {Uint8Array} program
377
- * @param {WitnessMap} solved_witness
378
- * @returns {WitnessMap}
379
- */
380
- export function getPublicParametersWitness(program, solved_witness) {
381
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
382
- const len0 = WASM_VECTOR_LEN;
383
- const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
384
- if (ret[2]) {
385
- throw takeFromExternrefTable0(ret[1]);
386
- }
387
- return takeFromExternrefTable0(ret[0]);
388
- }
389
-
390
- /**
391
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
392
- *
393
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
394
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
395
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
396
- * @param {Uint8Array} program
397
- * @param {WitnessMap} solved_witness
398
- * @returns {WitnessMap}
399
- */
400
- export function getPublicWitness(program, solved_witness) {
401
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
402
- const len0 = WASM_VECTOR_LEN;
403
- const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
404
- if (ret[2]) {
405
- throw takeFromExternrefTable0(ret[1]);
406
- }
407
- return takeFromExternrefTable0(ret[0]);
408
- }
409
-
410
290
  /**
411
291
  * Performs a bitwise AND operation between `lhs` and `rhs`
412
292
  * @param {string} lhs
@@ -522,16 +402,136 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
522
402
  return ret !== 0;
523
403
  }
524
404
 
405
+ /**
406
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
407
+ *
408
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
409
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
410
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
411
+ * @param {Uint8Array} program
412
+ * @param {WitnessMap} witness_map
413
+ * @returns {WitnessMap}
414
+ */
415
+ export function getReturnWitness(program, witness_map) {
416
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
417
+ const len0 = WASM_VECTOR_LEN;
418
+ const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
419
+ if (ret[2]) {
420
+ throw takeFromExternrefTable0(ret[1]);
421
+ }
422
+ return takeFromExternrefTable0(ret[0]);
423
+ }
424
+
425
+ /**
426
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
427
+ *
428
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
429
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
430
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
431
+ * @param {Uint8Array} program
432
+ * @param {WitnessMap} solved_witness
433
+ * @returns {WitnessMap}
434
+ */
435
+ export function getPublicParametersWitness(program, solved_witness) {
436
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
437
+ const len0 = WASM_VECTOR_LEN;
438
+ const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
439
+ if (ret[2]) {
440
+ throw takeFromExternrefTable0(ret[1]);
441
+ }
442
+ return takeFromExternrefTable0(ret[0]);
443
+ }
444
+
445
+ /**
446
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
447
+ *
448
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
449
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
450
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
451
+ * @param {Uint8Array} program
452
+ * @param {WitnessMap} solved_witness
453
+ * @returns {WitnessMap}
454
+ */
455
+ export function getPublicWitness(program, solved_witness) {
456
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
457
+ const len0 = WASM_VECTOR_LEN;
458
+ const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
459
+ if (ret[2]) {
460
+ throw takeFromExternrefTable0(ret[1]);
461
+ }
462
+ return takeFromExternrefTable0(ret[0]);
463
+ }
464
+
465
+ /**
466
+ * Sets the package's logging level.
467
+ *
468
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
469
+ */
470
+ export function initLogLevel(filter) {
471
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
472
+ const len0 = WASM_VECTOR_LEN;
473
+ const ret = wasm.initLogLevel(ptr0, len0);
474
+ if (ret[1]) {
475
+ throw takeFromExternrefTable0(ret[0]);
476
+ }
477
+ }
478
+
479
+ /**
480
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
481
+ *
482
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
483
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
484
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
485
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
486
+ */
487
+ export function executeCircuit(program, initial_witness, foreign_call_handler) {
488
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
489
+ const len0 = WASM_VECTOR_LEN;
490
+ const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
491
+ return ret;
492
+ }
493
+
494
+ /**
495
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
496
+ * This method also extracts the public return values from the solved witness into its own return witness.
497
+ *
498
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
499
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
500
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
501
+ * @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.
502
+ */
503
+ export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
504
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
505
+ const len0 = WASM_VECTOR_LEN;
506
+ const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
507
+ return ret;
508
+ }
509
+
510
+ /**
511
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
512
+ *
513
+ * @param {Uint8Array} program - A serialized representation of an ACIR program
514
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
515
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
516
+ * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
517
+ */
518
+ export function executeProgram(program, initial_witness, foreign_call_handler) {
519
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
520
+ const len0 = WASM_VECTOR_LEN;
521
+ const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
522
+ return ret;
523
+ }
524
+
525
525
  function __wbg_adapter_30(arg0, arg1, arg2) {
526
- wasm.closure576_externref_shim(arg0, arg1, arg2);
526
+ wasm.closure448_externref_shim(arg0, arg1, arg2);
527
527
  }
528
528
 
529
529
  function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
530
- wasm.closure1171_externref_shim(arg0, arg1, arg2, arg3, arg4);
530
+ wasm.closure933_externref_shim(arg0, arg1, arg2, arg3, arg4);
531
531
  }
532
532
 
533
533
  function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
534
- wasm.closure1175_externref_shim(arg0, arg1, arg2, arg3);
534
+ wasm.closure937_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.__wbg_constructor_3aef6db465a4d40f = function(arg0) {
583
+ imports.wbg.__wbg_constructor_536364f6bcd4616b = function(arg0) {
584
584
  const ret = new Error(arg0);
585
585
  return ret;
586
586
  };
587
- imports.wbg.__wbg_constructor_9cd41836d6991f28 = function(arg0) {
587
+ imports.wbg.__wbg_constructor_66e92e9c3ecae9e8 = function(arg0) {
588
588
  const ret = new Error(arg0);
589
589
  return ret;
590
590
  };
@@ -697,7 +697,7 @@ function __wbg_get_imports() {
697
697
  const ret = new Error();
698
698
  return ret;
699
699
  };
700
- imports.wbg.__wbg_new_8e773a1674584163 = function() {
700
+ imports.wbg.__wbg_new_9f501325818b4158 = function() {
701
701
  const ret = new Array();
702
702
  return ret;
703
703
  };
@@ -705,7 +705,7 @@ function __wbg_get_imports() {
705
705
  const ret = new Error(getStringFromWasm0(arg0, arg1));
706
706
  return ret;
707
707
  };
708
- imports.wbg.__wbg_new_dd245daac54dc568 = function() {
708
+ imports.wbg.__wbg_new_ec40611a7805f1f0 = function() {
709
709
  const ret = new Map();
710
710
  return ret;
711
711
  };
@@ -797,8 +797,8 @@ function __wbg_get_imports() {
797
797
  const ret = false;
798
798
  return ret;
799
799
  };
800
- imports.wbg.__wbindgen_closure_wrapper1971 = function(arg0, arg1, arg2) {
801
- const ret = makeMutClosure(arg0, arg1, 577, __wbg_adapter_30);
800
+ imports.wbg.__wbindgen_closure_wrapper1446 = function(arg0, arg1, arg2) {
801
+ const ret = makeMutClosure(arg0, arg1, 449, __wbg_adapter_30);
802
802
  return ret;
803
803
  };
804
804
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
Binary file
@@ -6,19 +6,19 @@ export const compressWitness: (a: any) => [number, number, number, number];
6
6
  export const decompressWitness: (a: number, b: number) => [number, number, number];
7
7
  export const compressWitnessStack: (a: any) => [number, number, number, number];
8
8
  export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
9
- export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
10
- export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
11
- export const executeProgram: (a: number, b: number, c: any, d: any) => any;
12
- export const initLogLevel: (a: number, b: number) => [number, number];
13
- export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
14
- export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
15
- export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
16
9
  export const and: (a: any, b: any) => any;
17
10
  export const xor: (a: any, b: any) => any;
18
11
  export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
19
12
  export const blake2s256: (a: number, b: number) => [number, number];
20
13
  export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
21
14
  export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
15
+ export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
16
+ export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
17
+ export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
18
+ export const initLogLevel: (a: number, b: number) => [number, number];
19
+ export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
20
+ export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
21
+ export const executeProgram: (a: number, b: number, c: any, d: any) => any;
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 closure576_externref_shim: (a: number, b: number, c: any) => void;
31
- export const closure1171_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
- export const closure1175_externref_shim: (a: number, b: number, c: any, d: any) => void;
30
+ export const closure448_externref_shim: (a: number, b: number, c: any) => void;
31
+ export const closure933_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
+ export const closure937_externref_shim: (a: number, b: number, c: any, d: any) => void;
33
33
  export const __wbindgen_start: () => void;