@aztec/noir-acvm_js 4.0.0-nightly.20250907 → 4.0.0-nightly.20260107
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 +54 -54
- package/nodejs/acvm_js.js +93 -93
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +8 -8
- package/package.json +7 -7
- package/web/acvm_js.d.ts +62 -62
- package/web/acvm_js.js +93 -93
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +8 -8
package/nodejs/acvm_js.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
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.
|
|
7
6
|
*/
|
|
8
|
-
export function
|
|
7
|
+
export function buildInfo(): BuildInfo;
|
|
9
8
|
/**
|
|
10
9
|
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
11
10
|
*
|
|
@@ -64,34 +63,11 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
|
|
|
64
63
|
*/
|
|
65
64
|
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
66
65
|
/**
|
|
67
|
-
*
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Performs a bitwise XOR operation between `lhs` and `rhs`
|
|
72
|
-
*/
|
|
73
|
-
export function xor(lhs: string, rhs: string): string;
|
|
74
|
-
/**
|
|
75
|
-
* Sha256 compression function
|
|
76
|
-
*/
|
|
77
|
-
export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
|
|
78
|
-
/**
|
|
79
|
-
* Calculates the Blake2s256 hash of the input bytes
|
|
80
|
-
*/
|
|
81
|
-
export function blake2s256(inputs: Uint8Array): Uint8Array;
|
|
82
|
-
/**
|
|
83
|
-
* Verifies a ECDSA signature over the secp256k1 curve.
|
|
84
|
-
*/
|
|
85
|
-
export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
86
|
-
/**
|
|
87
|
-
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
88
|
-
*/
|
|
89
|
-
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
90
|
-
/**
|
|
91
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
92
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
66
|
+
* Sets the package's logging level.
|
|
67
|
+
*
|
|
68
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
93
69
|
*/
|
|
94
|
-
export function
|
|
70
|
+
export function initLogLevel(filter: string): void;
|
|
95
71
|
/**
|
|
96
72
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
97
73
|
*
|
|
@@ -116,15 +92,30 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
|
|
|
116
92
|
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
117
93
|
*/
|
|
118
94
|
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
97
|
+
*/
|
|
98
|
+
export function and(lhs: string, rhs: string): string;
|
|
99
|
+
/**
|
|
100
|
+
* Performs a bitwise XOR operation between `lhs` and `rhs`
|
|
101
|
+
*/
|
|
102
|
+
export function xor(lhs: string, rhs: string): string;
|
|
103
|
+
/**
|
|
104
|
+
* Sha256 compression function
|
|
105
|
+
*/
|
|
106
|
+
export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
|
|
107
|
+
/**
|
|
108
|
+
* Calculates the Blake2s256 hash of the input bytes
|
|
109
|
+
*/
|
|
110
|
+
export function blake2s256(inputs: Uint8Array): Uint8Array;
|
|
111
|
+
/**
|
|
112
|
+
* Verifies a ECDSA signature over the secp256k1 curve.
|
|
113
|
+
*/
|
|
114
|
+
export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
117
|
+
*/
|
|
118
|
+
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
128
119
|
|
|
129
120
|
/**
|
|
130
121
|
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
@@ -140,20 +131,6 @@ export type BuildInfo = {
|
|
|
140
131
|
|
|
141
132
|
|
|
142
133
|
|
|
143
|
-
export type RawAssertionPayload = {
|
|
144
|
-
selector: string;
|
|
145
|
-
data: string[];
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
export type ExecutionError = Error & {
|
|
149
|
-
callStack?: string[];
|
|
150
|
-
rawAssertionPayload?: RawAssertionPayload;
|
|
151
|
-
acirFunctionId?: number;
|
|
152
|
-
brilligFunctionId?: number;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
134
|
// Map from witness index to hex string value of witness.
|
|
158
135
|
export type WitnessMap = Map<number, string>;
|
|
159
136
|
|
|
@@ -169,6 +146,15 @@ export type SolvedAndReturnWitness = {
|
|
|
169
146
|
|
|
170
147
|
|
|
171
148
|
|
|
149
|
+
export type StackItem = {
|
|
150
|
+
index: number;
|
|
151
|
+
witness: WitnessMap;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export type WitnessStack = Array<StackItem>;
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
172
158
|
export type ForeignCallInput = string[]
|
|
173
159
|
export type ForeignCallOutput = string | string[]
|
|
174
160
|
|
|
@@ -182,3 +168,17 @@ export type ForeignCallOutput = string | string[]
|
|
|
182
168
|
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
183
169
|
|
|
184
170
|
|
|
171
|
+
|
|
172
|
+
export type RawAssertionPayload = {
|
|
173
|
+
selector: string;
|
|
174
|
+
data: string[];
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export type ExecutionError = Error & {
|
|
178
|
+
callStack?: string[];
|
|
179
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
180
|
+
acirFunctionId?: number;
|
|
181
|
+
brilligFunctionId?: number;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
|
package/nodejs/acvm_js.js
CHANGED
|
@@ -201,25 +201,20 @@ 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
|
+
};
|
|
204
212
|
|
|
205
213
|
function takeFromExternrefTable0(idx) {
|
|
206
214
|
const value = wasm.__wbindgen_export_2.get(idx);
|
|
207
215
|
wasm.__externref_table_dealloc(idx);
|
|
208
216
|
return value;
|
|
209
217
|
}
|
|
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
218
|
|
|
224
219
|
function getArrayU8FromWasm0(ptr, len) {
|
|
225
220
|
ptr = ptr >>> 0;
|
|
@@ -342,6 +337,80 @@ module.exports.executeProgram = function(program, initial_witness, foreign_call_
|
|
|
342
337
|
return ret;
|
|
343
338
|
};
|
|
344
339
|
|
|
340
|
+
/**
|
|
341
|
+
* Sets the package's logging level.
|
|
342
|
+
*
|
|
343
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
344
|
+
*/
|
|
345
|
+
module.exports.initLogLevel = function(filter) {
|
|
346
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
347
|
+
const len0 = WASM_VECTOR_LEN;
|
|
348
|
+
const ret = wasm.initLogLevel(ptr0, len0);
|
|
349
|
+
if (ret[1]) {
|
|
350
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
356
|
+
*
|
|
357
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
358
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
359
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
360
|
+
* @param {Uint8Array} program
|
|
361
|
+
* @param {WitnessMap} witness_map
|
|
362
|
+
* @returns {WitnessMap}
|
|
363
|
+
*/
|
|
364
|
+
module.exports.getReturnWitness = function(program, witness_map) {
|
|
365
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
366
|
+
const len0 = WASM_VECTOR_LEN;
|
|
367
|
+
const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
|
|
368
|
+
if (ret[2]) {
|
|
369
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
370
|
+
}
|
|
371
|
+
return takeFromExternrefTable0(ret[0]);
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
376
|
+
*
|
|
377
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
378
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
379
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
380
|
+
* @param {Uint8Array} program
|
|
381
|
+
* @param {WitnessMap} solved_witness
|
|
382
|
+
* @returns {WitnessMap}
|
|
383
|
+
*/
|
|
384
|
+
module.exports.getPublicParametersWitness = function(program, solved_witness) {
|
|
385
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
386
|
+
const len0 = WASM_VECTOR_LEN;
|
|
387
|
+
const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
|
|
388
|
+
if (ret[2]) {
|
|
389
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
390
|
+
}
|
|
391
|
+
return takeFromExternrefTable0(ret[0]);
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
396
|
+
*
|
|
397
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
398
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
399
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
400
|
+
* @param {Uint8Array} program
|
|
401
|
+
* @param {WitnessMap} solved_witness
|
|
402
|
+
* @returns {WitnessMap}
|
|
403
|
+
*/
|
|
404
|
+
module.exports.getPublicWitness = function(program, solved_witness) {
|
|
405
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
406
|
+
const len0 = WASM_VECTOR_LEN;
|
|
407
|
+
const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
|
|
408
|
+
if (ret[2]) {
|
|
409
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
410
|
+
}
|
|
411
|
+
return takeFromExternrefTable0(ret[0]);
|
|
412
|
+
};
|
|
413
|
+
|
|
345
414
|
/**
|
|
346
415
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
347
416
|
* @param {string} lhs
|
|
@@ -457,85 +526,16 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
|
|
|
457
526
|
return ret !== 0;
|
|
458
527
|
};
|
|
459
528
|
|
|
460
|
-
/**
|
|
461
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
462
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
463
|
-
*/
|
|
464
|
-
module.exports.buildInfo = function() {
|
|
465
|
-
const ret = wasm.buildInfo();
|
|
466
|
-
return ret;
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
/**
|
|
470
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
471
|
-
*
|
|
472
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
473
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
474
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
475
|
-
* @param {Uint8Array} program
|
|
476
|
-
* @param {WitnessMap} witness_map
|
|
477
|
-
* @returns {WitnessMap}
|
|
478
|
-
*/
|
|
479
|
-
module.exports.getReturnWitness = function(program, witness_map) {
|
|
480
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
481
|
-
const len0 = WASM_VECTOR_LEN;
|
|
482
|
-
const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
|
|
483
|
-
if (ret[2]) {
|
|
484
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
485
|
-
}
|
|
486
|
-
return takeFromExternrefTable0(ret[0]);
|
|
487
|
-
};
|
|
488
|
-
|
|
489
|
-
/**
|
|
490
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
491
|
-
*
|
|
492
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
493
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
494
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
495
|
-
* @param {Uint8Array} program
|
|
496
|
-
* @param {WitnessMap} solved_witness
|
|
497
|
-
* @returns {WitnessMap}
|
|
498
|
-
*/
|
|
499
|
-
module.exports.getPublicParametersWitness = function(program, solved_witness) {
|
|
500
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
501
|
-
const len0 = WASM_VECTOR_LEN;
|
|
502
|
-
const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
|
|
503
|
-
if (ret[2]) {
|
|
504
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
505
|
-
}
|
|
506
|
-
return takeFromExternrefTable0(ret[0]);
|
|
507
|
-
};
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
511
|
-
*
|
|
512
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
513
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
514
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
515
|
-
* @param {Uint8Array} program
|
|
516
|
-
* @param {WitnessMap} solved_witness
|
|
517
|
-
* @returns {WitnessMap}
|
|
518
|
-
*/
|
|
519
|
-
module.exports.getPublicWitness = function(program, solved_witness) {
|
|
520
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
521
|
-
const len0 = WASM_VECTOR_LEN;
|
|
522
|
-
const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
|
|
523
|
-
if (ret[2]) {
|
|
524
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
525
|
-
}
|
|
526
|
-
return takeFromExternrefTable0(ret[0]);
|
|
527
|
-
};
|
|
528
|
-
|
|
529
529
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
530
|
-
wasm.
|
|
530
|
+
wasm.closure576_externref_shim(arg0, arg1, arg2);
|
|
531
531
|
}
|
|
532
532
|
|
|
533
533
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
534
|
-
wasm.
|
|
534
|
+
wasm.closure1171_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.closure1175_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_3aef6db465a4d40f = 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_9cd41836d6991f28 = function(arg0) {
|
|
562
562
|
const ret = new Error(arg0);
|
|
563
563
|
return ret;
|
|
564
564
|
};
|
|
@@ -689,8 +689,8 @@ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
|
|
|
689
689
|
return ret;
|
|
690
690
|
};
|
|
691
691
|
|
|
692
|
-
module.exports.
|
|
693
|
-
const ret = new
|
|
692
|
+
module.exports.__wbg_new_8e773a1674584163 = function() {
|
|
693
|
+
const ret = new Array();
|
|
694
694
|
return ret;
|
|
695
695
|
};
|
|
696
696
|
|
|
@@ -699,8 +699,8 @@ module.exports.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
|
|
|
699
699
|
return ret;
|
|
700
700
|
};
|
|
701
701
|
|
|
702
|
-
module.exports.
|
|
703
|
-
const ret = new
|
|
702
|
+
module.exports.__wbg_new_dd245daac54dc568 = function() {
|
|
703
|
+
const ret = new Map();
|
|
704
704
|
return ret;
|
|
705
705
|
};
|
|
706
706
|
|
|
@@ -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_wrapper1971 = function(arg0, arg1, arg2) {
|
|
817
|
+
const ret = makeMutClosure(arg0, arg1, 577, __wbg_adapter_30);
|
|
818
818
|
return ret;
|
|
819
819
|
};
|
|
820
820
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const
|
|
4
|
+
export const buildInfo: () => any;
|
|
5
5
|
export const compressWitness: (a: any) => [number, number, number, number];
|
|
6
6
|
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
7
7
|
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
@@ -9,16 +9,16 @@ export const decompressWitnessStack: (a: number, b: number) => [number, number,
|
|
|
9
9
|
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
10
10
|
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
11
11
|
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
12
|
+
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
13
|
+
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
14
|
+
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
15
|
+
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
12
16
|
export const and: (a: any, b: any) => any;
|
|
13
17
|
export const xor: (a: any, b: any) => any;
|
|
14
18
|
export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
15
19
|
export const blake2s256: (a: number, b: number) => [number, number];
|
|
16
20
|
export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
17
21
|
export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
18
|
-
export const buildInfo: () => any;
|
|
19
|
-
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
20
|
-
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
21
|
-
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
22
22
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
23
23
|
export const __externref_table_alloc: () => number;
|
|
24
24
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -27,7 +27,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
|
27
27
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
28
28
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
29
29
|
export const __externref_table_dealloc: (a: number) => void;
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
30
|
+
export const closure576_externref_shim: (a: number, b: number, c: any) => void;
|
|
31
|
+
export const closure1171_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
32
|
+
export const closure1175_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
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": "4.0.0-nightly.
|
|
3
|
+
"version": "4.0.0-nightly.20260107",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@esm-bundle/chai": "^4.3.4-fix.0",
|
|
41
|
-
"@web/dev-server-esbuild": "^0.
|
|
41
|
+
"@web/dev-server-esbuild": "^1.0.4",
|
|
42
42
|
"@web/test-runner": "^0.20.2",
|
|
43
|
-
"@web/test-runner-playwright": "^0.11.
|
|
44
|
-
"chai": "^4.
|
|
45
|
-
"eslint": "^9.
|
|
46
|
-
"eslint-plugin-prettier": "^5.4
|
|
43
|
+
"@web/test-runner-playwright": "^0.11.1",
|
|
44
|
+
"chai": "^4.5.0",
|
|
45
|
+
"eslint": "^9.39.1",
|
|
46
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
47
47
|
"mocha": "^11.5.0",
|
|
48
|
-
"prettier": "3.
|
|
48
|
+
"prettier": "3.7.3",
|
|
49
49
|
"ts-node": "^10.9.2",
|
|
50
50
|
"typescript": "^5.8.3"
|
|
51
51
|
}
|
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
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.
|
|
7
6
|
*/
|
|
8
|
-
export function
|
|
7
|
+
export function buildInfo(): BuildInfo;
|
|
9
8
|
/**
|
|
10
9
|
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
11
10
|
*
|
|
@@ -64,34 +63,11 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
|
|
|
64
63
|
*/
|
|
65
64
|
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
66
65
|
/**
|
|
67
|
-
*
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Performs a bitwise XOR operation between `lhs` and `rhs`
|
|
72
|
-
*/
|
|
73
|
-
export function xor(lhs: string, rhs: string): string;
|
|
74
|
-
/**
|
|
75
|
-
* Sha256 compression function
|
|
76
|
-
*/
|
|
77
|
-
export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
|
|
78
|
-
/**
|
|
79
|
-
* Calculates the Blake2s256 hash of the input bytes
|
|
80
|
-
*/
|
|
81
|
-
export function blake2s256(inputs: Uint8Array): Uint8Array;
|
|
82
|
-
/**
|
|
83
|
-
* Verifies a ECDSA signature over the secp256k1 curve.
|
|
84
|
-
*/
|
|
85
|
-
export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
86
|
-
/**
|
|
87
|
-
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
88
|
-
*/
|
|
89
|
-
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
90
|
-
/**
|
|
91
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
92
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
66
|
+
* Sets the package's logging level.
|
|
67
|
+
*
|
|
68
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
93
69
|
*/
|
|
94
|
-
export function
|
|
70
|
+
export function initLogLevel(filter: string): void;
|
|
95
71
|
/**
|
|
96
72
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
97
73
|
*
|
|
@@ -116,15 +92,30 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
|
|
|
116
92
|
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
117
93
|
*/
|
|
118
94
|
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
97
|
+
*/
|
|
98
|
+
export function and(lhs: string, rhs: string): string;
|
|
99
|
+
/**
|
|
100
|
+
* Performs a bitwise XOR operation between `lhs` and `rhs`
|
|
101
|
+
*/
|
|
102
|
+
export function xor(lhs: string, rhs: string): string;
|
|
103
|
+
/**
|
|
104
|
+
* Sha256 compression function
|
|
105
|
+
*/
|
|
106
|
+
export function sha256_compression(inputs: Uint32Array, state: Uint32Array): Uint32Array;
|
|
107
|
+
/**
|
|
108
|
+
* Calculates the Blake2s256 hash of the input bytes
|
|
109
|
+
*/
|
|
110
|
+
export function blake2s256(inputs: Uint8Array): Uint8Array;
|
|
111
|
+
/**
|
|
112
|
+
* Verifies a ECDSA signature over the secp256k1 curve.
|
|
113
|
+
*/
|
|
114
|
+
export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
117
|
+
*/
|
|
118
|
+
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
128
119
|
|
|
129
120
|
/**
|
|
130
121
|
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
@@ -140,20 +131,6 @@ export type BuildInfo = {
|
|
|
140
131
|
|
|
141
132
|
|
|
142
133
|
|
|
143
|
-
export type RawAssertionPayload = {
|
|
144
|
-
selector: string;
|
|
145
|
-
data: string[];
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
export type ExecutionError = Error & {
|
|
149
|
-
callStack?: string[];
|
|
150
|
-
rawAssertionPayload?: RawAssertionPayload;
|
|
151
|
-
acirFunctionId?: number;
|
|
152
|
-
brilligFunctionId?: number;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
134
|
// Map from witness index to hex string value of witness.
|
|
158
135
|
export type WitnessMap = Map<number, string>;
|
|
159
136
|
|
|
@@ -169,6 +146,15 @@ export type SolvedAndReturnWitness = {
|
|
|
169
146
|
|
|
170
147
|
|
|
171
148
|
|
|
149
|
+
export type StackItem = {
|
|
150
|
+
index: number;
|
|
151
|
+
witness: WitnessMap;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export type WitnessStack = Array<StackItem>;
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
172
158
|
export type ForeignCallInput = string[]
|
|
173
159
|
export type ForeignCallOutput = string | string[]
|
|
174
160
|
|
|
@@ -183,11 +169,25 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
|
|
|
183
169
|
|
|
184
170
|
|
|
185
171
|
|
|
172
|
+
export type RawAssertionPayload = {
|
|
173
|
+
selector: string;
|
|
174
|
+
data: string[];
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export type ExecutionError = Error & {
|
|
178
|
+
callStack?: string[];
|
|
179
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
180
|
+
acirFunctionId?: number;
|
|
181
|
+
brilligFunctionId?: number;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
186
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
187
187
|
|
|
188
188
|
export interface InitOutput {
|
|
189
189
|
readonly memory: WebAssembly.Memory;
|
|
190
|
-
readonly
|
|
190
|
+
readonly buildInfo: () => any;
|
|
191
191
|
readonly compressWitness: (a: any) => [number, number, number, number];
|
|
192
192
|
readonly decompressWitness: (a: number, b: number) => [number, number, number];
|
|
193
193
|
readonly compressWitnessStack: (a: any) => [number, number, number, number];
|
|
@@ -195,16 +195,16 @@ export interface InitOutput {
|
|
|
195
195
|
readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
196
196
|
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
197
197
|
readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
198
|
+
readonly initLogLevel: (a: number, b: number) => [number, number];
|
|
199
|
+
readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
200
|
+
readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
201
|
+
readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
198
202
|
readonly and: (a: any, b: any) => any;
|
|
199
203
|
readonly xor: (a: any, b: any) => any;
|
|
200
204
|
readonly sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
201
205
|
readonly blake2s256: (a: number, b: number) => [number, number];
|
|
202
206
|
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
203
207
|
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
204
|
-
readonly buildInfo: () => any;
|
|
205
|
-
readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
206
|
-
readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
207
|
-
readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
208
208
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
209
209
|
readonly __externref_table_alloc: () => number;
|
|
210
210
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -213,9 +213,9 @@ export interface InitOutput {
|
|
|
213
213
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
214
214
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
215
215
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
216
|
-
readonly
|
|
217
|
-
readonly
|
|
218
|
-
readonly
|
|
216
|
+
readonly closure576_externref_shim: (a: number, b: number, c: any) => void;
|
|
217
|
+
readonly closure1171_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
218
|
+
readonly closure1175_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
219
219
|
readonly __wbindgen_start: () => void;
|
|
220
220
|
}
|
|
221
221
|
|
package/web/acvm_js.js
CHANGED
|
@@ -197,25 +197,20 @@ 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
|
+
}
|
|
200
208
|
|
|
201
209
|
function takeFromExternrefTable0(idx) {
|
|
202
210
|
const value = wasm.__wbindgen_export_2.get(idx);
|
|
203
211
|
wasm.__externref_table_dealloc(idx);
|
|
204
212
|
return value;
|
|
205
213
|
}
|
|
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
214
|
|
|
220
215
|
function getArrayU8FromWasm0(ptr, len) {
|
|
221
216
|
ptr = ptr >>> 0;
|
|
@@ -338,6 +333,80 @@ export function executeProgram(program, initial_witness, foreign_call_handler) {
|
|
|
338
333
|
return ret;
|
|
339
334
|
}
|
|
340
335
|
|
|
336
|
+
/**
|
|
337
|
+
* Sets the package's logging level.
|
|
338
|
+
*
|
|
339
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
340
|
+
*/
|
|
341
|
+
export function initLogLevel(filter) {
|
|
342
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
343
|
+
const len0 = WASM_VECTOR_LEN;
|
|
344
|
+
const ret = wasm.initLogLevel(ptr0, len0);
|
|
345
|
+
if (ret[1]) {
|
|
346
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
352
|
+
*
|
|
353
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
354
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
355
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
356
|
+
* @param {Uint8Array} program
|
|
357
|
+
* @param {WitnessMap} witness_map
|
|
358
|
+
* @returns {WitnessMap}
|
|
359
|
+
*/
|
|
360
|
+
export function getReturnWitness(program, witness_map) {
|
|
361
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
362
|
+
const len0 = WASM_VECTOR_LEN;
|
|
363
|
+
const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
|
|
364
|
+
if (ret[2]) {
|
|
365
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
366
|
+
}
|
|
367
|
+
return takeFromExternrefTable0(ret[0]);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
372
|
+
*
|
|
373
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
374
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
375
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
376
|
+
* @param {Uint8Array} program
|
|
377
|
+
* @param {WitnessMap} solved_witness
|
|
378
|
+
* @returns {WitnessMap}
|
|
379
|
+
*/
|
|
380
|
+
export function getPublicParametersWitness(program, solved_witness) {
|
|
381
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
382
|
+
const len0 = WASM_VECTOR_LEN;
|
|
383
|
+
const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
|
|
384
|
+
if (ret[2]) {
|
|
385
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
386
|
+
}
|
|
387
|
+
return takeFromExternrefTable0(ret[0]);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
392
|
+
*
|
|
393
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
394
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
395
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
396
|
+
* @param {Uint8Array} program
|
|
397
|
+
* @param {WitnessMap} solved_witness
|
|
398
|
+
* @returns {WitnessMap}
|
|
399
|
+
*/
|
|
400
|
+
export function getPublicWitness(program, solved_witness) {
|
|
401
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
402
|
+
const len0 = WASM_VECTOR_LEN;
|
|
403
|
+
const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
|
|
404
|
+
if (ret[2]) {
|
|
405
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
406
|
+
}
|
|
407
|
+
return takeFromExternrefTable0(ret[0]);
|
|
408
|
+
}
|
|
409
|
+
|
|
341
410
|
/**
|
|
342
411
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
343
412
|
* @param {string} lhs
|
|
@@ -453,85 +522,16 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
|
|
|
453
522
|
return ret !== 0;
|
|
454
523
|
}
|
|
455
524
|
|
|
456
|
-
/**
|
|
457
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
458
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
459
|
-
*/
|
|
460
|
-
export function buildInfo() {
|
|
461
|
-
const ret = wasm.buildInfo();
|
|
462
|
-
return ret;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
467
|
-
*
|
|
468
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
469
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
470
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
471
|
-
* @param {Uint8Array} program
|
|
472
|
-
* @param {WitnessMap} witness_map
|
|
473
|
-
* @returns {WitnessMap}
|
|
474
|
-
*/
|
|
475
|
-
export function getReturnWitness(program, witness_map) {
|
|
476
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
477
|
-
const len0 = WASM_VECTOR_LEN;
|
|
478
|
-
const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
|
|
479
|
-
if (ret[2]) {
|
|
480
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
481
|
-
}
|
|
482
|
-
return takeFromExternrefTable0(ret[0]);
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
/**
|
|
486
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
487
|
-
*
|
|
488
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
489
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
490
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
491
|
-
* @param {Uint8Array} program
|
|
492
|
-
* @param {WitnessMap} solved_witness
|
|
493
|
-
* @returns {WitnessMap}
|
|
494
|
-
*/
|
|
495
|
-
export function getPublicParametersWitness(program, solved_witness) {
|
|
496
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
497
|
-
const len0 = WASM_VECTOR_LEN;
|
|
498
|
-
const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
|
|
499
|
-
if (ret[2]) {
|
|
500
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
501
|
-
}
|
|
502
|
-
return takeFromExternrefTable0(ret[0]);
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
507
|
-
*
|
|
508
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
509
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
510
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
511
|
-
* @param {Uint8Array} program
|
|
512
|
-
* @param {WitnessMap} solved_witness
|
|
513
|
-
* @returns {WitnessMap}
|
|
514
|
-
*/
|
|
515
|
-
export function getPublicWitness(program, solved_witness) {
|
|
516
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
517
|
-
const len0 = WASM_VECTOR_LEN;
|
|
518
|
-
const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
|
|
519
|
-
if (ret[2]) {
|
|
520
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
521
|
-
}
|
|
522
|
-
return takeFromExternrefTable0(ret[0]);
|
|
523
|
-
}
|
|
524
|
-
|
|
525
525
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
526
|
-
wasm.
|
|
526
|
+
wasm.closure576_externref_shim(arg0, arg1, arg2);
|
|
527
527
|
}
|
|
528
528
|
|
|
529
529
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
530
|
-
wasm.
|
|
530
|
+
wasm.closure1171_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.closure1175_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_3aef6db465a4d40f = function(arg0) {
|
|
584
584
|
const ret = new Error(arg0);
|
|
585
585
|
return ret;
|
|
586
586
|
};
|
|
587
|
-
imports.wbg.
|
|
587
|
+
imports.wbg.__wbg_constructor_9cd41836d6991f28 = function(arg0) {
|
|
588
588
|
const ret = new Error(arg0);
|
|
589
589
|
return ret;
|
|
590
590
|
};
|
|
@@ -697,16 +697,16 @@ function __wbg_get_imports() {
|
|
|
697
697
|
const ret = new Error();
|
|
698
698
|
return ret;
|
|
699
699
|
};
|
|
700
|
-
imports.wbg.
|
|
701
|
-
const ret = new
|
|
700
|
+
imports.wbg.__wbg_new_8e773a1674584163 = function() {
|
|
701
|
+
const ret = new Array();
|
|
702
702
|
return ret;
|
|
703
703
|
};
|
|
704
704
|
imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
|
|
705
705
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
706
706
|
return ret;
|
|
707
707
|
};
|
|
708
|
-
imports.wbg.
|
|
709
|
-
const ret = new
|
|
708
|
+
imports.wbg.__wbg_new_dd245daac54dc568 = function() {
|
|
709
|
+
const ret = new Map();
|
|
710
710
|
return ret;
|
|
711
711
|
};
|
|
712
712
|
imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
@@ -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_wrapper1971 = function(arg0, arg1, arg2) {
|
|
801
|
+
const ret = makeMutClosure(arg0, arg1, 577, __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,7 +1,7 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const
|
|
4
|
+
export const buildInfo: () => any;
|
|
5
5
|
export const compressWitness: (a: any) => [number, number, number, number];
|
|
6
6
|
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
7
7
|
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
@@ -9,16 +9,16 @@ export const decompressWitnessStack: (a: number, b: number) => [number, number,
|
|
|
9
9
|
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
10
10
|
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
11
11
|
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
12
|
+
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
13
|
+
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
14
|
+
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
15
|
+
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
12
16
|
export const and: (a: any, b: any) => any;
|
|
13
17
|
export const xor: (a: any, b: any) => any;
|
|
14
18
|
export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
15
19
|
export const blake2s256: (a: number, b: number) => [number, number];
|
|
16
20
|
export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
17
21
|
export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
18
|
-
export const buildInfo: () => any;
|
|
19
|
-
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
20
|
-
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
21
|
-
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
22
22
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
23
23
|
export const __externref_table_alloc: () => number;
|
|
24
24
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -27,7 +27,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
|
27
27
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
28
28
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
29
29
|
export const __externref_table_dealloc: (a: number) => void;
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
30
|
+
export const closure576_externref_shim: (a: number, b: number, c: any) => void;
|
|
31
|
+
export const closure1171_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
32
|
+
export const closure1175_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
33
33
|
export const __wbindgen_start: () => void;
|