@aztec/noir-acvm_js 2.1.0-rc.9 → 3.0.0-devnet.2

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.
@@ -1,11 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * Sets the package's logging level.
5
- *
6
- * @param {LogLevel} level - The maximum level of logging to be emitted.
7
- */
8
- export function initLogLevel(filter: string): void;
9
3
  /**
10
4
  * Compresses a `WitnessMap` into the binary format outputted by Nargo.
11
5
  *
@@ -64,34 +58,11 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
64
58
  */
65
59
  export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
66
60
  /**
67
- * Performs a bitwise AND operation between `lhs` and `rhs`
68
- */
69
- export function and(lhs: string, rhs: string): string;
70
- /**
71
- * Performs a bitwise XOR operation between `lhs` and `rhs`
72
- */
73
- export function xor(lhs: string, rhs: string): string;
74
- /**
75
- * Sha256 compression function
76
- */
77
- export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
78
- /**
79
- * Calculates the Blake2s256 hash of the input bytes
80
- */
81
- export function blake2s256(inputs: Uint8Array): Uint8Array;
82
- /**
83
- * Verifies a ECDSA signature over the secp256k1 curve.
84
- */
85
- export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
86
- /**
87
- * Verifies a ECDSA signature over the secp256r1 curve.
88
- */
89
- export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
90
- /**
91
- * Returns the `BuildInfo` object containing information about how the installed package was built.
92
- * @returns {BuildInfo} - Information on how the installed package was built.
61
+ * Sets the package's logging level.
62
+ *
63
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
93
64
  */
94
- export function buildInfo(): BuildInfo;
65
+ export function initLogLevel(filter: string): void;
95
66
  /**
96
67
  * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
97
68
  *
@@ -116,29 +87,35 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
116
87
  * @returns {WitnessMap} A witness map containing the circuit's public inputs.
117
88
  */
118
89
  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
-
128
-
129
90
  /**
130
- * @typedef {Object} BuildInfo - Information about how the installed package was built
131
- * @property {string} gitHash - The hash of the git commit from which the package was built.
132
- * @property {string} version - The version of the package at the built git commit.
133
- * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
91
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
92
+ * @returns {BuildInfo} - Information on how the installed package was built.
134
93
  */
135
- export type BuildInfo = {
136
- gitHash: string;
137
- version: string;
138
- dirty: string;
139
- }
140
-
141
-
94
+ export function buildInfo(): BuildInfo;
95
+ /**
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
105
+ */
106
+ export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
107
+ /**
108
+ * Calculates the Blake2s256 hash of the input bytes
109
+ */
110
+ export function blake2s256(inputs: Uint8Array): Uint8Array;
111
+ /**
112
+ * Verifies a ECDSA signature over the secp256k1 curve.
113
+ */
114
+ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
115
+ /**
116
+ * Verifies a ECDSA signature over the secp256r1 curve.
117
+ */
118
+ export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
142
119
 
