@aztec/noir-acvm_js 0.0.1-commit.9593d84 → 0.0.1-commit.96bb3f7
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 +50 -50
- package/nodejs/acvm_js.js +111 -111
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +9 -9
- package/package.json +6 -6
- package/web/acvm_js.d.ts +59 -59
- package/web/acvm_js.js +110 -110
- 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,11 @@
|
|
|
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;
|
|
3
9
|
/**
|
|
4
10
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
11
|
*
|
|
@@ -28,12 +34,6 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
|
|
|
28
34
|
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
29
35
|
*/
|
|
30
36
|
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
37
|
/**
|
|
38
38
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
39
39
|
*
|
|
@@ -59,10 +59,29 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
|
|
|
59
59
|
*/
|
|
60
60
|
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
61
61
|
/**
|
|
62
|
-
*
|
|
63
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
62
|
+
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
64
63
|
*/
|
|
65
|
-
export function
|
|
64
|
+
export function and(lhs: string, rhs: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* Performs a bitwise XOR operation between `lhs` and `rhs`
|
|
67
|
+
*/
|
|
68
|
+
export function xor(lhs: string, rhs: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* Sha256 compression function
|
|
71
|
+
*/
|
|
72
|
+
export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
|
|
73
|
+
/**
|
|
74
|
+
* Calculates the Blake2s256 hash of the input bytes
|
|
75
|
+
*/
|
|
76
|
+
export function blake2s256(inputs: Uint8Array): Uint8Array;
|
|
77
|
+
/**
|
|
78
|
+
* Verifies a ECDSA signature over the secp256k1 curve.
|
|
79
|
+
*/
|
|
80
|
+
export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
83
|
+
*/
|
|
84
|
+
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
66
85
|
/**
|
|
67
86
|
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
68
87
|
*
|
|
@@ -93,29 +112,24 @@ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
|
93
112
|
*/
|
|
94
113
|
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
95
114
|
/**
|
|
96
|
-
*
|
|
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.
|
|
115
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
116
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
117
117
|
*/
|
|
118
|
-
export function
|
|
118
|
+
export function buildInfo(): BuildInfo;
|
|
119
|
+
|
|
120
|
+
export type RawAssertionPayload = {
|
|
121
|
+
selector: string;
|
|
122
|
+
data: string[];
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export type ExecutionError = Error & {
|
|
126
|
+
callStack?: string[];
|
|
127
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
128
|
+
acirFunctionId?: number;
|
|
129
|
+
brilligFunctionId?: number;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
|
|
119
133
|
|
|
120
134
|
// Map from witness index to hex string value of witness.
|
|
121
135
|
export type WitnessMap = Map<number, string>;
|
|
@@ -132,15 +146,6 @@ export type SolvedAndReturnWitness = {
|
|
|
132
146
|
|
|
133
147
|
|
|
134
148
|
|
|
135
|
-
export type StackItem = {
|
|
136
|
-
index: number;
|
|
137
|
-
witness: WitnessMap;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export type WitnessStack = Array<StackItem>;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
149
|
export type ForeignCallInput = string[]
|
|
145
150
|
export type ForeignCallOutput = string | string[]
|
|
146
151
|
|
|
@@ -155,17 +160,12 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
|
|
|
155
160
|
|
|
156
161
|
|
|
157
162
|
|
|
158
|
-
export type
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
163
|
+
export type StackItem = {
|
|
164
|
+
index: number;
|
|
165
|
+
witness: WitnessMap;
|
|
166
|
+
}
|
|
162
167
|
|
|
163
|
-
export type
|
|
164
|
-
callStack?: string[];
|
|
165
|
-
rawAssertionPayload?: RawAssertionPayload;
|
|
166
|
-
acirFunctionId?: number;
|
|
167
|
-
brilligFunctionId?: number;
|
|
168
|
-
};
|
|
168
|
+
export type WitnessStack = Array<StackItem>;
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
|
package/nodejs/acvm_js.js
CHANGED
|
@@ -202,6 +202,25 @@ function debugString(val) {
|
|
|
202
202
|
return className;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
function takeFromExternrefTable0(idx) {
|
|
206
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
207
|
+
wasm.__externref_table_dealloc(idx);
|
|
208
|
+
return value;
|
|
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
|
+
|
|
205
224
|
function passArray8ToWasm0(arg, malloc) {
|
|
206
225
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
207
226
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -254,25 +273,6 @@ module.exports.executeProgram = function(program, initial_witness, foreign_call_
|
|
|
254
273
|
return ret;
|
|
255
274
|
};
|
|
256
275
|
|
|
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
276
|
/**
|
|
277
277
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
278
278
|
*
|
|
@@ -333,84 +333,6 @@ module.exports.getPublicWitness = function(program, solved_witness) {
|
|
|
333
333
|
return takeFromExternrefTable0(ret[0]);
|
|
334
334
|
};
|
|
335
335
|
|
|
336
|
-
/**
|
|
337
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
338
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
339
|
-
*/
|
|
340
|
-
module.exports.buildInfo = function() {
|
|
341
|
-
const ret = wasm.buildInfo();
|
|
342
|
-
return ret;
|
|
343
|
-
};
|
|
344
|
-
|
|
345
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
346
|
-
ptr = ptr >>> 0;
|
|
347
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
351
|
-
*
|
|
352
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
353
|
-
* @returns {Uint8Array} A compressed witness map
|
|
354
|
-
*/
|
|
355
|
-
module.exports.compressWitness = function(witness_map) {
|
|
356
|
-
const ret = wasm.compressWitness(witness_map);
|
|
357
|
-
if (ret[3]) {
|
|
358
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
359
|
-
}
|
|
360
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
361
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
362
|
-
return v1;
|
|
363
|
-
};
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
367
|
-
* This should be used to only fetch the witness map for the main function.
|
|
368
|
-
*
|
|
369
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
370
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
371
|
-
*/
|
|
372
|
-
module.exports.decompressWitness = function(compressed_witness) {
|
|
373
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
374
|
-
const len0 = WASM_VECTOR_LEN;
|
|
375
|
-
const ret = wasm.decompressWitness(ptr0, len0);
|
|
376
|
-
if (ret[2]) {
|
|
377
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
378
|
-
}
|
|
379
|
-
return takeFromExternrefTable0(ret[0]);
|
|
380
|
-
};
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
384
|
-
*
|
|
385
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
386
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
387
|
-
*/
|
|
388
|
-
module.exports.compressWitnessStack = function(witness_stack) {
|
|
389
|
-
const ret = wasm.compressWitnessStack(witness_stack);
|
|
390
|
-
if (ret[3]) {
|
|
391
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
392
|
-
}
|
|
393
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
394
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
395
|
-
return v1;
|
|
396
|
-
};
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
400
|
-
*
|
|
401
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
402
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
403
|
-
*/
|
|
404
|
-
module.exports.decompressWitnessStack = function(compressed_witness) {
|
|
405
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
406
|
-
const len0 = WASM_VECTOR_LEN;
|
|
407
|
-
const ret = wasm.decompressWitnessStack(ptr0, len0);
|
|
408
|
-
if (ret[2]) {
|
|
409
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
410
|
-
}
|
|
411
|
-
return takeFromExternrefTable0(ret[0]);
|
|
412
|
-
};
|
|
413
|
-
|
|
414
336
|
/**
|
|
415
337
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
416
338
|
* @param {string} lhs
|
|
@@ -470,6 +392,10 @@ module.exports.sha256_compression = function(inputs, state) {
|
|
|
470
392
|
return v3;
|
|
471
393
|
};
|
|
472
394
|
|
|
395
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
396
|
+
ptr = ptr >>> 0;
|
|
397
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
398
|
+
}
|
|
473
399
|
/**
|
|
474
400
|
* Calculates the Blake2s256 hash of the input bytes
|
|
475
401
|
* @param {Uint8Array} inputs
|
|
@@ -526,16 +452,90 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
|
|
|
526
452
|
return ret !== 0;
|
|
527
453
|
};
|
|
528
454
|
|
|
455
|
+
/**
|
|
456
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
457
|
+
*
|
|
458
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
459
|
+
* @returns {Uint8Array} A compressed witness map
|
|
460
|
+
*/
|
|
461
|
+
module.exports.compressWitness = function(witness_map) {
|
|
462
|
+
const ret = wasm.compressWitness(witness_map);
|
|
463
|
+
if (ret[3]) {
|
|
464
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
465
|
+
}
|
|
466
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
467
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
468
|
+
return v1;
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
473
|
+
* This should be used to only fetch the witness map for the main function.
|
|
474
|
+
*
|
|
475
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
476
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
477
|
+
*/
|
|
478
|
+
module.exports.decompressWitness = function(compressed_witness) {
|
|
479
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
480
|
+
const len0 = WASM_VECTOR_LEN;
|
|
481
|
+
const ret = wasm.decompressWitness(ptr0, len0);
|
|
482
|
+
if (ret[2]) {
|
|
483
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
484
|
+
}
|
|
485
|
+
return takeFromExternrefTable0(ret[0]);
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
490
|
+
*
|
|
491
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
492
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
493
|
+
*/
|
|
494
|
+
module.exports.compressWitnessStack = function(witness_stack) {
|
|
495
|
+
const ret = wasm.compressWitnessStack(witness_stack);
|
|
496
|
+
if (ret[3]) {
|
|
497
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
498
|
+
}
|
|
499
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
500
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
501
|
+
return v1;
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
506
|
+
*
|
|
507
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
508
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
509
|
+
*/
|
|
510
|
+
module.exports.decompressWitnessStack = function(compressed_witness) {
|
|
511
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
512
|
+
const len0 = WASM_VECTOR_LEN;
|
|
513
|
+
const ret = wasm.decompressWitnessStack(ptr0, len0);
|
|
514
|
+
if (ret[2]) {
|
|
515
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
516
|
+
}
|
|
517
|
+
return takeFromExternrefTable0(ret[0]);
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
522
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
523
|
+
*/
|
|
524
|
+
module.exports.buildInfo = function() {
|
|
525
|
+
const ret = wasm.buildInfo();
|
|
526
|
+
return ret;
|
|
527
|
+
};
|
|
528
|
+
|
|
529
529
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
530
|
-
wasm.
|
|
530
|
+
wasm.closure490_externref_shim(arg0, arg1, arg2);
|
|
531
531
|
}
|
|
532
532
|
|
|
533
533
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
534
|
-
wasm.
|
|
534
|
+
wasm.closure996_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.closure1000_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_536364f6bcd4616b = 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_66e92e9c3ecae9e8 = 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_36c79b224aeafbf0 = function() {
|
|
678
|
-
const ret = new Array();
|
|
679
|
-
return ret;
|
|
680
|
-
};
|
|
681
|
-
|
|
682
677
|
module.exports.__wbg_new_5e0be73521bc8c17 = function() {
|
|
683
678
|
const ret = new Map();
|
|
684
679
|
return ret;
|
|
@@ -694,8 +689,8 @@ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
|
|
|
694
689
|
return ret;
|
|
695
690
|
};
|
|
696
691
|
|
|
697
|
-
module.exports.
|
|
698
|
-
const ret = new
|
|
692
|
+
module.exports.__wbg_new_9f501325818b4158 = function() {
|
|
693
|
+
const ret = new Array();
|
|
699
694
|
return ret;
|
|
700
695
|
};
|
|
701
696
|
|
|
@@ -704,6 +699,11 @@ module.exports.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
|
|
|
704
699
|
return ret;
|
|
705
700
|
};
|
|
706
701
|
|
|
702
|
+
module.exports.__wbg_new_ec40611a7805f1f0 = function() {
|
|
703
|
+
const ret = new Map();
|
|
704
|
+
return ret;
|
|
705
|
+
};
|
|
706
|
+
|
|
707
707
|
module.exports.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
708
708
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
709
709
|
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_wrapper1603 = function(arg0, arg1, arg2) {
|
|
817
|
+
const ret = makeMutClosure(arg0, arg1, 491, __wbg_adapter_30);
|
|
818
818
|
return ret;
|
|
819
819
|
};
|
|
820
820
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,24 +1,24 @@
|
|
|
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];
|
|
4
5
|
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
5
6
|
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
6
7
|
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
7
|
-
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
8
8
|
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
9
9
|
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
10
10
|
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
11
|
-
export const buildInfo: () => any;
|
|
12
|
-
export const compressWitness: (a: any) => [number, number, number, number];
|
|
13
|
-
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
14
|
-
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
15
|
-
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
16
11
|
export const and: (a: any, b: any) => any;
|
|
17
12
|
export const xor: (a: any, b: any) => any;
|
|
18
13
|
export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
19
14
|
export const blake2s256: (a: number, b: number) => [number, number];
|
|
20
15
|
export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
21
16
|
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 compressWitness: (a: any) => [number, number, number, number];
|
|
18
|
+
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
19
|
+
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
20
|
+
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
21
|
+
export const buildInfo: () => any;
|
|
22
22
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
23
23
|
export const __externref_table_alloc: () => number;
|
|
24
24
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -27,7 +27,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
|
27
27
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
28
28
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
29
29
|
export const __externref_table_dealloc: (a: number) => void;
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
30
|
+
export const closure490_externref_shim: (a: number, b: number, c: any) => void;
|
|
31
|
+
export const closure996_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
32
|
+
export const closure1000_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
33
33
|
export const __wbindgen_start: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/noir-acvm_js",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.96bb3f7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"@web/dev-server-esbuild": "^1.0.4",
|
|
42
42
|
"@web/test-runner": "^0.20.2",
|
|
43
43
|
"@web/test-runner-playwright": "^0.11.1",
|
|
44
|
-
"chai": "^
|
|
45
|
-
"eslint": "^9.
|
|
46
|
-
"eslint-plugin-prettier": "^5.4
|
|
47
|
-
"mocha": "^11.5
|
|
48
|
-
"prettier": "3.
|
|
44
|
+
"chai": "^6.2.2",
|
|
45
|
+
"eslint": "^9.39.2",
|
|
46
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
47
|
+
"mocha": "^11.7.5",
|
|
48
|
+
"prettier": "3.7.4",
|
|
49
49
|
"ts-node": "^10.9.2",
|
|
50
50
|
"typescript": "^5.8.3"
|
|
51
51
|
}
|
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
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;
|
|
3
9
|
/**
|
|
4
10
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
11
|
*
|
|
@@ -28,12 +34,6 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
|
|
|
28
34
|
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
29
35
|
*/
|
|
30
36
|
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
37
|
/**
|
|
38
38
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
39
39
|
*
|
|
@@ -59,10 +59,29 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
|
|
|
59
59
|
*/
|
|
60
60
|
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
61
61
|
/**
|
|
62
|
-
*
|
|
63
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
62
|
+
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
64
63
|
*/
|
|
65
|
-
export function
|
|
64
|
+
export function and(lhs: string, rhs: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* Performs a bitwise XOR operation between `lhs` and `rhs`
|
|
67
|
+
*/
|
|
68
|
+
export function xor(lhs: string, rhs: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* Sha256 compression function
|
|
71
|
+
*/
|
|
72
|
+
export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
|
|
73
|
+
/**
|
|
74
|
+
* Calculates the Blake2s256 hash of the input bytes
|
|
75
|
+
*/
|
|
76
|
+
export function blake2s256(inputs: Uint8Array): Uint8Array;
|
|
77
|
+
/**
|
|
78
|
+
* Verifies a ECDSA signature over the secp256k1 curve.
|
|
79
|
+
*/
|
|
80
|
+
export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
83
|
+
*/
|
|
84
|
+
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
66
85
|
/**
|
|
67
86
|
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
68
87
|
*
|
|
@@ -93,29 +112,24 @@ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
|
93
112
|
*/
|
|
94
113
|
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
95
114
|
/**
|
|
96
|
-
*
|
|
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.
|
|
115
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
116
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
117
117
|
*/
|
|
118
|
-
export function
|
|
118
|
+
export function buildInfo(): BuildInfo;
|
|
119
|
+
|
|
120
|
+
export type RawAssertionPayload = {
|
|
121
|
+
selector: string;
|
|
122
|
+
data: string[];
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export type ExecutionError = Error & {
|
|
126
|
+
callStack?: string[];
|
|
127
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
128
|
+
acirFunctionId?: number;
|
|
129
|
+
brilligFunctionId?: number;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
|
|
119
133
|
|
|
120
134
|
// Map from witness index to hex string value of witness.
|
|
121
135
|
export type WitnessMap = Map<number, string>;
|
|
@@ -132,15 +146,6 @@ export type SolvedAndReturnWitness = {
|
|
|
132
146
|
|
|
133
147
|
|
|
134
148
|
|
|
135
|
-
export type StackItem = {
|
|
136
|
-
index: number;
|
|
137
|
-
witness: WitnessMap;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export type WitnessStack = Array<StackItem>;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
149
|
export type ForeignCallInput = string[]
|
|
145
150
|
export type ForeignCallOutput = string | string[]
|
|
146
151
|
|
|
@@ -155,17 +160,12 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
|
|
|
155
160
|
|
|
156
161
|
|
|
157
162
|
|
|
158
|
-
export type
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
163
|
+
export type StackItem = {
|
|
164
|
+
index: number;
|
|
165
|
+
witness: WitnessMap;
|
|
166
|
+
}
|
|
162
167
|
|
|
163
|
-
export type
|
|
164
|
-
callStack?: string[];
|
|
165
|
-
rawAssertionPayload?: RawAssertionPayload;
|
|
166
|
-
acirFunctionId?: number;
|
|
167
|
-
brilligFunctionId?: number;
|
|
168
|
-
};
|
|
168
|
+
export type WitnessStack = Array<StackItem>;
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
|
|
@@ -187,24 +187,24 @@ 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];
|
|
190
191
|
readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
191
192
|
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
192
193
|
readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
193
|
-
readonly initLogLevel: (a: number, b: number) => [number, number];
|
|
194
194
|
readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
195
195
|
readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
196
196
|
readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
197
|
-
readonly buildInfo: () => any;
|
|
198
|
-
readonly compressWitness: (a: any) => [number, number, number, number];
|
|
199
|
-
readonly decompressWitness: (a: number, b: number) => [number, number, number];
|
|
200
|
-
readonly compressWitnessStack: (a: any) => [number, number, number, number];
|
|
201
|
-
readonly decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
202
197
|
readonly and: (a: any, b: any) => any;
|
|
203
198
|
readonly xor: (a: any, b: any) => any;
|
|
204
199
|
readonly sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
205
200
|
readonly blake2s256: (a: number, b: number) => [number, number];
|
|
206
201
|
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
207
202
|
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
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
|
+
readonly buildInfo: () => any;
|
|
208
208
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
209
209
|
readonly __externref_table_alloc: () => number;
|
|
210
210
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -213,9 +213,9 @@ export interface InitOutput {
|
|
|
213
213
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
214
214
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
215
215
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
216
|
-
readonly
|
|
217
|
-
readonly
|
|
218
|
-
readonly
|
|
216
|
+
readonly closure490_externref_shim: (a: number, b: number, c: any) => void;
|
|
217
|
+
readonly closure996_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
218
|
+
readonly closure1000_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
|
@@ -198,6 +198,25 @@ function debugString(val) {
|
|
|
198
198
|
return className;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
+
function takeFromExternrefTable0(idx) {
|
|
202
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
203
|
+
wasm.__externref_table_dealloc(idx);
|
|
204
|
+
return value;
|
|
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
|
+
|
|
201
220
|
function passArray8ToWasm0(arg, malloc) {
|
|
202
221
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
203
222
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -250,25 +269,6 @@ export function executeProgram(program, initial_witness, foreign_call_handler) {
|
|
|
250
269
|
return ret;
|
|
251
270
|
}
|
|
252
271
|
|
|
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
272
|
/**
|
|
273
273
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
274
274
|
*
|
|
@@ -329,84 +329,6 @@ export function getPublicWitness(program, solved_witness) {
|
|
|
329
329
|
return takeFromExternrefTable0(ret[0]);
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
/**
|
|
333
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
334
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
335
|
-
*/
|
|
336
|
-
export function buildInfo() {
|
|
337
|
-
const ret = wasm.buildInfo();
|
|
338
|
-
return ret;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
342
|
-
ptr = ptr >>> 0;
|
|
343
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
347
|
-
*
|
|
348
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
349
|
-
* @returns {Uint8Array} A compressed witness map
|
|
350
|
-
*/
|
|
351
|
-
export function compressWitness(witness_map) {
|
|
352
|
-
const ret = wasm.compressWitness(witness_map);
|
|
353
|
-
if (ret[3]) {
|
|
354
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
355
|
-
}
|
|
356
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
357
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
358
|
-
return v1;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
363
|
-
* This should be used to only fetch the witness map for the main function.
|
|
364
|
-
*
|
|
365
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
366
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
367
|
-
*/
|
|
368
|
-
export function decompressWitness(compressed_witness) {
|
|
369
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
370
|
-
const len0 = WASM_VECTOR_LEN;
|
|
371
|
-
const ret = wasm.decompressWitness(ptr0, len0);
|
|
372
|
-
if (ret[2]) {
|
|
373
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
374
|
-
}
|
|
375
|
-
return takeFromExternrefTable0(ret[0]);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
380
|
-
*
|
|
381
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
382
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
383
|
-
*/
|
|
384
|
-
export function compressWitnessStack(witness_stack) {
|
|
385
|
-
const ret = wasm.compressWitnessStack(witness_stack);
|
|
386
|
-
if (ret[3]) {
|
|
387
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
388
|
-
}
|
|
389
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
390
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
391
|
-
return v1;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
396
|
-
*
|
|
397
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
398
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
399
|
-
*/
|
|
400
|
-
export function decompressWitnessStack(compressed_witness) {
|
|
401
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
402
|
-
const len0 = WASM_VECTOR_LEN;
|
|
403
|
-
const ret = wasm.decompressWitnessStack(ptr0, len0);
|
|
404
|
-
if (ret[2]) {
|
|
405
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
406
|
-
}
|
|
407
|
-
return takeFromExternrefTable0(ret[0]);
|
|
408
|
-
}
|
|
409
|
-
|
|
410
332
|
/**
|
|
411
333
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
412
334
|
* @param {string} lhs
|
|
@@ -466,6 +388,10 @@ export function sha256_compression(inputs, state) {
|
|
|
466
388
|
return v3;
|
|
467
389
|
}
|
|
468
390
|
|
|
391
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
392
|
+
ptr = ptr >>> 0;
|
|
393
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
394
|
+
}
|
|
469
395
|
/**
|
|
470
396
|
* Calculates the Blake2s256 hash of the input bytes
|
|
471
397
|
* @param {Uint8Array} inputs
|
|
@@ -522,16 +448,90 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
|
|
|
522
448
|
return ret !== 0;
|
|
523
449
|
}
|
|
524
450
|
|
|
451
|
+
/**
|
|
452
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
453
|
+
*
|
|
454
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
455
|
+
* @returns {Uint8Array} A compressed witness map
|
|
456
|
+
*/
|
|
457
|
+
export function compressWitness(witness_map) {
|
|
458
|
+
const ret = wasm.compressWitness(witness_map);
|
|
459
|
+
if (ret[3]) {
|
|
460
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
461
|
+
}
|
|
462
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
463
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
464
|
+
return v1;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
469
|
+
* This should be used to only fetch the witness map for the main function.
|
|
470
|
+
*
|
|
471
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
472
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
473
|
+
*/
|
|
474
|
+
export function decompressWitness(compressed_witness) {
|
|
475
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
476
|
+
const len0 = WASM_VECTOR_LEN;
|
|
477
|
+
const ret = wasm.decompressWitness(ptr0, len0);
|
|
478
|
+
if (ret[2]) {
|
|
479
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
480
|
+
}
|
|
481
|
+
return takeFromExternrefTable0(ret[0]);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
486
|
+
*
|
|
487
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
488
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
489
|
+
*/
|
|
490
|
+
export function compressWitnessStack(witness_stack) {
|
|
491
|
+
const ret = wasm.compressWitnessStack(witness_stack);
|
|
492
|
+
if (ret[3]) {
|
|
493
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
494
|
+
}
|
|
495
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
496
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
497
|
+
return v1;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
502
|
+
*
|
|
503
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
504
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
505
|
+
*/
|
|
506
|
+
export function decompressWitnessStack(compressed_witness) {
|
|
507
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
508
|
+
const len0 = WASM_VECTOR_LEN;
|
|
509
|
+
const ret = wasm.decompressWitnessStack(ptr0, len0);
|
|
510
|
+
if (ret[2]) {
|
|
511
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
512
|
+
}
|
|
513
|
+
return takeFromExternrefTable0(ret[0]);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
518
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
519
|
+
*/
|
|
520
|
+
export function buildInfo() {
|
|
521
|
+
const ret = wasm.buildInfo();
|
|
522
|
+
return ret;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
525
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
526
|
-
wasm.
|
|
526
|
+
wasm.closure490_externref_shim(arg0, arg1, arg2);
|
|
527
527
|
}
|
|
528
528
|
|
|
529
529
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
530
|
-
wasm.
|
|
530
|
+
wasm.closure996_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.closure1000_externref_shim(arg0, arg1, arg2, arg3);
|
|
535
535
|
}
|
|
536
536
|
|
|
537
537
|
async function __wbg_load(module, imports) {
|
|
@@ -580,11 +580,11 @@ function __wbg_get_imports() {
|
|
|
580
580
|
const ret = arg0.call(arg1, arg2, arg3);
|
|
581
581
|
return ret;
|
|
582
582
|
}, arguments) };
|
|
583
|
-
imports.wbg.
|
|
583
|
+
imports.wbg.__wbg_constructor_536364f6bcd4616b = function(arg0) {
|
|
584
584
|
const ret = new Error(arg0);
|
|
585
585
|
return ret;
|
|
586
586
|
};
|
|
587
|
-
imports.wbg.
|
|
587
|
+
imports.wbg.__wbg_constructor_66e92e9c3ecae9e8 = function(arg0) {
|
|
588
588
|
const ret = new Error(arg0);
|
|
589
589
|
return ret;
|
|
590
590
|
};
|
|
@@ -685,10 +685,6 @@ function __wbg_get_imports() {
|
|
|
685
685
|
state0.a = state0.b = 0;
|
|
686
686
|
}
|
|
687
687
|
};
|
|
688
|
-
imports.wbg.__wbg_new_36c79b224aeafbf0 = function() {
|
|
689
|
-
const ret = new Array();
|
|
690
|
-
return ret;
|
|
691
|
-
};
|
|
692
688
|
imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
|
|
693
689
|
const ret = new Map();
|
|
694
690
|
return ret;
|
|
@@ -701,14 +697,18 @@ function __wbg_get_imports() {
|
|
|
701
697
|
const ret = new Error();
|
|
702
698
|
return ret;
|
|
703
699
|
};
|
|
704
|
-
imports.wbg.
|
|
705
|
-
const ret = new
|
|
700
|
+
imports.wbg.__wbg_new_9f501325818b4158 = function() {
|
|
701
|
+
const ret = new Array();
|
|
706
702
|
return ret;
|
|
707
703
|
};
|
|
708
704
|
imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
|
|
709
705
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
710
706
|
return ret;
|
|
711
707
|
};
|
|
708
|
+
imports.wbg.__wbg_new_ec40611a7805f1f0 = function() {
|
|
709
|
+
const ret = new Map();
|
|
710
|
+
return ret;
|
|
711
|
+
};
|
|
712
712
|
imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
713
713
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
714
714
|
return ret;
|
|
@@ -797,8 +797,8 @@ function __wbg_get_imports() {
|
|
|
797
797
|
const ret = false;
|
|
798
798
|
return ret;
|
|
799
799
|
};
|
|
800
|
-
imports.wbg.
|
|
801
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
800
|
+
imports.wbg.__wbindgen_closure_wrapper1603 = function(arg0, arg1, arg2) {
|
|
801
|
+
const ret = makeMutClosure(arg0, arg1, 491, __wbg_adapter_30);
|
|
802
802
|
return ret;
|
|
803
803
|
};
|
|
804
804
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
package/web/acvm_js_bg.wasm
CHANGED
|
Binary file
|
package/web/acvm_js_bg.wasm.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
4
5
|
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
5
6
|
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
6
7
|
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
7
|
-
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
8
8
|
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
9
9
|
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
10
10
|
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
11
|
-
export const buildInfo: () => any;
|
|
12
|
-
export const compressWitness: (a: any) => [number, number, number, number];
|
|
13
|
-
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
14
|
-
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
15
|
-
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
16
11
|
export const and: (a: any, b: any) => any;
|
|
17
12
|
export const xor: (a: any, b: any) => any;
|
|
18
13
|
export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
19
14
|
export const blake2s256: (a: number, b: number) => [number, number];
|
|
20
15
|
export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
21
16
|
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 compressWitness: (a: any) => [number, number, number, number];
|
|
18
|
+
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
19
|
+
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
20
|
+
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
21
|
+
export const buildInfo: () => any;
|
|
22
22
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
23
23
|
export const __externref_table_alloc: () => number;
|
|
24
24
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -27,7 +27,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
|
27
27
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
28
28
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
29
29
|
export const __externref_table_dealloc: (a: number) => void;
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
30
|
+
export const closure490_externref_shim: (a: number, b: number, c: any) => void;
|
|
31
|
+
export const closure996_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
32
|
+
export const closure1000_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
33
33
|
export const __wbindgen_start: () => void;
|