@aztec/noir-acvm_js 0.84.0 → 0.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nodejs/acvm_js.d.ts +68 -68
- package/nodejs/acvm_js.js +110 -110
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +9 -9
- package/package.json +5 -5
- package/web/acvm_js.d.ts +77 -77
- package/web/acvm_js.js +109 -109
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +9 -9
package/nodejs/acvm_js.d.ts
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
5
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
6
|
+
*/
|
|
7
|
+
export function buildInfo(): BuildInfo;
|
|
8
|
+
/**
|
|
9
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
10
|
+
*
|
|
11
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
12
|
+
* @returns {Uint8Array} A compressed witness map
|
|
13
|
+
*/
|
|
14
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
15
|
+
/**
|
|
16
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
17
|
+
* This should be used to only fetch the witness map for the main function.
|
|
18
|
+
*
|
|
19
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
20
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
21
|
+
*/
|
|
22
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
23
|
+
/**
|
|
24
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
25
|
+
*
|
|
26
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
27
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
28
|
+
*/
|
|
29
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
30
|
+
/**
|
|
31
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
32
|
+
*
|
|
33
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
34
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
35
|
+
*/
|
|
36
|
+
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
37
|
+
/**
|
|
38
|
+
* Sets the package's logging level.
|
|
39
|
+
*
|
|
40
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
41
|
+
*/
|
|
42
|
+
export function initLogLevel(filter: string): void;
|
|
3
43
|
/**
|
|
4
44
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
45
|
*
|
|
@@ -28,12 +68,6 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
|
|
|
28
68
|
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
29
69
|
*/
|
|
30
70
|
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
31
|
-
/**
|
|
32
|
-
* Sets the package's logging level.
|
|
33
|
-
*
|
|
34
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
35
|
-
*/
|
|
36
|
-
export function initLogLevel(filter: string): void;
|
|
37
71
|
/**
|
|
38
72
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
39
73
|
*
|
|
@@ -82,51 +116,18 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
82
116
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
83
117
|
*/
|
|
84
118
|
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
119
|
+
|
|
85
120
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
92
|
-
*
|
|
93
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
94
|
-
* @returns {Uint8Array} A compressed witness map
|
|
95
|
-
*/
|
|
96
|
-
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
97
|
-
/**
|
|
98
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
99
|
-
* This should be used to only fetch the witness map for the main function.
|
|
100
|
-
*
|
|
101
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
102
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
103
|
-
*/
|
|
104
|
-
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
105
|
-
/**
|
|
106
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
107
|
-
*
|
|
108
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
109
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
110
|
-
*/
|
|
111
|
-
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
112
|
-
/**
|
|
113
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
114
|
-
*
|
|
115
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
116
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
121
|
+
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
122
|
+
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
123
|
+
* @property {string} version - The version of the package at the built git commit.
|
|
124
|
+
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
117
125
|
*/
|
|
118
|
-
export
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export type ExecutionError = Error & {
|
|
126
|
-
callStack?: string[];
|
|
127
|
-
rawAssertionPayload?: RawAssertionPayload;
|
|
128
|
-
brilligFunctionId?: number;
|
|
129
|
-
};
|
|
126
|
+
export type BuildInfo = {
|
|
127
|
+
gitHash: string;
|
|
128
|
+
version: string;
|
|
129
|
+
dirty: string;
|
|
130
|
+
}
|
|
130
131
|
|
|
131
132
|
|
|
132
133
|
|
|
@@ -145,26 +146,16 @@ export type SolvedAndReturnWitness = {
|
|
|
145
146
|
|
|
146
147
|
|
|
147
148
|
|
|
148
|
-
export type
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export type WitnessStack = Array<StackItem>;
|
|
154
|
-
|
|
155
|
-
|
|
149
|
+
export type RawAssertionPayload = {
|
|
150
|
+
selector: string;
|
|
151
|
+
data: string[];
|
|
152
|
+
};
|
|
156
153
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
*/
|
|
163
|
-
export type BuildInfo = {
|
|
164
|
-
gitHash: string;
|
|
165
|
-
version: string;
|
|
166
|
-
dirty: string;
|
|
167
|
-
}
|
|
154
|
+
export type ExecutionError = Error & {
|
|
155
|
+
callStack?: string[];
|
|
156
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
157
|
+
brilligFunctionId?: number;
|
|
158
|
+
};
|
|
168
159
|
|
|
169
160
|
|
|
170
161
|
|
|
@@ -181,3 +172,12 @@ export type ForeignCallOutput = string | string[]
|
|
|
181
172
|
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
182
173
|
|
|
183
174
|
|
|
175
|
+
|
|
176
|
+
export type StackItem = {
|
|
177
|
+
index: number;
|
|
178
|
+
witness: WitnessMap;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export type WitnessStack = Array<StackItem>;
|
|
182
|
+
|
|
183
|
+
|
package/nodejs/acvm_js.js
CHANGED
|
@@ -201,6 +201,40 @@ function debugString(val) {
|
|
|
201
201
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
202
202
|
return className;
|
|
203
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
206
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
207
|
+
*/
|
|
208
|
+
module.exports.buildInfo = function() {
|
|
209
|
+
const ret = wasm.buildInfo();
|
|
210
|
+
return ret;
|
|
211
|
+
};
|
|
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
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
220
|
+
ptr = ptr >>> 0;
|
|
221
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
225
|
+
*
|
|
226
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
227
|
+
* @returns {Uint8Array} A compressed witness map
|
|
228
|
+
*/
|
|
229
|
+
module.exports.compressWitness = function(witness_map) {
|
|
230
|
+
const ret = wasm.compressWitness(witness_map);
|
|
231
|
+
if (ret[3]) {
|
|
232
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
233
|
+
}
|
|
234
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
235
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
236
|
+
return v1;
|
|
237
|
+
};
|
|
204
238
|
|
|
205
239
|
function passArray8ToWasm0(arg, malloc) {
|
|
206
240
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
@@ -208,6 +242,69 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
208
242
|
WASM_VECTOR_LEN = arg.length;
|
|
209
243
|
return ptr;
|
|
210
244
|
}
|
|
245
|
+
/**
|
|
246
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
247
|
+
* This should be used to only fetch the witness map for the main function.
|
|
248
|
+
*
|
|
249
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
250
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
251
|
+
*/
|
|
252
|
+
module.exports.decompressWitness = function(compressed_witness) {
|
|
253
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
254
|
+
const len0 = WASM_VECTOR_LEN;
|
|
255
|
+
const ret = wasm.decompressWitness(ptr0, len0);
|
|
256
|
+
if (ret[2]) {
|
|
257
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
258
|
+
}
|
|
259
|
+
return takeFromExternrefTable0(ret[0]);
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
264
|
+
*
|
|
265
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
266
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
267
|
+
*/
|
|
268
|
+
module.exports.compressWitnessStack = function(witness_stack) {
|
|
269
|
+
const ret = wasm.compressWitnessStack(witness_stack);
|
|
270
|
+
if (ret[3]) {
|
|
271
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
272
|
+
}
|
|
273
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
274
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
275
|
+
return v1;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
280
|
+
*
|
|
281
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
282
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
283
|
+
*/
|
|
284
|
+
module.exports.decompressWitnessStack = function(compressed_witness) {
|
|
285
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
286
|
+
const len0 = WASM_VECTOR_LEN;
|
|
287
|
+
const ret = wasm.decompressWitnessStack(ptr0, len0);
|
|
288
|
+
if (ret[2]) {
|
|
289
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
290
|
+
}
|
|
291
|
+
return takeFromExternrefTable0(ret[0]);
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Sets the package's logging level.
|
|
296
|
+
*
|
|
297
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
298
|
+
*/
|
|
299
|
+
module.exports.initLogLevel = function(filter) {
|
|
300
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
301
|
+
const len0 = WASM_VECTOR_LEN;
|
|
302
|
+
const ret = wasm.initLogLevel(ptr0, len0);
|
|
303
|
+
if (ret[1]) {
|
|
304
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
|
|
211
308
|
/**
|
|
212
309
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
213
310
|
*
|
|
@@ -254,25 +351,6 @@ module.exports.executeProgram = function(program, initial_witness, foreign_call_
|
|
|
254
351
|
return ret;
|
|
255
352
|
};
|
|
256
353
|
|
|
257
|
-
function takeFromExternrefTable0(idx) {
|
|
258
|
-
const value = wasm.__wbindgen_export_2.get(idx);
|
|
259
|
-
wasm.__externref_table_dealloc(idx);
|
|
260
|
-
return value;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Sets the package's logging level.
|
|
264
|
-
*
|
|
265
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
266
|
-
*/
|
|
267
|
-
module.exports.initLogLevel = function(filter) {
|
|
268
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
269
|
-
const len0 = WASM_VECTOR_LEN;
|
|
270
|
-
const ret = wasm.initLogLevel(ptr0, len0);
|
|
271
|
-
if (ret[1]) {
|
|
272
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
|
|
276
354
|
/**
|
|
277
355
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
278
356
|
*
|
|
@@ -392,10 +470,6 @@ module.exports.sha256_compression = function(inputs, state) {
|
|
|
392
470
|
return v3;
|
|
393
471
|
};
|
|
394
472
|
|
|
395
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
396
|
-
ptr = ptr >>> 0;
|
|
397
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
398
|
-
}
|
|
399
473
|
/**
|
|
400
474
|
* Calculates the Blake2s256 hash of the input bytes
|
|
401
475
|
* @param {Uint8Array} inputs
|
|
@@ -452,90 +526,16 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
|
|
|
452
526
|
return ret !== 0;
|
|
453
527
|
};
|
|
454
528
|
|
|
455
|
-
/**
|
|
456
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
457
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
458
|
-
*/
|
|
459
|
-
module.exports.buildInfo = function() {
|
|
460
|
-
const ret = wasm.buildInfo();
|
|
461
|
-
return ret;
|
|
462
|
-
};
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
466
|
-
*
|
|
467
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
468
|
-
* @returns {Uint8Array} A compressed witness map
|
|
469
|
-
*/
|
|
470
|
-
module.exports.compressWitness = function(witness_map) {
|
|
471
|
-
const ret = wasm.compressWitness(witness_map);
|
|
472
|
-
if (ret[3]) {
|
|
473
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
474
|
-
}
|
|
475
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
476
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
477
|
-
return v1;
|
|
478
|
-
};
|
|
479
|
-
|
|
480
|
-
/**
|
|
481
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
482
|
-
* This should be used to only fetch the witness map for the main function.
|
|
483
|
-
*
|
|
484
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
485
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
486
|
-
*/
|
|
487
|
-
module.exports.decompressWitness = function(compressed_witness) {
|
|
488
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
489
|
-
const len0 = WASM_VECTOR_LEN;
|
|
490
|
-
const ret = wasm.decompressWitness(ptr0, len0);
|
|
491
|
-
if (ret[2]) {
|
|
492
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
493
|
-
}
|
|
494
|
-
return takeFromExternrefTable0(ret[0]);
|
|
495
|
-
};
|
|
496
|
-
|
|
497
|
-
/**
|
|
498
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
499
|
-
*
|
|
500
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
501
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
502
|
-
*/
|
|
503
|
-
module.exports.compressWitnessStack = function(witness_stack) {
|
|
504
|
-
const ret = wasm.compressWitnessStack(witness_stack);
|
|
505
|
-
if (ret[3]) {
|
|
506
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
507
|
-
}
|
|
508
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
509
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
510
|
-
return v1;
|
|
511
|
-
};
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
515
|
-
*
|
|
516
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
517
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
518
|
-
*/
|
|
519
|
-
module.exports.decompressWitnessStack = function(compressed_witness) {
|
|
520
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
521
|
-
const len0 = WASM_VECTOR_LEN;
|
|
522
|
-
const ret = wasm.decompressWitnessStack(ptr0, len0);
|
|
523
|
-
if (ret[2]) {
|
|
524
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
525
|
-
}
|
|
526
|
-
return takeFromExternrefTable0(ret[0]);
|
|
527
|
-
};
|
|
528
|
-
|
|
529
529
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
530
|
-
wasm.
|
|
530
|
+
wasm.closure255_externref_shim(arg0, arg1, arg2);
|
|
531
531
|
}
|
|
532
532
|
|
|
533
533
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
534
|
-
wasm.
|
|
534
|
+
wasm.closure816_externref_shim(arg0, arg1, arg2, arg3, arg4);
|
|
535
535
|
}
|
|
536
536
|
|
|
537
537
|
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
538
|
-
wasm.
|
|
538
|
+
wasm.closure820_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.
|
|
556
|
+
module.exports.__wbg_constructor_6f67fe370a1d12e4 = function(arg0) {
|
|
557
557
|
const ret = new Error(arg0);
|
|
558
558
|
return ret;
|
|
559
559
|
};
|
|
560
560
|
|
|
561
|
-
module.exports.
|
|
561
|
+
module.exports.__wbg_constructor_e1ce7ec5d0c26936 = function(arg0) {
|
|
562
562
|
const ret = new Error(arg0);
|
|
563
563
|
return ret;
|
|
564
564
|
};
|
|
@@ -674,11 +674,6 @@ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
|
|
674
674
|
}
|
|
675
675
|
};
|
|
676
676
|
|
|
677
|
-
module.exports.__wbg_new_3f4c5c451d69e970 = function() {
|
|
678
|
-
const ret = new Map();
|
|
679
|
-
return ret;
|
|
680
|
-
};
|
|
681
|
-
|
|
682
677
|
module.exports.__wbg_new_5e0be73521bc8c17 = function() {
|
|
683
678
|
const ret = new Map();
|
|
684
679
|
return ret;
|
|
@@ -694,11 +689,16 @@ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
|
|
|
694
689
|
return ret;
|
|
695
690
|
};
|
|
696
691
|
|
|
697
|
-
module.exports.
|
|
692
|
+
module.exports.__wbg_new_afcb88b732711926 = function() {
|
|
698
693
|
const ret = new Array();
|
|
699
694
|
return ret;
|
|
700
695
|
};
|
|
701
696
|
|
|
697
|
+
module.exports.__wbg_new_c4d92c865672cdba = function() {
|
|
698
|
+
const ret = new Map();
|
|
699
|
+
return ret;
|
|
700
|
+
};
|
|
701
|
+
|
|
702
702
|
module.exports.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
|
|
703
703
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
704
704
|
return ret;
|
|
@@ -813,8 +813,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
|
813
813
|
return ret;
|
|
814
814
|
};
|
|
815
815
|
|
|
816
|
-
module.exports.
|
|
817
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
816
|
+
module.exports.__wbindgen_closure_wrapper736 = function(arg0, arg1, arg2) {
|
|
817
|
+
const ret = makeMutClosure(arg0, arg1, 256, __wbg_adapter_30);
|
|
818
818
|
return ret;
|
|
819
819
|
};
|
|
820
820
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const buildInfo: () => any;
|
|
5
|
+
export const compressWitness: (a: any) => [number, number, number, number];
|
|
6
|
+
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
7
|
+
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
8
|
+
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
9
|
+
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
4
10
|
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
5
11
|
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
6
12
|
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
7
|
-
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
8
13
|
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
9
14
|
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
10
15
|
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
@@ -14,11 +19,6 @@ export const sha256_compression: (a: number, b: number, c: number, d: number) =>
|
|
|
14
19
|
export const blake2s256: (a: number, b: number) => [number, number];
|
|
15
20
|
export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
16
21
|
export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
17
|
-
export const buildInfo: () => any;
|
|
18
|
-
export const compressWitness: (a: any) => [number, number, number, number];
|
|
19
|
-
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
20
|
-
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
21
|
-
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
22
22
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
23
23
|
export const __externref_table_alloc: () => number;
|
|
24
24
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -27,7 +27,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
|
27
27
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
28
28
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
29
29
|
export const __externref_table_dealloc: (a: number) => void;
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
30
|
+
export const closure255_externref_shim: (a: number, b: number, c: any) => void;
|
|
31
|
+
export const closure816_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
32
|
+
export const closure820_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.
|
|
3
|
+
"version": "0.85.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"@web/test-runner": "^0.18.1",
|
|
43
43
|
"@web/test-runner-playwright": "^0.11.0",
|
|
44
44
|
"chai": "^4.4.1",
|
|
45
|
-
"eslint": "^9.
|
|
46
|
-
"eslint-plugin-prettier": "^5.2.
|
|
45
|
+
"eslint": "^9.24.0",
|
|
46
|
+
"eslint-plugin-prettier": "^5.2.6",
|
|
47
47
|
"mocha": "^11.1.0",
|
|
48
48
|
"prettier": "3.5.3",
|
|
49
|
-
"ts-node": "^10.9.
|
|
50
|
-
"typescript": "^5.8.
|
|
49
|
+
"ts-node": "^10.9.2",
|
|
50
|
+
"typescript": "^5.8.3"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
5
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
6
|
+
*/
|
|
7
|
+
export function buildInfo(): BuildInfo;
|
|
8
|
+
/**
|
|
9
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
10
|
+
*
|
|
11
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
12
|
+
* @returns {Uint8Array} A compressed witness map
|
|
13
|
+
*/
|
|
14
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
15
|
+
/**
|
|
16
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
17
|
+
* This should be used to only fetch the witness map for the main function.
|
|
18
|
+
*
|
|
19
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
20
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
21
|
+
*/
|
|
22
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
23
|
+
/**
|
|
24
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
25
|
+
*
|
|
26
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
27
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
28
|
+
*/
|
|
29
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
30
|
+
/**
|
|
31
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
32
|
+
*
|
|
33
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
34
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
35
|
+
*/
|
|
36
|
+
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
37
|
+
/**
|
|
38
|
+
* Sets the package's logging level.
|
|
39
|
+
*
|
|
40
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
41
|
+
*/
|
|
42
|
+
export function initLogLevel(filter: string): void;
|
|
3
43
|
/**
|
|
4
44
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
45
|
*
|
|
@@ -28,12 +68,6 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
|
|
|
28
68
|
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
29
69
|
*/
|
|
30
70
|
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
31
|
-
/**
|
|
32
|
-
* Sets the package's logging level.
|
|
33
|
-
*
|
|
34
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
35
|
-
*/
|
|
36
|
-
export function initLogLevel(filter: string): void;
|
|
37
71
|
/**
|
|
38
72
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
39
73
|
*
|
|
@@ -82,51 +116,18 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
82
116
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
83
117
|
*/
|
|
84
118
|
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
119
|
+
|
|
85
120
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
92
|
-
*
|
|
93
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
94
|
-
* @returns {Uint8Array} A compressed witness map
|
|
95
|
-
*/
|
|
96
|
-
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
97
|
-
/**
|
|
98
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
99
|
-
* This should be used to only fetch the witness map for the main function.
|
|
100
|
-
*
|
|
101
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
102
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
103
|
-
*/
|
|
104
|
-
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
105
|
-
/**
|
|
106
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
107
|
-
*
|
|
108
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
109
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
110
|
-
*/
|
|
111
|
-
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
112
|
-
/**
|
|
113
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
114
|
-
*
|
|
115
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
116
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
121
|
+
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
122
|
+
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
123
|
+
* @property {string} version - The version of the package at the built git commit.
|
|
124
|
+
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
117
125
|
*/
|
|
118
|
-
export
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export type ExecutionError = Error & {
|
|
126
|
-
callStack?: string[];
|
|
127
|
-
rawAssertionPayload?: RawAssertionPayload;
|
|
128
|
-
brilligFunctionId?: number;
|
|
129
|
-
};
|
|
126
|
+
export type BuildInfo = {
|
|
127
|
+
gitHash: string;
|
|
128
|
+
version: string;
|
|
129
|
+
dirty: string;
|
|
130
|
+
}
|
|
130
131
|
|
|
131
132
|
|
|
132
133
|
|
|
@@ -145,26 +146,16 @@ export type SolvedAndReturnWitness = {
|
|
|
145
146
|
|
|
146
147
|
|
|
147
148
|
|
|
148
|
-
export type
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export type WitnessStack = Array<StackItem>;
|
|
154
|
-
|
|
155
|
-
|
|
149
|
+
export type RawAssertionPayload = {
|
|
150
|
+
selector: string;
|
|
151
|
+
data: string[];
|
|
152
|
+
};
|
|
156
153
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
*/
|
|
163
|
-
export type BuildInfo = {
|
|
164
|
-
gitHash: string;
|
|
165
|
-
version: string;
|
|
166
|
-
dirty: string;
|
|
167
|
-
}
|
|
154
|
+
export type ExecutionError = Error & {
|
|
155
|
+
callStack?: string[];
|
|
156
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
157
|
+
brilligFunctionId?: number;
|
|
158
|
+
};
|
|
168
159
|
|
|
169
160
|
|
|
170
161
|
|
|
@@ -182,14 +173,28 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
|
|
|
182
173
|
|
|
183
174
|
|
|
184
175
|
|
|
176
|
+
export type StackItem = {
|
|
177
|
+
index: number;
|
|
178
|
+
witness: WitnessMap;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export type WitnessStack = Array<StackItem>;
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
185
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
186
186
|
|
|
187
187
|
export interface InitOutput {
|
|
188
188
|
readonly memory: WebAssembly.Memory;
|
|
189
|
+
readonly buildInfo: () => any;
|
|
190
|
+
readonly compressWitness: (a: any) => [number, number, number, number];
|
|
191
|
+
readonly decompressWitness: (a: number, b: number) => [number, number, number];
|
|
192
|
+
readonly compressWitnessStack: (a: any) => [number, number, number, number];
|
|
193
|
+
readonly decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
194
|
+
readonly initLogLevel: (a: number, b: number) => [number, number];
|
|
189
195
|
readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
190
196
|
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
191
197
|
readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
192
|
-
readonly initLogLevel: (a: number, b: number) => [number, number];
|
|
193
198
|
readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
194
199
|
readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
195
200
|
readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
@@ -199,11 +204,6 @@ export interface InitOutput {
|
|
|
199
204
|
readonly blake2s256: (a: number, b: number) => [number, number];
|
|
200
205
|
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
201
206
|
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
202
|
-
readonly buildInfo: () => any;
|
|
203
|
-
readonly compressWitness: (a: any) => [number, number, number, number];
|
|
204
|
-
readonly decompressWitness: (a: number, b: number) => [number, number, number];
|
|
205
|
-
readonly compressWitnessStack: (a: any) => [number, number, number, number];
|
|
206
|
-
readonly decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
207
207
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
208
208
|
readonly __externref_table_alloc: () => number;
|
|
209
209
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -212,9 +212,9 @@ export interface InitOutput {
|
|
|
212
212
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
213
213
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
214
214
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
215
|
-
readonly
|
|
216
|
-
readonly
|
|
217
|
-
readonly
|
|
215
|
+
readonly closure255_externref_shim: (a: number, b: number, c: any) => void;
|
|
216
|
+
readonly closure816_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
217
|
+
readonly closure820_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
218
218
|
readonly __wbindgen_start: () => void;
|
|
219
219
|
}
|
|
220
220
|
|
package/web/acvm_js.js
CHANGED
|
@@ -197,6 +197,40 @@ function debugString(val) {
|
|
|
197
197
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
198
198
|
return className;
|
|
199
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
202
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
203
|
+
*/
|
|
204
|
+
export function buildInfo() {
|
|
205
|
+
const ret = wasm.buildInfo();
|
|
206
|
+
return ret;
|
|
207
|
+
}
|
|
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
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
216
|
+
ptr = ptr >>> 0;
|
|
217
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
221
|
+
*
|
|
222
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
223
|
+
* @returns {Uint8Array} A compressed witness map
|
|
224
|
+
*/
|
|
225
|
+
export function compressWitness(witness_map) {
|
|
226
|
+
const ret = wasm.compressWitness(witness_map);
|
|
227
|
+
if (ret[3]) {
|
|
228
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
229
|
+
}
|
|
230
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
231
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
232
|
+
return v1;
|
|
233
|
+
}
|
|
200
234
|
|
|
201
235
|
function passArray8ToWasm0(arg, malloc) {
|
|
202
236
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
@@ -204,6 +238,69 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
204
238
|
WASM_VECTOR_LEN = arg.length;
|
|
205
239
|
return ptr;
|
|
206
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
243
|
+
* This should be used to only fetch the witness map for the main function.
|
|
244
|
+
*
|
|
245
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
246
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
247
|
+
*/
|
|
248
|
+
export function decompressWitness(compressed_witness) {
|
|
249
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
250
|
+
const len0 = WASM_VECTOR_LEN;
|
|
251
|
+
const ret = wasm.decompressWitness(ptr0, len0);
|
|
252
|
+
if (ret[2]) {
|
|
253
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
254
|
+
}
|
|
255
|
+
return takeFromExternrefTable0(ret[0]);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
260
|
+
*
|
|
261
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
262
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
263
|
+
*/
|
|
264
|
+
export function compressWitnessStack(witness_stack) {
|
|
265
|
+
const ret = wasm.compressWitnessStack(witness_stack);
|
|
266
|
+
if (ret[3]) {
|
|
267
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
268
|
+
}
|
|
269
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
270
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
271
|
+
return v1;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
276
|
+
*
|
|
277
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
278
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
279
|
+
*/
|
|
280
|
+
export function decompressWitnessStack(compressed_witness) {
|
|
281
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
282
|
+
const len0 = WASM_VECTOR_LEN;
|
|
283
|
+
const ret = wasm.decompressWitnessStack(ptr0, len0);
|
|
284
|
+
if (ret[2]) {
|
|
285
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
286
|
+
}
|
|
287
|
+
return takeFromExternrefTable0(ret[0]);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Sets the package's logging level.
|
|
292
|
+
*
|
|
293
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
294
|
+
*/
|
|
295
|
+
export function initLogLevel(filter) {
|
|
296
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
297
|
+
const len0 = WASM_VECTOR_LEN;
|
|
298
|
+
const ret = wasm.initLogLevel(ptr0, len0);
|
|
299
|
+
if (ret[1]) {
|
|
300
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
207
304
|
/**
|
|
208
305
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
209
306
|
*
|
|
@@ -250,25 +347,6 @@ export function executeProgram(program, initial_witness, foreign_call_handler) {
|
|
|
250
347
|
return ret;
|
|
251
348
|
}
|
|
252
349
|
|
|
253
|
-
function takeFromExternrefTable0(idx) {
|
|
254
|
-
const value = wasm.__wbindgen_export_2.get(idx);
|
|
255
|
-
wasm.__externref_table_dealloc(idx);
|
|
256
|
-
return value;
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Sets the package's logging level.
|
|
260
|
-
*
|
|
261
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
262
|
-
*/
|
|
263
|
-
export function initLogLevel(filter) {
|
|
264
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
265
|
-
const len0 = WASM_VECTOR_LEN;
|
|
266
|
-
const ret = wasm.initLogLevel(ptr0, len0);
|
|
267
|
-
if (ret[1]) {
|
|
268
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
350
|
/**
|
|
273
351
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
274
352
|
*
|
|
@@ -388,10 +466,6 @@ export function sha256_compression(inputs, state) {
|
|
|
388
466
|
return v3;
|
|
389
467
|
}
|
|
390
468
|
|
|
391
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
392
|
-
ptr = ptr >>> 0;
|
|
393
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
394
|
-
}
|
|
395
469
|
/**
|
|
396
470
|
* Calculates the Blake2s256 hash of the input bytes
|
|
397
471
|
* @param {Uint8Array} inputs
|
|
@@ -448,90 +522,16 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
|
|
|
448
522
|
return ret !== 0;
|
|
449
523
|
}
|
|
450
524
|
|
|
451
|
-
/**
|
|
452
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
453
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
454
|
-
*/
|
|
455
|
-
export function buildInfo() {
|
|
456
|
-
const ret = wasm.buildInfo();
|
|
457
|
-
return ret;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
462
|
-
*
|
|
463
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
464
|
-
* @returns {Uint8Array} A compressed witness map
|
|
465
|
-
*/
|
|
466
|
-
export function compressWitness(witness_map) {
|
|
467
|
-
const ret = wasm.compressWitness(witness_map);
|
|
468
|
-
if (ret[3]) {
|
|
469
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
470
|
-
}
|
|
471
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
472
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
473
|
-
return v1;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
/**
|
|
477
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
478
|
-
* This should be used to only fetch the witness map for the main function.
|
|
479
|
-
*
|
|
480
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
481
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
482
|
-
*/
|
|
483
|
-
export function decompressWitness(compressed_witness) {
|
|
484
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
485
|
-
const len0 = WASM_VECTOR_LEN;
|
|
486
|
-
const ret = wasm.decompressWitness(ptr0, len0);
|
|
487
|
-
if (ret[2]) {
|
|
488
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
489
|
-
}
|
|
490
|
-
return takeFromExternrefTable0(ret[0]);
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
495
|
-
*
|
|
496
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
497
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
498
|
-
*/
|
|
499
|
-
export function compressWitnessStack(witness_stack) {
|
|
500
|
-
const ret = wasm.compressWitnessStack(witness_stack);
|
|
501
|
-
if (ret[3]) {
|
|
502
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
503
|
-
}
|
|
504
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
505
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
506
|
-
return v1;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
511
|
-
*
|
|
512
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
513
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
514
|
-
*/
|
|
515
|
-
export function decompressWitnessStack(compressed_witness) {
|
|
516
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
517
|
-
const len0 = WASM_VECTOR_LEN;
|
|
518
|
-
const ret = wasm.decompressWitnessStack(ptr0, len0);
|
|
519
|
-
if (ret[2]) {
|
|
520
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
521
|
-
}
|
|
522
|
-
return takeFromExternrefTable0(ret[0]);
|
|
523
|
-
}
|
|
524
|
-
|
|
525
525
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
526
|
-
wasm.
|
|
526
|
+
wasm.closure255_externref_shim(arg0, arg1, arg2);
|
|
527
527
|
}
|
|
528
528
|
|
|
529
529
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
530
|
-
wasm.
|
|
530
|
+
wasm.closure816_externref_shim(arg0, arg1, arg2, arg3, arg4);
|
|
531
531
|
}
|
|
532
532
|
|
|
533
533
|
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
534
|
-
wasm.
|
|
534
|
+
wasm.closure820_externref_shim(arg0, arg1, arg2, arg3);
|
|
535
535
|
}
|
|
536
536
|
|
|
537
537
|
async function __wbg_load(module, imports) {
|
|
@@ -580,11 +580,11 @@ function __wbg_get_imports() {
|
|
|
580
580
|
const ret = arg0.call(arg1, arg2, arg3);
|
|
581
581
|
return ret;
|
|
582
582
|
}, arguments) };
|
|
583
|
-
imports.wbg.
|
|
583
|
+
imports.wbg.__wbg_constructor_6f67fe370a1d12e4 = function(arg0) {
|
|
584
584
|
const ret = new Error(arg0);
|
|
585
585
|
return ret;
|
|
586
586
|
};
|
|
587
|
-
imports.wbg.
|
|
587
|
+
imports.wbg.__wbg_constructor_e1ce7ec5d0c26936 = function(arg0) {
|
|
588
588
|
const ret = new Error(arg0);
|
|
589
589
|
return ret;
|
|
590
590
|
};
|
|
@@ -685,10 +685,6 @@ function __wbg_get_imports() {
|
|
|
685
685
|
state0.a = state0.b = 0;
|
|
686
686
|
}
|
|
687
687
|
};
|
|
688
|
-
imports.wbg.__wbg_new_3f4c5c451d69e970 = function() {
|
|
689
|
-
const ret = new Map();
|
|
690
|
-
return ret;
|
|
691
|
-
};
|
|
692
688
|
imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
|
|
693
689
|
const ret = new Map();
|
|
694
690
|
return ret;
|
|
@@ -701,10 +697,14 @@ function __wbg_get_imports() {
|
|
|
701
697
|
const ret = new Error();
|
|
702
698
|
return ret;
|
|
703
699
|
};
|
|
704
|
-
imports.wbg.
|
|
700
|
+
imports.wbg.__wbg_new_afcb88b732711926 = function() {
|
|
705
701
|
const ret = new Array();
|
|
706
702
|
return ret;
|
|
707
703
|
};
|
|
704
|
+
imports.wbg.__wbg_new_c4d92c865672cdba = function() {
|
|
705
|
+
const ret = new Map();
|
|
706
|
+
return ret;
|
|
707
|
+
};
|
|
708
708
|
imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
|
|
709
709
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
710
710
|
return ret;
|
|
@@ -797,8 +797,8 @@ function __wbg_get_imports() {
|
|
|
797
797
|
const ret = false;
|
|
798
798
|
return ret;
|
|
799
799
|
};
|
|
800
|
-
imports.wbg.
|
|
801
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
800
|
+
imports.wbg.__wbindgen_closure_wrapper736 = function(arg0, arg1, arg2) {
|
|
801
|
+
const ret = makeMutClosure(arg0, arg1, 256, __wbg_adapter_30);
|
|
802
802
|
return ret;
|
|
803
803
|
};
|
|
804
804
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
package/web/acvm_js_bg.wasm
CHANGED
|
Binary file
|
package/web/acvm_js_bg.wasm.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const buildInfo: () => any;
|
|
5
|
+
export const compressWitness: (a: any) => [number, number, number, number];
|
|
6
|
+
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
7
|
+
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
8
|
+
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
9
|
+
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
4
10
|
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
5
11
|
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
6
12
|
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
7
|
-
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
8
13
|
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
9
14
|
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
10
15
|
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
@@ -14,11 +19,6 @@ export const sha256_compression: (a: number, b: number, c: number, d: number) =>
|
|
|
14
19
|
export const blake2s256: (a: number, b: number) => [number, number];
|
|
15
20
|
export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
16
21
|
export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
17
|
-
export const buildInfo: () => any;
|
|
18
|
-
export const compressWitness: (a: any) => [number, number, number, number];
|
|
19
|
-
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
20
|
-
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
21
|
-
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
22
22
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
23
23
|
export const __externref_table_alloc: () => number;
|
|
24
24
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -27,7 +27,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
|
27
27
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
28
28
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
29
29
|
export const __externref_table_dealloc: (a: number) => void;
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
30
|
+
export const closure255_externref_shim: (a: number, b: number, c: any) => void;
|
|
31
|
+
export const closure816_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
32
|
+
export const closure820_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
33
33
|
export const __wbindgen_start: () => void;
|