143
120
  export type RawAssertionPayload = {
144
121
  selector: string;
@@ -154,6 +131,20 @@ export type ExecutionError = Error & {
154
131
 
155
132
 
156
133
 
134
+ export type ForeignCallInput = string[]
135
+ export type ForeignCallOutput = string | string[]
136
+
137
+ /**
138
+ * A callback which performs an foreign call and returns the response.
139
+ * @callback ForeignCallHandler
140
+ * @param {string} name - The identifier for the type of foreign call being performed.
141
+ * @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
142
+ * @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
143
+ */
144
+ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
145
+
146
+
147
+
157
148
  // Map from witness index to hex string value of witness.
158
149
  export type WitnessMap = Map<number, string>;
159
150
 
@@ -169,16 +160,25 @@ export type SolvedAndReturnWitness = {
169
160
 
170
161
 
171
162
 
172
- export type ForeignCallInput = string[]
173
- export type ForeignCallOutput = string | string[]
163
+ export type StackItem = {
164
+ index: number;
165
+ witness: WitnessMap;
166
+ }
167
+
168
+ export type WitnessStack = Array<StackItem>;
169
+
170
+
174
171
 
175
172
  /**
176
- * A callback which performs an foreign call and returns the response.
177
- * @callback ForeignCallHandler
178
- * @param {string} name - The identifier for the type of foreign call being performed.
179
- * @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
180
- * @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
181
- */
182
- export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
173
+ * @typedef {Object} BuildInfo - Information about how the installed package was built
174
+ * @property {string} gitHash - The hash of the git commit from which the package was built.
175
+ * @property {string} version - The version of the package at the built git commit.
176
+ * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
177
+ */
178
+ export type BuildInfo = {
179
+ gitHash: string;
180
+ version: string;
181
+ dirty: string;
182
+ }
183
183
 
184
184
 
package/nodejs/acvm_js.js CHANGED
@@ -207,19 +207,6 @@ function takeFromExternrefTable0(idx) {
207
207
  wasm.__externref_table_dealloc(idx);
208
208
  return value;
209
209
  }
210
- /**
211
- * Sets the package's logging level.
212
- *
213
- * @param {LogLevel} level - The maximum level of logging to be emitted.
214
- */
215
- module.exports.initLogLevel = function(filter) {
216
- const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
217
- const len0 = WASM_VECTOR_LEN;
218
- const ret = wasm.initLogLevel(ptr0, len0);
219
- if (ret[1]) {
220
- throw takeFromExternrefTable0(ret[0]);
221
- }
222
- };
223
210
 
224
211
  function getArrayU8FromWasm0(ptr, len) {
225
212
  ptr = ptr >>> 0;
@@ -342,6 +329,89 @@ module.exports.executeProgram = function(program, initial_witness, foreign_call_
342
329
  return ret;
343
330
  };
344
331
 
332
+ /**
333
+ * Sets the package's logging level.
334
+ *
335
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
336
+ */
337
+ module.exports.initLogLevel = function(filter) {
338
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
339
+ const len0 = WASM_VECTOR_LEN;
340
+ const ret = wasm.initLogLevel(ptr0, len0);
341
+ if (ret[1]) {
342
+ throw takeFromExternrefTable0(ret[0]);
343
+ }
344
+ };
345
+
346
+ /**
347
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
348
+ *
349
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
350
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
351
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
352
+ * @param {Uint8Array} program
353
+ * @param {WitnessMap} witness_map
354
+ * @returns {WitnessMap}
355
+ */
356
+ module.exports.getReturnWitness = function(program, witness_map) {
357
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
358
+ const len0 = WASM_VECTOR_LEN;
359
+ const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
360
+ if (ret[2]) {
361
+ throw takeFromExternrefTable0(ret[1]);
362
+ }
363
+ return takeFromExternrefTable0(ret[0]);
364
+ };
365
+
366
+ /**
367
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
368
+ *
369
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
370
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
371
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
372
+ * @param {Uint8Array} program
373
+ * @param {WitnessMap} solved_witness
374
+ * @returns {WitnessMap}
375
+ */
376
+ module.exports.getPublicParametersWitness = function(program, solved_witness) {
377
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
378
+ const len0 = WASM_VECTOR_LEN;
379
+ const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
380
+ if (ret[2]) {
381
+ throw takeFromExternrefTable0(ret[1]);
382
+ }
383
+ return takeFromExternrefTable0(ret[0]);
384
+ };
385
+
386
+ /**
387
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
388
+ *
389
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
390
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
391
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
392
+ * @param {Uint8Array} program
393
+ * @param {WitnessMap} solved_witness
394
+ * @returns {WitnessMap}
395
+ */
396
+ module.exports.getPublicWitness = function(program, solved_witness) {
397
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
398
+ const len0 = WASM_VECTOR_LEN;
399
+ const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
400
+ if (ret[2]) {
401
+ throw takeFromExternrefTable0(ret[1]);
402
+ }
403
+ return takeFromExternrefTable0(ret[0]);
404
+ };
405
+
406
+ /**
407
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
408
+ * @returns {BuildInfo} - Information on how the installed package was built.
409
+ */
410
+ module.exports.buildInfo = function() {
411
+ const ret = wasm.buildInfo();
412
+ return ret;
413
+ };
414
+
345
415
  /**
346
416
  * Performs a bitwise AND operation between `lhs` and `rhs`
347
417
  * @param {string} lhs
@@ -457,85 +527,16 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
457
527
  return ret !== 0;
458
528
  };
459
529
 
460
- /**
461
- * Returns the `BuildInfo` object containing information about how the installed package was built.
462
- * @returns {BuildInfo} - Information on how the installed package was built.
463
- */
464
- module.exports.buildInfo = function() {
465
- const ret = wasm.buildInfo();
466
- return ret;
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
-
529
530
  function __wbg_adapter_30(arg0, arg1, arg2) {
530
- wasm.closure571_externref_shim(arg0, arg1, arg2);
531
+ wasm.closure584_externref_shim(arg0, arg1, arg2);
531
532
  }
532
533
 
533
534
  function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
534
- wasm.closure1165_externref_shim(arg0, arg1, arg2, arg3, arg4);
535
+ wasm.closure1179_externref_shim(arg0, arg1, arg2, arg3, arg4);
535
536
  }
536
537
 
537
538
  function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
538
- wasm.closure1169_externref_shim(arg0, arg1, arg2, arg3);
539
+ wasm.closure1183_externref_shim(arg0, arg1, arg2, arg3);
539
540
  }
540
541
 
541
542
  module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
@@ -553,12 +554,12 @@ module.exports.__wbg_call_833bed5770ea2041 = function() { return handleError(fun
553
554
  return ret;
554
555
  }, arguments) };
555
556
 
556
- module.exports.__wbg_constructor_78d4b46bae4ee3a6 = function(arg0) {
557
+ module.exports.__wbg_constructor_590e27d4519f5f72 = function(arg0) {
557
558
  const ret = new Error(arg0);
558
559
  return ret;
559
560
  };
560
561
 
561
- module.exports.__wbg_constructor_e15d65f40a39eb05 = function(arg0) {
562
+ module.exports.__wbg_constructor_6f86ae2adbcd1779 = function(arg0) {
562
563
  const ret = new Error(arg0);
563
564
  return ret;
564
565
  };
@@ -689,8 +690,8 @@ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
689
690
  return ret;
690
691
  };
691
692
 
692
- module.exports.__wbg_new_95a101145c23dc1d = function() {
693
- const ret = new Map();
693
+ module.exports.__wbg_new_af7b60fde1e58f1b = function() {
694
+ const ret = new Array();
694
695
  return ret;
695
696
  };
696
697
 
@@ -699,8 +700,8 @@ module.exports.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
699
700
  return ret;
700
701
  };
701
702
 
702
- module.exports.__wbg_new_d1312de2c48bf990 = function() {
703
- const ret = new Array();
703
+ module.exports.__wbg_new_e2884e6fab20df40 = function() {
704
+ const ret = new Map();
704
705
  return ret;
705
706
  };
706
707
 
@@ -813,8 +814,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
813
814
  return ret;
814
815
  };
815
816
 
816
- module.exports.__wbindgen_closure_wrapper1986 = function(arg0, arg1, arg2) {
817
- const ret = makeMutClosure(arg0, arg1, 572, __wbg_adapter_30);
817
+ module.exports.__wbindgen_closure_wrapper1979 = function(arg0, arg1, arg2) {
818
+ const ret = makeMutClosure(arg0, arg1, 585, __wbg_adapter_30);
818
819
  return ret;
819
820
  };
820
821
 
Binary file
@@ -1,7 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const initLogLevel: (a: number, b: number) => [number, number];
5
4
  export const compressWitness: (a: any) => [number, number, number, number];
6
5
  export const decompressWitness: (a: number, b: number) => [number, number, number];
7
6
  export const compressWitnessStack: (a: any) => [number, number, number, number];
@@ -9,16 +8,17 @@ export const decompressWitnessStack: (a: number, b: number) => [number, number,
9
8
  export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
10
9
  export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
11
10
  export const executeProgram: (a: number, b: number, c: any, d: any) => any;
11
+ export const initLogLevel: (a: number, b: number) => [number, number];
12
+ export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
13
+ export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
14
+ export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
15
+ export const buildInfo: () => any;
12
16
  export const and: (a: any, b: any) => any;
13
17
  export const xor: (a: any, b: any) => any;
14
18
  export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
15
19
  export const blake2s256: (a: number, b: number) => [number, number];
16
20
  export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
17
21
  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 buildInfo: () => 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 closure571_externref_shim: (a: number, b: number, c: any) => void;
31
- export const closure1165_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
- export const closure1169_externref_shim: (a: number, b: number, c: any, d: any) => void;
30
+ export const closure584_externref_shim: (a: number, b: number, c: any) => void;
31
+ export const closure1179_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
+ export const closure1183_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": "2.1.0-rc.9",
3
+ "version": "3.0.0-devnet.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,9 +38,9 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@esm-bundle/chai": "^4.3.4-fix.0",
41
- "@web/dev-server-esbuild": "^0.3.6",
41
+ "@web/dev-server-esbuild": "^1.0.4",
42
42
  "@web/test-runner": "^0.20.2",
43
- "@web/test-runner-playwright": "^0.11.0",
43
+ "@web/test-runner-playwright": "^0.11.1",
44
44
  "chai": "^4.4.1",
45
45
  "eslint": "^9.28.0",
46
46
  "eslint-plugin-prettier": "^5.4.1",
package/web/acvm_js.d.ts CHANGED
@@ -1,11 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * Sets the package's logging level.
5
- *
6
- * @param {LogLevel} level - The maximum level of logging to be emitted.
7
- */
8
- export function initLogLevel(filter: string): void;
9
3
  /**
10
4
  * Compresses a `WitnessMap` into the binary format outputted by Nargo.
11
5
  *
@@ -64,34 +58,11 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
64
58
  */
65
59
  export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
66
60
  /**
67
- * Performs a bitwise AND operation between `lhs` and `rhs`
68
- */
69
- export function and(lhs: string, rhs: string): string;
70
- /**
71
- * Performs a bitwise XOR operation between `lhs` and `rhs`
72
- */
73
- export function xor(lhs: string, rhs: string): string;
74
- /**
75
- * Sha256 compression function
76
- */
77
- export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
78
- /**
79
- * Calculates the Blake2s256 hash of the input bytes
80
- */
81
- export function blake2s256(inputs: Uint8Array): Uint8Array;
82
- /**
83
- * Verifies a ECDSA signature over the secp256k1 curve.
84
- */
85
- export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
86
- /**
87
- * Verifies a ECDSA signature over the secp256r1 curve.
88
- */
89
- export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
90
- /**
91
- * Returns the `BuildInfo` object containing information about how the installed package was built.
92
- * @returns {BuildInfo} - Information on how the installed package was built.
61
+ * Sets the package's logging level.
62
+ *
63
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
93
64
  */
94
- export function buildInfo(): BuildInfo;
65
+ export function initLogLevel(filter: string): void;
95
66
  /**
96
67
  * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
97
68
  *
@@ -116,29 +87,35 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
116
87
  * @returns {WitnessMap} A witness map containing the circuit's public inputs.
117
88
  */
118
89
  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
-
128
-
129
90
  /**
130
- * @typedef {Object} BuildInfo - Information about how the installed package was built
131
- * @property {string} gitHash - The hash of the git commit from which the package was built.
132
- * @property {string} version - The version of the package at the built git commit.
133
- * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
91
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
92
+ * @returns {BuildInfo} - Information on how the installed package was built.
134
93
  */
135
- export type BuildInfo = {
136
- gitHash: string;
137
- version: string;
138
- dirty: string;
139
- }
140
-
141
-
94
+ export function buildInfo(): BuildInfo;
95
+ /**
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
105
+ */
106
+ export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
107
+ /**
108
+ * Calculates the Blake2s256 hash of the input bytes
109
+ */
110
+ export function blake2s256(inputs: Uint8Array): Uint8Array;
111
+ /**
112
+ * Verifies a ECDSA signature over the secp256k1 curve.
113
+ */
114
+ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
115
+ /**
116
+ * Verifies a ECDSA signature over the secp256r1 curve.
117
+ */
118
+ export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
142
119
 
143
120
  export type RawAssertionPayload = {
144
121
  selector: string;
@@ -154,6 +131,20 @@ export type ExecutionError = Error & {
154
131
 
155
132
 
156
133
 
134
+ export type ForeignCallInput = string[]
135
+ export type ForeignCallOutput = string | string[]
136
+
137
+ /**
138
+ * A callback which performs an foreign call and returns the response.
139
+ * @callback ForeignCallHandler
140
+ * @param {string} name - The identifier for the type of foreign call being performed.
141
+ * @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
142
+ * @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
143
+ */
144
+ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
145
+
146
+
147
+
157
148
  // Map from witness index to hex string value of witness.
158
149
  export type WitnessMap = Map<number, string>;
159
150
 
@@ -169,17 +160,26 @@ export type SolvedAndReturnWitness = {
169
160
 
170
161
 
171
162
 
172
- export type ForeignCallInput = string[]
173
- export type ForeignCallOutput = string | string[]
163
+ export type StackItem = {
164
+ index: number;
165
+ witness: WitnessMap;
166
+ }
167
+
168
+ export type WitnessStack = Array<StackItem>;
169
+
170
+
174
171
 
175
172
  /**
176
- * A callback which performs an foreign call and returns the response.
177
- * @callback ForeignCallHandler
178
- * @param {string} name - The identifier for the type of foreign call being performed.
179
- * @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
180
- * @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
181
- */
182
- export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
173
+ * @typedef {Object} BuildInfo - Information about how the installed package was built
174
+ * @property {string} gitHash - The hash of the git commit from which the package was built.
175
+ * @property {string} version - The version of the package at the built git commit.
176
+ * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
177
+ */
178
+ export type BuildInfo = {
179
+ gitHash: string;
180
+ version: string;
181
+ dirty: string;
182
+ }
183
183
 
184
184
 
185
185
 
@@ -187,7 +187,6 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
187
187
 
188
188
  export interface InitOutput {
189
189
  readonly memory: WebAssembly.Memory;
190
- readonly initLogLevel: (a: number, b: number) => [number, number];
191
190
  readonly compressWitness: (a: any) => [number, number, number, number];
192
191
  readonly decompressWitness: (a: number, b: number) => [number, number, number];
193
192
  readonly compressWitnessStack: (a: any) => [number, number, number, number];
@@ -195,16 +194,17 @@ export interface InitOutput {
195
194
  readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
196
195
  readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
197
196
  readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
197
+ readonly initLogLevel: (a: number, b: number) => [number, number];
198
+ readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
199
+ readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
200
+ readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
201
+ readonly buildInfo: () => any;
198
202
  readonly and: (a: any, b: any) => any;
199
203
  readonly xor: (a: any, b: any) => any;
200
204
  readonly sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
201
205
  readonly blake2s256: (a: number, b: number) => [number, number];
202
206
  readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
203
207
  readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
204
- readonly buildInfo: () => any;
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;
@@ -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 closure571_externref_shim: (a: number, b: number, c: any) => void;
217
- readonly closure1165_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
218
- readonly closure1169_externref_shim: (a: number, b: number, c: any, d: any) => void;
216
+ readonly closure584_externref_shim: (a: number, b: number, c: any) => void;
217
+ readonly closure1179_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
218
+ readonly closure1183_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
@@ -203,19 +203,6 @@ function takeFromExternrefTable0(idx) {
203
203
  wasm.__externref_table_dealloc(idx);
204
204
  return value;
205
205
  }
206
- /**
207
- * Sets the package's logging level.
208
- *
209
- * @param {LogLevel} level - The maximum level of logging to be emitted.
210
- */
211
- export function initLogLevel(filter) {
212
- const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
213
- const len0 = WASM_VECTOR_LEN;
214
- const ret = wasm.initLogLevel(ptr0, len0);
215
- if (ret[1]) {
216
- throw takeFromExternrefTable0(ret[0]);
217
- }
218
- }
219
206
 
220
207
  function getArrayU8FromWasm0(ptr, len) {
221
208
  ptr = ptr >>> 0;
@@ -338,6 +325,89 @@ export function executeProgram(program, initial_witness, foreign_call_handler) {
338
325
  return ret;
339
326
  }
340
327
 
328
+ /**
329
+ * Sets the package's logging level.
330
+ *
331
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
332
+ */
333
+ export function initLogLevel(filter) {
334
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
335
+ const len0 = WASM_VECTOR_LEN;
336
+ const ret = wasm.initLogLevel(ptr0, len0);
337
+ if (ret[1]) {
338
+ throw takeFromExternrefTable0(ret[0]);
339
+ }
340
+ }
341
+
342
+ /**
343
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
344
+ *
345
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
346
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
347
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
348
+ * @param {Uint8Array} program
349
+ * @param {WitnessMap} witness_map
350
+ * @returns {WitnessMap}
351
+ */
352
+ export function getReturnWitness(program, witness_map) {
353
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
354
+ const len0 = WASM_VECTOR_LEN;
355
+ const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
356
+ if (ret[2]) {
357
+ throw takeFromExternrefTable0(ret[1]);
358
+ }
359
+ return takeFromExternrefTable0(ret[0]);
360
+ }
361
+
362
+ /**
363
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
364
+ *
365
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
366
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
367
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
368
+ * @param {Uint8Array} program
369
+ * @param {WitnessMap} solved_witness
370
+ * @returns {WitnessMap}
371
+ */
372
+ export function getPublicParametersWitness(program, solved_witness) {
373
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
374
+ const len0 = WASM_VECTOR_LEN;
375
+ const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
376
+ if (ret[2]) {
377
+ throw takeFromExternrefTable0(ret[1]);
378
+ }
379
+ return takeFromExternrefTable0(ret[0]);
380
+ }
381
+
382
+ /**
383
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
384
+ *
385
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
386
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
387
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
388
+ * @param {Uint8Array} program
389
+ * @param {WitnessMap} solved_witness
390
+ * @returns {WitnessMap}
391
+ */
392
+ export function getPublicWitness(program, solved_witness) {
393
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
394
+ const len0 = WASM_VECTOR_LEN;
395
+ const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
396
+ if (ret[2]) {
397
+ throw takeFromExternrefTable0(ret[1]);
398
+ }
399
+ return takeFromExternrefTable0(ret[0]);
400
+ }
401
+
402
+ /**
403
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
404
+ * @returns {BuildInfo} - Information on how the installed package was built.
405
+ */
406
+ export function buildInfo() {
407
+ const ret = wasm.buildInfo();
408
+ return ret;
409
+ }
410
+
341
411
  /**
342
412
  * Performs a bitwise AND operation between `lhs` and `rhs`
343
413
  * @param {string} lhs
@@ -453,85 +523,16 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
453
523
  return ret !== 0;
454
524
  }
455
525
 
456
- /**
457
- * Returns the `BuildInfo` object containing information about how the installed package was built.
458
- * @returns {BuildInfo} - Information on how the installed package was built.
459
- */
460
- export function buildInfo() {
461
- const ret = wasm.buildInfo();
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
526
  function __wbg_adapter_30(arg0, arg1, arg2) {
526
- wasm.closure571_externref_shim(arg0, arg1, arg2);
527
+ wasm.closure584_externref_shim(arg0, arg1, arg2);
527
528
  }
528
529
 
529
530
  function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
530
- wasm.closure1165_externref_shim(arg0, arg1, arg2, arg3, arg4);
531
+ wasm.closure1179_externref_shim(arg0, arg1, arg2, arg3, arg4);
531
532
  }
532
533
 
533
534
  function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
534
- wasm.closure1169_externref_shim(arg0, arg1, arg2, arg3);
535
+ wasm.closure1183_externref_shim(arg0, arg1, arg2, arg3);
535
536
  }
536
537
 
537
538
  async function __wbg_load(module, imports) {
@@ -580,11 +581,11 @@ function __wbg_get_imports() {
580
581
  const ret = arg0.call(arg1, arg2, arg3);
581
582
  return ret;
582
583
  }, arguments) };
583
- imports.wbg.__wbg_constructor_78d4b46bae4ee3a6 = function(arg0) {
584
+ imports.wbg.__wbg_constructor_590e27d4519f5f72 = function(arg0) {
584
585
  const ret = new Error(arg0);
585
586
  return ret;
586
587
  };
587
- imports.wbg.__wbg_constructor_e15d65f40a39eb05 = function(arg0) {
588
+ imports.wbg.__wbg_constructor_6f86ae2adbcd1779 = function(arg0) {
588
589
  const ret = new Error(arg0);
589
590
  return ret;
590
591
  };
@@ -697,16 +698,16 @@ function __wbg_get_imports() {
697
698
  const ret = new Error();
698
699
  return ret;
699
700
  };
700
- imports.wbg.__wbg_new_95a101145c23dc1d = function() {
701
- const ret = new Map();
701
+ imports.wbg.__wbg_new_af7b60fde1e58f1b = function() {
702
+ const ret = new Array();
702
703
  return ret;
703
704
  };
704
705
  imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
705
706
  const ret = new Error(getStringFromWasm0(arg0, arg1));
706
707
  return ret;
707
708
  };
708
- imports.wbg.__wbg_new_d1312de2c48bf990 = function() {
709
- const ret = new Array();
709
+ imports.wbg.__wbg_new_e2884e6fab20df40 = function() {
710
+ const ret = new Map();
710
711
  return ret;
711
712
  };
712
713
  imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
@@ -797,8 +798,8 @@ function __wbg_get_imports() {
797
798
  const ret = false;
798
799
  return ret;
799
800
  };
800
- imports.wbg.__wbindgen_closure_wrapper1986 = function(arg0, arg1, arg2) {
801
- const ret = makeMutClosure(arg0, arg1, 572, __wbg_adapter_30);
801
+ imports.wbg.__wbindgen_closure_wrapper1979 = function(arg0, arg1, arg2) {
802
+ const ret = makeMutClosure(arg0, arg1, 585, __wbg_adapter_30);
802
803
  return ret;
803
804
  };
804
805
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
Binary file
@@ -1,7 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const initLogLevel: (a: number, b: number) => [number, number];
5
4
  export const compressWitness: (a: any) => [number, number, number, number];
6
5
  export const decompressWitness: (a: number, b: number) => [number, number, number];
7
6
  export const compressWitnessStack: (a: any) => [number, number, number, number];
@@ -9,16 +8,17 @@ export const decompressWitnessStack: (a: number, b: number) => [number, number,
9
8
  export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
10
9
  export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
11
10
  export const executeProgram: (a: number, b: number, c: any, d: any) => any;
11
+ export const initLogLevel: (a: number, b: number) => [number, number];
12
+ export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
13
+ export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
14
+ export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
15
+ export const buildInfo: () => any;
12
16
  export const and: (a: any, b: any) => any;
13
17
  export const xor: (a: any, b: any) => any;
14
18
  export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
15
19
  export const blake2s256: (a: number, b: number) => [number, number];
16
20
  export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
17
21
  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 buildInfo: () => 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 closure571_externref_shim: (a: number, b: number, c: any) => void;
31
- export const closure1165_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
- export const closure1169_externref_shim: (a: number, b: number, c: any, d: any) => void;
30
+ export const closure584_externref_shim: (a: number, b: number, c: any) => void;
31
+ export const closure1179_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
+ export const closure1183_externref_shim: (a: number, b: number, c: any, d: any) => void;
33
33
  export const __wbindgen_start: () => void;