@aztec/noir-acvm_js 4.0.0-nightly.20260120 → 4.0.0-nightly.20260121

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.
@@ -5,12 +5,6 @@
5
5
  * @returns {BuildInfo} - Information on how the installed package was built.
6
6
  */
7
7
  export function buildInfo(): BuildInfo;
8
- /**
9
- * Sets the package's logging level.
10
- *
11
- * @param {LogLevel} level - The maximum level of logging to be emitted.
12
- */
13
- export function initLogLevel(filter: string): void;
14
8
  /**
15
9
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
16
10
  *
@@ -39,30 +33,6 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
39
33
  * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
40
34
  */
41
35
  export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
42
- /**
43
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
44
- *
45
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
46
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
47
- * @returns {WitnessMap} A witness map containing the circuit's return values.
48
- */
49
- export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
50
- /**
51
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
52
- *
53
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
54
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
55
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
56
- */
57
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
58
- /**
59
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
60
- *
61
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
62
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
63
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
64
- */
65
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
66
36
  /**
67
37
  * Compresses a `WitnessMap` into the binary format outputted by Nargo.
68
38
  *
@@ -116,6 +86,45 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
116
86
  * Verifies a ECDSA signature over the secp256r1 curve.
117
87
  */
118
88
  export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
89
+ /**
90
+ * Sets the package's logging level.
91
+ *
92
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
93
+ */
94
+ export function initLogLevel(filter: string): void;
95
+ /**
96
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
97
+ *
98
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
99
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
100
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
101
+ */
102
+ export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
103
+ /**
104
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
105
+ *
106
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
107
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
108
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
109
+ */
110
+ export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
111
+ /**
112
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
113
+ *
114
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
115
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
116
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
117
+ */
118
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
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
@@ -173,12 +182,3 @@ export type ForeignCallOutput = string | string[]
173
182
  export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
174
183
 
175
184
 
176
-
177
- export type StackItem = {
178
- index: number;
179
- witness: WitnessMap;
180
- }
181
-
182
- export type WitnessStack = Array<StackItem>;
183
-
184
-
package/nodejs/acvm_js.js CHANGED
@@ -210,25 +210,6 @@ module.exports.buildInfo = function() {
210
210
  return ret;
211
211
  };
212
212
 
