@aztec/noir-acvm_js 0.0.0-test.0 → 0.0.1-commit.21caa21
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 +67 -66
- package/nodejs/acvm_js.js +93 -94
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +8 -8
- package/package.json +12 -12
- package/web/acvm_js.d.ts +75 -74
- package/web/acvm_js.js +93 -94
- 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
|
@@ -28,6 +28,41 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
|
|
|
28
28
|
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
29
29
|
*/
|
|
30
30
|
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
|
+
/**
|
|
38
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
39
|
+
*
|
|
40
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
41
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
42
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
43
|
+
*/
|
|
44
|
+
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
45
|
+
/**
|
|
46
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
47
|
+
*
|
|
48
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
49
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
50
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
51
|
+
*/
|
|
52
|
+
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
53
|
+
/**
|
|
54
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
55
|
+
*
|
|
56
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
57
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
58
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
59
|
+
*/
|
|
60
|
+
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
63
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
64
|
+
*/
|
|
65
|
+
export function buildInfo(): BuildInfo;
|
|
31
66
|
/**
|
|
32
67
|
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
33
68
|
*
|
|
@@ -57,12 +92,6 @@ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
|
57
92
|
* @returns {WitnessStack} The decompressed witness stack.
|
|
58
93
|
*/
|
|
59
94
|
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
60
|
-
/**
|
|
61
|
-
* Sets the package's logging level.
|
|
62
|
-
*
|
|
63
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
64
|
-
*/
|
|
65
|
-
export function initLogLevel(filter: string): void;
|
|
66
95
|
/**
|
|
67
96
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
68
97
|
*/
|
|
@@ -87,46 +116,19 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
87
116
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
88
117
|
*/
|
|
89
118
|
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.
|
|
93
|
-
*/
|
|
94
|
-
export function buildInfo(): BuildInfo;
|
|
95
|
-
/**
|
|
96
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
97
|
-
*
|
|
98
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
99
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
100
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
101
|
-
*/
|
|
102
|
-
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
103
|
-
/**
|
|
104
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
105
|
-
*
|
|
106
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
107
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
108
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
109
|
-
*/
|
|
110
|
-
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
111
|
-
/**
|
|
112
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
113
|
-
*
|
|
114
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
115
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
116
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
117
|
-
*/
|
|
118
|
-
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
data: string[];
|
|
123
|
-
};
|
|
120
|
+
// Map from witness index to hex string value of witness.
|
|
121
|
+
export type WitnessMap = Map<number, string>;
|
|
124
122
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
/**
|
|
124
|
+
* An execution result containing two witnesses.
|
|
125
|
+
* 1. The full solved witness of the execution.
|
|
126
|
+
* 2. The return witness which contains the given public return values within the full witness.
|
|
127
|
+
*/
|
|
128
|
+
export type SolvedAndReturnWitness = {
|
|
129
|
+
solvedWitness: WitnessMap;
|
|
130
|
+
returnWitness: WitnessMap;
|
|
131
|
+
}
|
|
130
132
|
|
|
131
133
|
|
|
132
134
|
|
|
@@ -139,20 +141,6 @@ export type WitnessStack = Array<StackItem>;
|
|
|
139
141
|
|
|
140
142
|
|
|
141
143
|
|
|
142
|
-
/**
|
|
143
|
-
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
144
|
-
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
145
|
-
* @property {string} version - The version of the package at the built git commit.
|
|
146
|
-
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
147
|
-
*/
|
|
148
|
-
export type BuildInfo = {
|
|
149
|
-
gitHash: string;
|
|
150
|
-
version: string;
|
|
151
|
-
dirty: string;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
144
|
export type ForeignCallInput = string[]
|
|
157
145
|
export type ForeignCallOutput = string | string[]
|
|
158
146
|
|
|
@@ -167,17 +155,30 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
|
|
|
167
155
|
|
|
168
156
|
|
|
169
157
|
|
|
170
|
-
|
|
171
|
-
|
|
158
|
+
export type RawAssertionPayload = {
|
|
159
|
+
selector: string;
|
|
160
|
+
data: string[];
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export type ExecutionError = Error & {
|
|
164
|
+
callStack?: string[];
|
|
165
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
166
|
+
acirFunctionId?: number;
|
|
167
|
+
brilligFunctionId?: number;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
|
|
172
171
|
|
|
173
172
|
/**
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
174
|
+
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
175
|
+
* @property {string} version - The version of the package at the built git commit.
|
|
176
|
+
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
177
177
|
*/
|
|
178
|
-
export type
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
export type BuildInfo = {
|
|
179
|
+
gitHash: string;
|
|
180
|
+
version: string;
|
|
181
|
+
dirty: string;
|
|
181
182
|
}
|
|
182
183
|
|
|
183
184
|
|
package/nodejs/acvm_js.js
CHANGED
|
@@ -259,6 +259,88 @@ function takeFromExternrefTable0(idx) {
|
|
|
259
259
|
wasm.__externref_table_dealloc(idx);
|
|
260
260
|
return value;
|
|
261
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
|
+
/**
|
|
277
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
278
|
+
*
|
|
279
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
280
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
281
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
282
|
+
* @param {Uint8Array} program
|
|
283
|
+
* @param {WitnessMap} witness_map
|
|
284
|
+
* @returns {WitnessMap}
|
|
285
|
+
*/
|
|
286
|
+
module.exports.getReturnWitness = function(program, witness_map) {
|
|
287
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
288
|
+
const len0 = WASM_VECTOR_LEN;
|
|
289
|
+
const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
|
|
290
|
+
if (ret[2]) {
|
|
291
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
292
|
+
}
|
|
293
|
+
return takeFromExternrefTable0(ret[0]);
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
298
|
+
*
|
|
299
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
300
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
301
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
302
|
+
* @param {Uint8Array} program
|
|
303
|
+
* @param {WitnessMap} solved_witness
|
|
304
|
+
* @returns {WitnessMap}
|
|
305
|
+
*/
|
|
306
|
+
module.exports.getPublicParametersWitness = function(program, solved_witness) {
|
|
307
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
308
|
+
const len0 = WASM_VECTOR_LEN;
|
|
309
|
+
const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
|
|
310
|
+
if (ret[2]) {
|
|
311
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
312
|
+
}
|
|
313
|
+
return takeFromExternrefTable0(ret[0]);
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
318
|
+
*
|
|
319
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
320
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
321
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
322
|
+
* @param {Uint8Array} program
|
|
323
|
+
* @param {WitnessMap} solved_witness
|
|
324
|
+
* @returns {WitnessMap}
|
|
325
|
+
*/
|
|
326
|
+
module.exports.getPublicWitness = function(program, solved_witness) {
|
|
327
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
328
|
+
const len0 = WASM_VECTOR_LEN;
|
|
329
|
+
const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
|
|
330
|
+
if (ret[2]) {
|
|
331
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
332
|
+
}
|
|
333
|
+
return takeFromExternrefTable0(ret[0]);
|
|
334
|
+
};
|
|
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
|
+
};
|
|
262
344
|
|
|
263
345
|
function getArrayU8FromWasm0(ptr, len) {
|
|
264
346
|
ptr = ptr >>> 0;
|
|
@@ -329,20 +411,6 @@ module.exports.decompressWitnessStack = function(compressed_witness) {
|
|
|
329
411
|
return takeFromExternrefTable0(ret[0]);
|
|
330
412
|
};
|
|
331
413
|
|
|
332
|
-
/**
|
|
333
|
-
* Sets the package's logging level.
|
|
334
|
-
*
|
|
335
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
336
|
-
*/
|
|
337
|
-
module.exports.initLogLevel = function(filter) {
|
|
338
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
339
|
-
const len0 = WASM_VECTOR_LEN;
|
|
340
|
-
const ret = wasm.initLogLevel(ptr0, len0);
|
|
341
|
-
if (ret[1]) {
|
|
342
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
|
|
346
414
|
/**
|
|
347
415
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
348
416
|
* @param {string} lhs
|
|
@@ -458,85 +526,16 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
|
|
|
458
526
|
return ret !== 0;
|
|
459
527
|
};
|
|
460
528
|
|
|
461
|
-
/**
|
|
462
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
463
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
464
|
-
*/
|
|
465
|
-
module.exports.buildInfo = function() {
|
|
466
|
-
const ret = wasm.buildInfo();
|
|
467
|
-
return ret;
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
472
|
-
*
|
|
473
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
474
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
475
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
476
|
-
* @param {Uint8Array} program
|
|
477
|
-
* @param {WitnessMap} witness_map
|
|
478
|
-
* @returns {WitnessMap}
|
|
479
|
-
*/
|
|
480
|
-
module.exports.getReturnWitness = function(program, witness_map) {
|
|
481
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
482
|
-
const len0 = WASM_VECTOR_LEN;
|
|
483
|
-
const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
|
|
484
|
-
if (ret[2]) {
|
|
485
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
486
|
-
}
|
|
487
|
-
return takeFromExternrefTable0(ret[0]);
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
/**
|
|
491
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
492
|
-
*
|
|
493
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
494
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
495
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
496
|
-
* @param {Uint8Array} program
|
|
497
|
-
* @param {WitnessMap} solved_witness
|
|
498
|
-
* @returns {WitnessMap}
|
|
499
|
-
*/
|
|
500
|
-
module.exports.getPublicParametersWitness = function(program, solved_witness) {
|
|
501
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
502
|
-
const len0 = WASM_VECTOR_LEN;
|
|
503
|
-
const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
|
|
504
|
-
if (ret[2]) {
|
|
505
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
506
|
-
}
|
|
507
|
-
return takeFromExternrefTable0(ret[0]);
|
|
508
|
-
};
|
|
509
|
-
|
|
510
|
-
/**
|
|
511
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
512
|
-
*
|
|
513
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
514
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
515
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
516
|
-
* @param {Uint8Array} program
|
|
517
|
-
* @param {WitnessMap} solved_witness
|
|
518
|
-
* @returns {WitnessMap}
|
|
519
|
-
*/
|
|
520
|
-
module.exports.getPublicWitness = function(program, solved_witness) {
|
|
521
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
522
|
-
const len0 = WASM_VECTOR_LEN;
|
|
523
|
-
const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
|
|
524
|
-
if (ret[2]) {
|
|
525
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
526
|
-
}
|
|
527
|
-
return takeFromExternrefTable0(ret[0]);
|
|
528
|
-
};
|
|
529
|
-
|
|
530
529
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
531
|
-
wasm.
|
|
530
|
+
wasm.closure576_externref_shim(arg0, arg1, arg2);
|
|
532
531
|
}
|
|
533
532
|
|
|
534
533
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
535
|
-
wasm.
|
|
534
|
+
wasm.closure1171_externref_shim(arg0, arg1, arg2, arg3, arg4);
|
|
536
535
|
}
|
|
537
536
|
|
|
538
537
|
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
539
|
-
wasm.
|
|
538
|
+
wasm.closure1175_externref_shim(arg0, arg1, arg2, arg3);
|
|
540
539
|
}
|
|
541
540
|
|
|
542
541
|
module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
@@ -554,12 +553,12 @@ module.exports.__wbg_call_833bed5770ea2041 = function() { return handleError(fun
|
|
|
554
553
|
return ret;
|
|
555
554
|
}, arguments) };
|
|
556
555
|
|
|
557
|
-
module.exports.
|
|
556
|
+
module.exports.__wbg_constructor_c63bcfd244db473f = function(arg0) {
|
|
558
557
|
const ret = new Error(arg0);
|
|
559
558
|
return ret;
|
|
560
559
|
};
|
|
561
560
|
|
|
562
|
-
module.exports.
|
|
561
|
+
module.exports.__wbg_constructor_e54436b6bd1581f7 = function(arg0) {
|
|
563
562
|
const ret = new Error(arg0);
|
|
564
563
|
return ret;
|
|
565
564
|
};
|
|
@@ -675,8 +674,8 @@ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
|
|
675
674
|
}
|
|
676
675
|
};
|
|
677
676
|
|
|
678
|
-
module.exports.
|
|
679
|
-
const ret = new
|
|
677
|
+
module.exports.__wbg_new_36c79b224aeafbf0 = function() {
|
|
678
|
+
const ret = new Array();
|
|
680
679
|
return ret;
|
|
681
680
|
};
|
|
682
681
|
|
|
@@ -695,8 +694,8 @@ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
|
|
|
695
694
|
return ret;
|
|
696
695
|
};
|
|
697
696
|
|
|
698
|
-
module.exports.
|
|
699
|
-
const ret = new
|
|
697
|
+
module.exports.__wbg_new_c08cf36011667e78 = function() {
|
|
698
|
+
const ret = new Map();
|
|
700
699
|
return ret;
|
|
701
700
|
};
|
|
702
701
|
|
|
@@ -814,8 +813,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
|
814
813
|
return ret;
|
|
815
814
|
};
|
|
816
815
|
|
|
817
|
-
module.exports.
|
|
818
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
816
|
+
module.exports.__wbindgen_closure_wrapper1970 = function(arg0, arg1, arg2) {
|
|
817
|
+
const ret = makeMutClosure(arg0, arg1, 577, __wbg_adapter_30);
|
|
819
818
|
return ret;
|
|
820
819
|
};
|
|
821
820
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -4,21 +4,21 @@ export const memory: WebAssembly.Memory;
|
|
|
4
4
|
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
5
5
|
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
6
6
|
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
7
|
+
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
8
|
+
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
9
|
+
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
10
|
+
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
11
|
+
export const buildInfo: () => any;
|
|
7
12
|
export const compressWitness: (a: any) => [number, number, number, number];
|
|
8
13
|
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
9
14
|
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
10
15
|
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
11
|
-
export const initLogLevel: (a: number, b: 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": "0.0.
|
|
3
|
+
"version": "0.0.1-commit.21caa21",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -26,27 +26,27 @@
|
|
|
26
26
|
"package.json"
|
|
27
27
|
],
|
|
28
28
|
"sideEffects": false,
|
|
29
|
-
"packageManager": "yarn@
|
|
29
|
+
"packageManager": "yarn@4.5.2",
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "bash ./build.sh",
|
|
32
32
|
"test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha",
|
|
33
33
|
"test:browser": "web-test-runner",
|
|
34
|
-
"lint": "NODE_NO_WARNINGS=1 eslint . --
|
|
34
|
+
"lint": "NODE_NO_WARNINGS=1 eslint . --max-warnings 0",
|
|
35
35
|
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish",
|
|
36
36
|
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)$1\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
|
|
37
37
|
"clean": "chmod u+w web nodejs || true && rm -rf web nodejs"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@esm-bundle/chai": "^4.3.4-fix.0",
|
|
41
|
-
"@web/dev-server-esbuild": "^0.
|
|
42
|
-
"@web/test-runner": "^0.
|
|
43
|
-
"@web/test-runner-playwright": "^0.11.
|
|
41
|
+
"@web/dev-server-esbuild": "^1.0.4",
|
|
42
|
+
"@web/test-runner": "^0.20.2",
|
|
43
|
+
"@web/test-runner-playwright": "^0.11.1",
|
|
44
44
|
"chai": "^4.4.1",
|
|
45
|
-
"eslint": "^
|
|
46
|
-
"eslint-plugin-prettier": "^5.1
|
|
47
|
-
"mocha": "^
|
|
48
|
-
"prettier": "3.
|
|
49
|
-
"ts-node": "^10.9.
|
|
50
|
-
"typescript": "^5.
|
|
45
|
+
"eslint": "^9.28.0",
|
|
46
|
+
"eslint-plugin-prettier": "^5.4.1",
|
|
47
|
+
"mocha": "^11.5.0",
|
|
48
|
+
"prettier": "3.5.3",
|
|
49
|
+
"ts-node": "^10.9.2",
|
|
50
|
+
"typescript": "^5.8.3"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/web/acvm_js.d.ts
CHANGED
|
@@ -28,6 +28,41 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
|
|
|
28
28
|
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
29
29
|
*/
|
|
30
30
|
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
|
+
/**
|
|
38
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
39
|
+
*
|
|
40
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
41
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
42
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
43
|
+
*/
|
|
44
|
+
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
45
|
+
/**
|
|
46
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
47
|
+
*
|
|
48
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
49
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
50
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
51
|
+
*/
|
|
52
|
+
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
53
|
+
/**
|
|
54
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
55
|
+
*
|
|
56
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
57
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
58
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
59
|
+
*/
|
|
60
|
+
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
63
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
64
|
+
*/
|
|
65
|
+
export function buildInfo(): BuildInfo;
|
|
31
66
|
/**
|
|
32
67
|
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
33
68
|
*
|
|
@@ -57,12 +92,6 @@ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
|
57
92
|
* @returns {WitnessStack} The decompressed witness stack.
|
|
58
93
|
*/
|
|
59
94
|
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
60
|
-
/**
|
|
61
|
-
* Sets the package's logging level.
|
|
62
|
-
*
|
|
63
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
64
|
-
*/
|
|
65
|
-
export function initLogLevel(filter: string): void;
|
|
66
95
|
/**
|
|
67
96
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
68
97
|
*/
|
|
@@ -87,46 +116,19 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
87
116
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
88
117
|
*/
|
|
89
118
|
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.
|
|
93
|
-
*/
|
|
94
|
-
export function buildInfo(): BuildInfo;
|
|
95
|
-
/**
|
|
96
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
97
|
-
*
|
|
98
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
99
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
100
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
101
|
-
*/
|
|
102
|
-
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
103
|
-
/**
|
|
104
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
105
|
-
*
|
|
106
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
107
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
108
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
109
|
-
*/
|
|
110
|
-
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
111
|
-
/**
|
|
112
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
113
|
-
*
|
|
114
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
115
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
116
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
117
|
-
*/
|
|
118
|
-
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
data: string[];
|
|
123
|
-
};
|
|
120
|
+
// Map from witness index to hex string value of witness.
|
|
121
|
+
export type WitnessMap = Map<number, string>;
|
|
124
122
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
/**
|
|
124
|
+
* An execution result containing two witnesses.
|
|
125
|
+
* 1. The full solved witness of the execution.
|
|
126
|
+
* 2. The return witness which contains the given public return values within the full witness.
|
|
127
|
+
*/
|
|
128
|
+
export type SolvedAndReturnWitness = {
|
|
129
|
+
solvedWitness: WitnessMap;
|
|
130
|
+
returnWitness: WitnessMap;
|
|
131
|
+
}
|
|
130
132
|
|
|
131
133
|
|
|
132
134
|
|
|
@@ -139,20 +141,6 @@ export type WitnessStack = Array<StackItem>;
|
|
|
139
141
|
|
|
140
142
|
|
|
141
143
|
|
|
142
|
-
/**
|
|
143
|
-
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
144
|
-
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
145
|
-
* @property {string} version - The version of the package at the built git commit.
|
|
146
|
-
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
147
|
-
*/
|
|
148
|
-
export type BuildInfo = {
|
|
149
|
-
gitHash: string;
|
|
150
|
-
version: string;
|
|
151
|
-
dirty: string;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
144
|
export type ForeignCallInput = string[]
|
|
157
145
|
export type ForeignCallOutput = string | string[]
|
|
158
146
|
|
|
@@ -167,17 +155,30 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
|
|
|
167
155
|
|
|
168
156
|
|
|
169
157
|
|
|
170
|
-
|
|
171
|
-
|
|
158
|
+
export type RawAssertionPayload = {
|
|
159
|
+
selector: string;
|
|
160
|
+
data: string[];
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export type ExecutionError = Error & {
|
|
164
|
+
callStack?: string[];
|
|
165
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
166
|
+
acirFunctionId?: number;
|
|
167
|
+
brilligFunctionId?: number;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
|
|
172
171
|
|
|
173
172
|
/**
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
174
|
+
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
175
|
+
* @property {string} version - The version of the package at the built git commit.
|
|
176
|
+
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
177
177
|
*/
|
|
178
|
-
export type
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
export type BuildInfo = {
|
|
179
|
+
gitHash: string;
|
|
180
|
+
version: string;
|
|
181
|
+
dirty: string;
|
|
181
182
|
}
|
|
182
183
|
|
|
183
184
|
|
|
@@ -189,21 +190,21 @@ export interface InitOutput {
|
|
|
189
190
|
readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
190
191
|
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
191
192
|
readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
193
|
+
readonly initLogLevel: (a: number, b: number) => [number, number];
|
|
194
|
+
readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
195
|
+
readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
196
|
+
readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
197
|
+
readonly buildInfo: () => any;
|
|
192
198
|
readonly compressWitness: (a: any) => [number, number, number, number];
|
|
193
199
|
readonly decompressWitness: (a: number, b: number) => [number, number, number];
|
|
194
200
|
readonly compressWitnessStack: (a: any) => [number, number, number, number];
|
|
195
201
|
readonly decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
196
|
-
readonly initLogLevel: (a: number, b: number) => [number, number];
|
|
197
202
|
readonly and: (a: any, b: any) => any;
|
|
198
203
|
readonly xor: (a: any, b: any) => any;
|
|
199
204
|
readonly sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
200
205
|
readonly blake2s256: (a: number, b: number) => [number, number];
|
|
201
206
|
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
202
207
|
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
203
|
-
readonly buildInfo: () => any;
|
|
204
|
-
readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
205
|
-
readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
206
|
-
readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
207
208
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
208
209
|
readonly __externref_table_alloc: () => number;
|
|
209
210
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -212,9 +213,9 @@ export interface InitOutput {
|
|
|
212
213
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
213
214
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
214
215
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
215
|
-
readonly
|
|
216
|
-
readonly
|
|
217
|
-
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;
|
|
218
219
|
readonly __wbindgen_start: () => void;
|
|
219
220
|
}
|
|
220
221
|
|
package/web/acvm_js.js
CHANGED
|
@@ -255,6 +255,88 @@ function takeFromExternrefTable0(idx) {
|
|
|
255
255
|
wasm.__externref_table_dealloc(idx);
|
|
256
256
|
return value;
|
|
257
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
|
+
/**
|
|
273
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
274
|
+
*
|
|
275
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
276
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
277
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
278
|
+
* @param {Uint8Array} program
|
|
279
|
+
* @param {WitnessMap} witness_map
|
|
280
|
+
* @returns {WitnessMap}
|
|
281
|
+
*/
|
|
282
|
+
export function getReturnWitness(program, witness_map) {
|
|
283
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
284
|
+
const len0 = WASM_VECTOR_LEN;
|
|
285
|
+
const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
|
|
286
|
+
if (ret[2]) {
|
|
287
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
288
|
+
}
|
|
289
|
+
return takeFromExternrefTable0(ret[0]);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
294
|
+
*
|
|
295
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
296
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
297
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
298
|
+
* @param {Uint8Array} program
|
|
299
|
+
* @param {WitnessMap} solved_witness
|
|
300
|
+
* @returns {WitnessMap}
|
|
301
|
+
*/
|
|
302
|
+
export function getPublicParametersWitness(program, solved_witness) {
|
|
303
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
304
|
+
const len0 = WASM_VECTOR_LEN;
|
|
305
|
+
const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
|
|
306
|
+
if (ret[2]) {
|
|
307
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
308
|
+
}
|
|
309
|
+
return takeFromExternrefTable0(ret[0]);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
314
|
+
*
|
|
315
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
316
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
317
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
318
|
+
* @param {Uint8Array} program
|
|
319
|
+
* @param {WitnessMap} solved_witness
|
|
320
|
+
* @returns {WitnessMap}
|
|
321
|
+
*/
|
|
322
|
+
export function getPublicWitness(program, solved_witness) {
|
|
323
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
324
|
+
const len0 = WASM_VECTOR_LEN;
|
|
325
|
+
const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
|
|
326
|
+
if (ret[2]) {
|
|
327
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
328
|
+
}
|
|
329
|
+
return takeFromExternrefTable0(ret[0]);
|
|
330
|
+
}
|
|
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
|
+
}
|
|
258
340
|
|
|
259
341
|
function getArrayU8FromWasm0(ptr, len) {
|
|
260
342
|
ptr = ptr >>> 0;
|
|
@@ -325,20 +407,6 @@ export function decompressWitnessStack(compressed_witness) {
|
|
|
325
407
|
return takeFromExternrefTable0(ret[0]);
|
|
326
408
|
}
|
|
327
409
|
|
|
328
|
-
/**
|
|
329
|
-
* Sets the package's logging level.
|
|
330
|
-
*
|
|
331
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
332
|
-
*/
|
|
333
|
-
export function initLogLevel(filter) {
|
|
334
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
335
|
-
const len0 = WASM_VECTOR_LEN;
|
|
336
|
-
const ret = wasm.initLogLevel(ptr0, len0);
|
|
337
|
-
if (ret[1]) {
|
|
338
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
|
|
342
410
|
/**
|
|
343
411
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
344
412
|
* @param {string} lhs
|
|
@@ -454,85 +522,16 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
|
|
|
454
522
|
return ret !== 0;
|
|
455
523
|
}
|
|
456
524
|
|
|
457
|
-
/**
|
|
458
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
459
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
460
|
-
*/
|
|
461
|
-
export function buildInfo() {
|
|
462
|
-
const ret = wasm.buildInfo();
|
|
463
|
-
return ret;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
/**
|
|
467
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
468
|
-
*
|
|
469
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
470
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
471
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
472
|
-
* @param {Uint8Array} program
|
|
473
|
-
* @param {WitnessMap} witness_map
|
|
474
|
-
* @returns {WitnessMap}
|
|
475
|
-
*/
|
|
476
|
-
export function getReturnWitness(program, witness_map) {
|
|
477
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
478
|
-
const len0 = WASM_VECTOR_LEN;
|
|
479
|
-
const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
|
|
480
|
-
if (ret[2]) {
|
|
481
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
482
|
-
}
|
|
483
|
-
return takeFromExternrefTable0(ret[0]);
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
/**
|
|
487
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
488
|
-
*
|
|
489
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
490
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
491
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
492
|
-
* @param {Uint8Array} program
|
|
493
|
-
* @param {WitnessMap} solved_witness
|
|
494
|
-
* @returns {WitnessMap}
|
|
495
|
-
*/
|
|
496
|
-
export function getPublicParametersWitness(program, solved_witness) {
|
|
497
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
498
|
-
const len0 = WASM_VECTOR_LEN;
|
|
499
|
-
const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
|
|
500
|
-
if (ret[2]) {
|
|
501
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
502
|
-
}
|
|
503
|
-
return takeFromExternrefTable0(ret[0]);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
508
|
-
*
|
|
509
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
510
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
511
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
512
|
-
* @param {Uint8Array} program
|
|
513
|
-
* @param {WitnessMap} solved_witness
|
|
514
|
-
* @returns {WitnessMap}
|
|
515
|
-
*/
|
|
516
|
-
export function getPublicWitness(program, solved_witness) {
|
|
517
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
518
|
-
const len0 = WASM_VECTOR_LEN;
|
|
519
|
-
const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
|
|
520
|
-
if (ret[2]) {
|
|
521
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
522
|
-
}
|
|
523
|
-
return takeFromExternrefTable0(ret[0]);
|
|
524
|
-
}
|
|
525
|
-
|
|
526
525
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
527
|
-
wasm.
|
|
526
|
+
wasm.closure576_externref_shim(arg0, arg1, arg2);
|
|
528
527
|
}
|
|
529
528
|
|
|
530
529
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
531
|
-
wasm.
|
|
530
|
+
wasm.closure1171_externref_shim(arg0, arg1, arg2, arg3, arg4);
|
|
532
531
|
}
|
|
533
532
|
|
|
534
533
|
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
535
|
-
wasm.
|
|
534
|
+
wasm.closure1175_externref_shim(arg0, arg1, arg2, arg3);
|
|
536
535
|
}
|
|
537
536
|
|
|
538
537
|
async function __wbg_load(module, imports) {
|
|
@@ -581,11 +580,11 @@ function __wbg_get_imports() {
|
|
|
581
580
|
const ret = arg0.call(arg1, arg2, arg3);
|
|
582
581
|
return ret;
|
|
583
582
|
}, arguments) };
|
|
584
|
-
imports.wbg.
|
|
583
|
+
imports.wbg.__wbg_constructor_c63bcfd244db473f = function(arg0) {
|
|
585
584
|
const ret = new Error(arg0);
|
|
586
585
|
return ret;
|
|
587
586
|
};
|
|
588
|
-
imports.wbg.
|
|
587
|
+
imports.wbg.__wbg_constructor_e54436b6bd1581f7 = function(arg0) {
|
|
589
588
|
const ret = new Error(arg0);
|
|
590
589
|
return ret;
|
|
591
590
|
};
|
|
@@ -686,8 +685,8 @@ function __wbg_get_imports() {
|
|
|
686
685
|
state0.a = state0.b = 0;
|
|
687
686
|
}
|
|
688
687
|
};
|
|
689
|
-
imports.wbg.
|
|
690
|
-
const ret = new
|
|
688
|
+
imports.wbg.__wbg_new_36c79b224aeafbf0 = function() {
|
|
689
|
+
const ret = new Array();
|
|
691
690
|
return ret;
|
|
692
691
|
};
|
|
693
692
|
imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
|
|
@@ -702,8 +701,8 @@ function __wbg_get_imports() {
|
|
|
702
701
|
const ret = new Error();
|
|
703
702
|
return ret;
|
|
704
703
|
};
|
|
705
|
-
imports.wbg.
|
|
706
|
-
const ret = new
|
|
704
|
+
imports.wbg.__wbg_new_c08cf36011667e78 = function() {
|
|
705
|
+
const ret = new Map();
|
|
707
706
|
return ret;
|
|
708
707
|
};
|
|
709
708
|
imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
|
|
@@ -798,8 +797,8 @@ function __wbg_get_imports() {
|
|
|
798
797
|
const ret = false;
|
|
799
798
|
return ret;
|
|
800
799
|
};
|
|
801
|
-
imports.wbg.
|
|
802
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
800
|
+
imports.wbg.__wbindgen_closure_wrapper1970 = function(arg0, arg1, arg2) {
|
|
801
|
+
const ret = makeMutClosure(arg0, arg1, 577, __wbg_adapter_30);
|
|
803
802
|
return ret;
|
|
804
803
|
};
|
|
805
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
|
@@ -4,21 +4,21 @@ export const memory: WebAssembly.Memory;
|
|
|
4
4
|
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
5
5
|
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
6
6
|
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
7
|
+
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
8
|
+
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
9
|
+
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
10
|
+
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
11
|
+
export const buildInfo: () => any;
|
|
7
12
|
export const compressWitness: (a: any) => [number, number, number, number];
|
|
8
13
|
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
9
14
|
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
10
15
|
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
11
|
-
export const initLogLevel: (a: number, b: 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;
|