213
- function takeFromExternrefTable0(idx) {
214
- const value = wasm.__wbindgen_export_2.get(idx);
215
- wasm.__externref_table_dealloc(idx);
216
- return value;
217
- }
218
- /**
219
- * Sets the package's logging level.
220
- *
221
- * @param {LogLevel} level - The maximum level of logging to be emitted.
222
- */
223
- module.exports.initLogLevel = function(filter) {
224
- const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
225
- const len0 = WASM_VECTOR_LEN;
226
- const ret = wasm.initLogLevel(ptr0, len0);
227
- if (ret[1]) {
228
- throw takeFromExternrefTable0(ret[0]);
229
- }
230
- };
231
-
232
213
  function passArray8ToWasm0(arg, malloc) {
233
214
  const ptr = malloc(arg.length * 1, 1) >>> 0;
234
215
  getUint8ArrayMemory0().set(arg, ptr / 1);
@@ -281,65 +262,11 @@ module.exports.executeProgram = function(program, initial_witness, foreign_call_
281
262
  return ret;
282
263
  };
283
264
 
284
- /**
285
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
286
- *
287
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
288
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
289
- * @returns {WitnessMap} A witness map containing the circuit's return values.
290
- * @param {Uint8Array} program
291
- * @param {WitnessMap} witness_map
292
- * @returns {WitnessMap}
293
- */
294
- module.exports.getReturnWitness = function(program, witness_map) {
295
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
296
- const len0 = WASM_VECTOR_LEN;
297
- const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
298
- if (ret[2]) {
299
- throw takeFromExternrefTable0(ret[1]);
300
- }
301
- return takeFromExternrefTable0(ret[0]);
302
- };
303
-
304
- /**
305
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
306
- *
307
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
308
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
309
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
310
- * @param {Uint8Array} program
311
- * @param {WitnessMap} solved_witness
312
- * @returns {WitnessMap}
313
- */
314
- module.exports.getPublicParametersWitness = function(program, solved_witness) {
315
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
316
- const len0 = WASM_VECTOR_LEN;
317
- const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
318
- if (ret[2]) {
319
- throw takeFromExternrefTable0(ret[1]);
320
- }
321
- return takeFromExternrefTable0(ret[0]);
322
- };
323
-
324
- /**
325
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
326
- *
327
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
328
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
329
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
330
- * @param {Uint8Array} program
331
- * @param {WitnessMap} solved_witness
332
- * @returns {WitnessMap}
333
- */
334
- module.exports.getPublicWitness = function(program, solved_witness) {
335
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
336
- const len0 = WASM_VECTOR_LEN;
337
- const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
338
- if (ret[2]) {
339
- throw takeFromExternrefTable0(ret[1]);
340
- }
341
- return takeFromExternrefTable0(ret[0]);
342
- };
265
+ function takeFromExternrefTable0(idx) {
266
+ const value = wasm.__wbindgen_export_2.get(idx);
267
+ wasm.__externref_table_dealloc(idx);
268
+ return value;
269
+ }
343
270
 
344
271
  function getArrayU8FromWasm0(ptr, len) {
345
272
  ptr = ptr >>> 0;
@@ -525,6 +452,80 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
525
452
  return ret !== 0;
526
453
  };
527
454
 
455
+ /**
456
+ * Sets the package's logging level.
457
+ *
458
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
459
+ */
460
+ module.exports.initLogLevel = function(filter) {
461
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
462
+ const len0 = WASM_VECTOR_LEN;
463
+ const ret = wasm.initLogLevel(ptr0, len0);
464
+ if (ret[1]) {
465
+ throw takeFromExternrefTable0(ret[0]);
466
+ }
467
+ };
468
+
469
+ /**
470
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
471
+ *
472
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
473
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
474
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
475
+ * @param {Uint8Array} program
476
+ * @param {WitnessMap} witness_map
477
+ * @returns {WitnessMap}
478
+ */
479
+ module.exports.getReturnWitness = function(program, witness_map) {
480
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
481
+ const len0 = WASM_VECTOR_LEN;
482
+ const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
483
+ if (ret[2]) {
484
+ throw takeFromExternrefTable0(ret[1]);
485
+ }
486
+ return takeFromExternrefTable0(ret[0]);
487
+ };
488
+
489
+ /**
490
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
491
+ *
492
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
493
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
494
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
495
+ * @param {Uint8Array} program
496
+ * @param {WitnessMap} solved_witness
497
+ * @returns {WitnessMap}
498
+ */
499
+ module.exports.getPublicParametersWitness = function(program, solved_witness) {
500
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
501
+ const len0 = WASM_VECTOR_LEN;
502
+ const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
503
+ if (ret[2]) {
504
+ throw takeFromExternrefTable0(ret[1]);
505
+ }
506
+ return takeFromExternrefTable0(ret[0]);
507
+ };
508
+
509
+ /**
510
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
511
+ *
512
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
513
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
514
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
515
+ * @param {Uint8Array} program
516
+ * @param {WitnessMap} solved_witness
517
+ * @returns {WitnessMap}
518
+ */
519
+ module.exports.getPublicWitness = function(program, solved_witness) {
520
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
521
+ const len0 = WASM_VECTOR_LEN;
522
+ const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
523
+ if (ret[2]) {
524
+ throw takeFromExternrefTable0(ret[1]);
525
+ }
526
+ return takeFromExternrefTable0(ret[0]);
527
+ };
528
+
528
529
  function __wbg_adapter_30(arg0, arg1, arg2) {
529
530
  wasm.closure447_externref_shim(arg0, arg1, arg2);
530
531
  }
@@ -812,7 +813,7 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
812
813
  return ret;
813
814
  };
814
815
 
815
- module.exports.__wbindgen_closure_wrapper1447 = function(arg0, arg1, arg2) {
816
+ module.exports.__wbindgen_closure_wrapper1443 = function(arg0, arg1, arg2) {
816
817
  const ret = makeMutClosure(arg0, arg1, 448, __wbg_adapter_30);
817
818
  return ret;
818
819
  };
Binary file
@@ -2,13 +2,9 @@
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
4
  export const buildInfo: () => any;
5
- export const initLogLevel: (a: number, b: number) => [number, number];
6
5
  export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
7
6
  export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
8
7
  export const executeProgram: (a: number, b: number, c: any, d: any) => any;
9
- export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
10
- export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
11
- export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
12
8
  export const compressWitness: (a: any) => [number, number, number, number];
13
9
  export const decompressWitness: (a: number, b: number) => [number, number, number];
14
10
  export const compressWitnessStack: (a: any) => [number, number, number, number];
@@ -19,6 +15,10 @@ export const sha256_compression: (a: number, b: number, c: number, d: number) =>
19
15
  export const blake2s256: (a: number, b: number) => [number, number];
20
16
  export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
21
17
  export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
18
+ export const initLogLevel: (a: number, b: number) => [number, number];
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/noir-acvm_js",
3
- "version": "4.0.0-nightly.20260120",
3
+ "version": "4.0.0-nightly.20260121",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/web/acvm_js.d.ts CHANGED
@@ -5,12 +5,6 @@
5
5
  * @returns {BuildInfo} - Information on how the installed package was built.
6
6
  */
7
7
  export function buildInfo(): BuildInfo;
8
- /**
9
- * Sets the package's logging level.
10
- *
11
- * @param {LogLevel} level - The maximum level of logging to be emitted.
12
- */
13
- export function initLogLevel(filter: string): void;
14
8
  /**
15
9
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
16
10
  *
@@ -39,30 +33,6 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
39
33
  * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
40
34
  */
41
35
  export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
42
- /**
43
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
44
- *
45
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
46
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
47
- * @returns {WitnessMap} A witness map containing the circuit's return values.
48
- */
49
- export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
50
- /**
51
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
52
- *
53
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
54
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
55
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
56
- */
57
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
58
- /**
59
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
60
- *
61
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
62
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
63
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
64
- */
65
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
66
36
  /**
67
37
  * Compresses a `WitnessMap` into the binary format outputted by Nargo.
68
38
  *
@@ -116,6 +86,45 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
116
86
  * Verifies a ECDSA signature over the secp256r1 curve.
117
87
  */
118
88
  export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
89
+ /**
90
+ * Sets the package's logging level.
91
+ *
92
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
93
+ */
94
+ export function initLogLevel(filter: string): void;
95
+ /**
96
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
97
+ *
98
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
99
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
100
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
101
+ */
102
+ export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
103
+ /**
104
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
105
+ *
106
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
107
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
108
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
109
+ */
110
+ export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
111
+ /**
112
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
113
+ *
114
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
115
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
116
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
117
+ */
118
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
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
@@ -174,27 +183,14 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
174
183
 
175
184
 
176
185
 
177
- export type StackItem = {
178
- index: number;
179
- witness: WitnessMap;
180
- }
181
-
182
- export type WitnessStack = Array<StackItem>;
183
-
184
-
185
-
186
186
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
187
187
 
188
188
  export interface InitOutput {
189
189
  readonly memory: WebAssembly.Memory;
190
190
  readonly buildInfo: () => any;
191
- readonly initLogLevel: (a: number, b: number) => [number, number];
192
191
  readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
193
192
  readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
194
193
  readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
195
- readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
196
- readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
197
- readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
198
194
  readonly compressWitness: (a: any) => [number, number, number, number];
199
195
  readonly decompressWitness: (a: number, b: number) => [number, number, number];
200
196
  readonly compressWitnessStack: (a: any) => [number, number, number, number];
@@ -205,6 +201,10 @@ export interface InitOutput {
205
201
  readonly blake2s256: (a: number, b: number) => [number, number];
206
202
  readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
207
203
  readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
204
+ readonly initLogLevel: (a: number, b: number) => [number, number];
205
+ readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
206
+ readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
207
+ readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
208
208
  readonly __wbindgen_exn_store: (a: number) => void;
209
209
  readonly __externref_table_alloc: () => number;
210
210
  readonly __wbindgen_export_2: WebAssembly.Table;
package/web/acvm_js.js CHANGED
@@ -206,25 +206,6 @@ export function buildInfo() {
206
206
  return ret;
207
207
  }
208
208
 
209
- function takeFromExternrefTable0(idx) {
210
- const value = wasm.__wbindgen_export_2.get(idx);
211
- wasm.__externref_table_dealloc(idx);
212
- return value;
213
- }
214
- /**
215
- * Sets the package's logging level.
216
- *
217
- * @param {LogLevel} level - The maximum level of logging to be emitted.
218
- */
219
- export function initLogLevel(filter) {
220
- const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
221
- const len0 = WASM_VECTOR_LEN;
222
- const ret = wasm.initLogLevel(ptr0, len0);
223
- if (ret[1]) {
224
- throw takeFromExternrefTable0(ret[0]);
225
- }
226
- }
227
-
228
209
  function passArray8ToWasm0(arg, malloc) {
229
210
  const ptr = malloc(arg.length * 1, 1) >>> 0;
230
211
  getUint8ArrayMemory0().set(arg, ptr / 1);
@@ -277,64 +258,10 @@ export function executeProgram(program, initial_witness, foreign_call_handler) {
277
258
  return ret;
278
259
  }
279
260
 
280
- /**
281
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
282
- *
283
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
284
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
285
- * @returns {WitnessMap} A witness map containing the circuit's return values.
286
- * @param {Uint8Array} program
287
- * @param {WitnessMap} witness_map
288
- * @returns {WitnessMap}
289
- */
290
- export function getReturnWitness(program, witness_map) {
291
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
292
- const len0 = WASM_VECTOR_LEN;
293
- const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
294
- if (ret[2]) {
295
- throw takeFromExternrefTable0(ret[1]);
296
- }
297
- return takeFromExternrefTable0(ret[0]);
298
- }
299
-
300
- /**
301
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
302
- *
303
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
304
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
305
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
306
- * @param {Uint8Array} program
307
- * @param {WitnessMap} solved_witness
308
- * @returns {WitnessMap}
309
- */
310
- export function getPublicParametersWitness(program, solved_witness) {
311
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
312
- const len0 = WASM_VECTOR_LEN;
313
- const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
314
- if (ret[2]) {
315
- throw takeFromExternrefTable0(ret[1]);
316
- }
317
- return takeFromExternrefTable0(ret[0]);
318
- }
319
-
320
- /**
321
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
322
- *
323
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
324
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
325
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
326
- * @param {Uint8Array} program
327
- * @param {WitnessMap} solved_witness
328
- * @returns {WitnessMap}
329
- */
330
- export function getPublicWitness(program, solved_witness) {
331
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
332
- const len0 = WASM_VECTOR_LEN;
333
- const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
334
- if (ret[2]) {
335
- throw takeFromExternrefTable0(ret[1]);
336
- }
337
- return takeFromExternrefTable0(ret[0]);
261
+ function takeFromExternrefTable0(idx) {
262
+ const value = wasm.__wbindgen_export_2.get(idx);
263
+ wasm.__externref_table_dealloc(idx);
264
+ return value;
338
265
  }
339
266
 
340
267
  function getArrayU8FromWasm0(ptr, len) {
@@ -521,6 +448,80 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
521
448
  return ret !== 0;
522
449
  }
523
450
 
451
+ /**
452
+ * Sets the package's logging level.
453
+ *
454
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
455
+ */
456
+ export function initLogLevel(filter) {
457
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
458
+ const len0 = WASM_VECTOR_LEN;
459
+ const ret = wasm.initLogLevel(ptr0, len0);
460
+ if (ret[1]) {
461
+ throw takeFromExternrefTable0(ret[0]);
462
+ }
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
+
524
525
  function __wbg_adapter_30(arg0, arg1, arg2) {
525
526
  wasm.closure447_externref_shim(arg0, arg1, arg2);
526
527
  }
@@ -796,7 +797,7 @@ function __wbg_get_imports() {
796
797
  const ret = false;
797
798
  return ret;
798
799
  };
799
- imports.wbg.__wbindgen_closure_wrapper1447 = function(arg0, arg1, arg2) {
800
+ imports.wbg.__wbindgen_closure_wrapper1443 = function(arg0, arg1, arg2) {
800
801
  const ret = makeMutClosure(arg0, arg1, 448, __wbg_adapter_30);
801
802
  return ret;
802
803
  };
Binary file
@@ -2,13 +2,9 @@
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
4
  export const buildInfo: () => any;
5
- export const initLogLevel: (a: number, b: number) => [number, number];
6
5
  export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
7
6
  export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
8
7
  export const executeProgram: (a: number, b: number, c: any, d: any) => any;
9
- export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
10
- export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
11
- export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
12
8
  export const compressWitness: (a: any) => [number, number, number, number];
13
9
  export const decompressWitness: (a: number, b: number) => [number, number, number];
14
10
  export const compressWitnessStack: (a: any) => [number, number, number, number];
@@ -19,6 +15,10 @@ export const sha256_compression: (a: number, b: number, c: number, d: number) =>
19
15
  export const blake2s256: (a: number, b: number) => [number, number];
20
16
  export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
21
17
  export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
18
+ export const initLogLevel: (a: number, b: number) => [number, number];
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;