@aztec/noir-acvm_js 0.0.1-commit.fce3e4f → 0.0.1-commit.ff7989d6c
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 +75 -75
- package/nodejs/acvm_js.js +107 -106
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +9 -9
- package/package.json +7 -7
- package/web/acvm_js.d.ts +84 -84
- package/web/acvm_js.js +107 -106
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +9 -9
package/nodejs/acvm_js.d.ts
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
5
|
+
*
|
|
6
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
7
|
+
* @returns {Uint8Array} A compressed witness map
|
|
8
|
+
*/
|
|
9
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
10
|
+
/**
|
|
11
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
12
|
+
* This should be used to only fetch the witness map for the main function.
|
|
13
|
+
*
|
|
14
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
15
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
16
|
+
*/
|
|
17
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
18
|
+
/**
|
|
19
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
20
|
+
*
|
|
21
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
22
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
23
|
+
*/
|
|
24
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
25
|
+
/**
|
|
26
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
27
|
+
*
|
|
28
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
29
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
30
|
+
*/
|
|
31
|
+
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
3
32
|
/**
|
|
4
33
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
34
|
*
|
|
@@ -28,12 +57,6 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
|
|
|
28
57
|
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
29
58
|
*/
|
|
30
59
|
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
60
|
/**
|
|
38
61
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
39
62
|
*
|
|
@@ -58,40 +81,6 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
|
|
|
58
81
|
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
59
82
|
*/
|
|
60
83
|
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;
|
|
66
|
-
/**
|
|
67
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
68
|
-
*
|
|
69
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
70
|
-
* @returns {Uint8Array} A compressed witness map
|
|
71
|
-
*/
|
|
72
|
-
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
73
|
-
/**
|
|
74
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
75
|
-
* This should be used to only fetch the witness map for the main function.
|
|
76
|
-
*
|
|
77
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
78
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
79
|
-
*/
|
|
80
|
-
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
81
|
-
/**
|
|
82
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
83
|
-
*
|
|
84
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
85
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
86
|
-
*/
|
|
87
|
-
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
88
|
-
/**
|
|
89
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
90
|
-
*
|
|
91
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
92
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
93
|
-
*/
|
|
94
|
-
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
95
84
|
/**
|
|
96
85
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
97
86
|
*/
|
|
@@ -116,44 +105,17 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
116
105
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
117
106
|
*/
|
|
118
107
|
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
119
|
-
|
|
120
|
-
// Map from witness index to hex string value of witness.
|
|
121
|
-
export type WitnessMap = Map<number, string>;
|
|
122
|
-
|
|
123
108
|
/**
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* 2. The return witness which contains the given public return values within the full witness.
|
|
109
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
110
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
127
111
|
*/
|
|
128
|
-
export
|
|
129
|
-
solvedWitness: WitnessMap;
|
|
130
|
-
returnWitness: WitnessMap;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
export type StackItem = {
|
|
136
|
-
index: number;
|
|
137
|
-
witness: WitnessMap;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export type WitnessStack = Array<StackItem>;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
export type ForeignCallInput = string[]
|
|
145
|
-
export type ForeignCallOutput = string | string[]
|
|
146
|
-
|
|
112
|
+
export function buildInfo(): BuildInfo;
|
|
147
113
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* @param {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
*/
|
|
154
|
-
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
155
|
-
|
|
156
|
-
|
|
114
|
+
* Sets the package's logging level.
|
|
115
|
+
*
|
|
116
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
117
|
+
*/
|
|
118
|
+
export function initLogLevel(filter: string): void;
|
|
157
119
|
|
|
158
120
|
export type RawAssertionPayload = {
|
|
159
121
|
selector: string;
|
|
@@ -169,6 +131,15 @@ export type ExecutionError = Error & {
|
|
|
169
131
|
|
|
170
132
|
|
|
171
133
|
|
|
134
|
+
export type StackItem = {
|
|
135
|
+
index: number;
|
|
136
|
+
witness: WitnessMap;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export type WitnessStack = Array<StackItem>;
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
172
143
|
/**
|
|
173
144
|
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
174
145
|
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
@@ -182,3 +153,32 @@ export type BuildInfo = {
|
|
|
182
153
|
}
|
|
183
154
|
|
|
184
155
|
|
|
156
|
+
|
|
157
|
+
// Map from witness index to hex string value of witness.
|
|
158
|
+
export type WitnessMap = Map<number, string>;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* An execution result containing two witnesses.
|
|
162
|
+
* 1. The full solved witness of the execution.
|
|
163
|
+
* 2. The return witness which contains the given public return values within the full witness.
|
|
164
|
+
*/
|
|
165
|
+
export type SolvedAndReturnWitness = {
|
|
166
|
+
solvedWitness: WitnessMap;
|
|
167
|
+
returnWitness: WitnessMap;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
export type ForeignCallInput = string[]
|
|
173
|
+
export type ForeignCallOutput = string | string[]
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* A callback which performs an foreign call and returns the response.
|
|
177
|
+
* @callback ForeignCallHandler
|
|
178
|
+
* @param {string} name - The identifier for the type of foreign call being performed.
|
|
179
|
+
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
|
|
180
|
+
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
|
|
181
|
+
*/
|
|
182
|
+
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
183
|
+
|
|
184
|
+
|
package/nodejs/acvm_js.js
CHANGED
|
@@ -202,12 +202,87 @@ function debugString(val) {
|
|
|
202
202
|
return className;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
function takeFromExternrefTable0(idx) {
|
|
206
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
207
|
+
wasm.__externref_table_dealloc(idx);
|
|
208
|
+
return value;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
212
|
+
ptr = ptr >>> 0;
|
|
213
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
217
|
+
*
|
|
218
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
219
|
+
* @returns {Uint8Array} A compressed witness map
|
|
220
|
+
*/
|
|
221
|
+
module.exports.compressWitness = function(witness_map) {
|
|
222
|
+
const ret = wasm.compressWitness(witness_map);
|
|
223
|
+
if (ret[3]) {
|
|
224
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
225
|
+
}
|
|
226
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
227
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
228
|
+
return v1;
|
|
229
|
+
};
|
|
230
|
+
|
|
205
231
|
function passArray8ToWasm0(arg, malloc) {
|
|
206
232
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
207
233
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
208
234
|
WASM_VECTOR_LEN = arg.length;
|
|
209
235
|
return ptr;
|
|
210
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
239
|
+
* This should be used to only fetch the witness map for the main function.
|
|
240
|
+
*
|
|
241
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
242
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
243
|
+
*/
|
|
244
|
+
module.exports.decompressWitness = function(compressed_witness) {
|
|
245
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
246
|
+
const len0 = WASM_VECTOR_LEN;
|
|
247
|
+
const ret = wasm.decompressWitness(ptr0, len0);
|
|
248
|
+
if (ret[2]) {
|
|
249
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
250
|
+
}
|
|
251
|
+
return takeFromExternrefTable0(ret[0]);
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
256
|
+
*
|
|
257
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
258
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
259
|
+
*/
|
|
260
|
+
module.exports.compressWitnessStack = function(witness_stack) {
|
|
261
|
+
const ret = wasm.compressWitnessStack(witness_stack);
|
|
262
|
+
if (ret[3]) {
|
|
263
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
264
|
+
}
|
|
265
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
266
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
267
|
+
return v1;
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
272
|
+
*
|
|
273
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
274
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
275
|
+
*/
|
|
276
|
+
module.exports.decompressWitnessStack = function(compressed_witness) {
|
|
277
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
278
|
+
const len0 = WASM_VECTOR_LEN;
|
|
279
|
+
const ret = wasm.decompressWitnessStack(ptr0, len0);
|
|
280
|
+
if (ret[2]) {
|
|
281
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
282
|
+
}
|
|
283
|
+
return takeFromExternrefTable0(ret[0]);
|
|
284
|
+
};
|
|
285
|
+
|
|
211
286
|
/**
|
|
212
287
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
213
288
|
*
|
|
@@ -254,25 +329,6 @@ module.exports.executeProgram = function(program, initial_witness, foreign_call_
|
|
|
254
329
|
return ret;
|
|
255
330
|
};
|
|
256
331
|
|
|
257
|
-
function takeFromExternrefTable0(idx) {
|
|
258
|
-
const value = wasm.__wbindgen_export_2.get(idx);
|
|
259
|
-
wasm.__externref_table_dealloc(idx);
|
|
260
|
-
return value;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Sets the package's logging level.
|
|
264
|
-
*
|
|
265
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
266
|
-
*/
|
|
267
|
-
module.exports.initLogLevel = function(filter) {
|
|
268
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
269
|
-
const len0 = WASM_VECTOR_LEN;
|
|
270
|
-
const ret = wasm.initLogLevel(ptr0, len0);
|
|
271
|
-
if (ret[1]) {
|
|
272
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
|
|
276
332
|
/**
|
|
277
333
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
278
334
|
*
|
|
@@ -333,84 +389,6 @@ module.exports.getPublicWitness = function(program, solved_witness) {
|
|
|
333
389
|
return takeFromExternrefTable0(ret[0]);
|
|
334
390
|
};
|
|
335
391
|
|
|
336
|
-
/**
|
|
337
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
338
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
339
|
-
*/
|
|
340
|
-
module.exports.buildInfo = function() {
|
|
341
|
-
const ret = wasm.buildInfo();
|
|
342
|
-
return ret;
|
|
343
|
-
};
|
|
344
|
-
|
|
345
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
346
|
-
ptr = ptr >>> 0;
|
|
347
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
351
|
-
*
|
|
352
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
353
|
-
* @returns {Uint8Array} A compressed witness map
|
|
354
|
-
*/
|
|
355
|
-
module.exports.compressWitness = function(witness_map) {
|
|
356
|
-
const ret = wasm.compressWitness(witness_map);
|
|
357
|
-
if (ret[3]) {
|
|
358
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
359
|
-
}
|
|
360
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
361
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
362
|
-
return v1;
|
|
363
|
-
};
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
367
|
-
* This should be used to only fetch the witness map for the main function.
|
|
368
|
-
*
|
|
369
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
370
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
371
|
-
*/
|
|
372
|
-
module.exports.decompressWitness = function(compressed_witness) {
|
|
373
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
374
|
-
const len0 = WASM_VECTOR_LEN;
|
|
375
|
-
const ret = wasm.decompressWitness(ptr0, len0);
|
|
376
|
-
if (ret[2]) {
|
|
377
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
378
|
-
}
|
|
379
|
-
return takeFromExternrefTable0(ret[0]);
|
|
380
|
-
};
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
384
|
-
*
|
|
385
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
386
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
387
|
-
*/
|
|
388
|
-
module.exports.compressWitnessStack = function(witness_stack) {
|
|
389
|
-
const ret = wasm.compressWitnessStack(witness_stack);
|
|
390
|
-
if (ret[3]) {
|
|
391
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
392
|
-
}
|
|
393
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
394
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
395
|
-
return v1;
|
|
396
|
-
};
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
400
|
-
*
|
|
401
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
402
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
403
|
-
*/
|
|
404
|
-
module.exports.decompressWitnessStack = function(compressed_witness) {
|
|
405
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
406
|
-
const len0 = WASM_VECTOR_LEN;
|
|
407
|
-
const ret = wasm.decompressWitnessStack(ptr0, len0);
|
|
408
|
-
if (ret[2]) {
|
|
409
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
410
|
-
}
|
|
411
|
-
return takeFromExternrefTable0(ret[0]);
|
|
412
|
-
};
|
|
413
|
-
|
|
414
392
|
/**
|
|
415
393
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
416
394
|
* @param {string} lhs
|
|
@@ -526,16 +504,39 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
|
|
|
526
504
|
return ret !== 0;
|
|
527
505
|
};
|
|
528
506
|
|
|
507
|
+
/**
|
|
508
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
509
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
510
|
+
*/
|
|
511
|
+
module.exports.buildInfo = function() {
|
|
512
|
+
const ret = wasm.buildInfo();
|
|
513
|
+
return ret;
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Sets the package's logging level.
|
|
518
|
+
*
|
|
519
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
520
|
+
*/
|
|
521
|
+
module.exports.initLogLevel = function(filter) {
|
|
522
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
523
|
+
const len0 = WASM_VECTOR_LEN;
|
|
524
|
+
const ret = wasm.initLogLevel(ptr0, len0);
|
|
525
|
+
if (ret[1]) {
|
|
526
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
527
|
+
}
|
|
528
|
+
};
|
|
529
|
+
|
|
529
530
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
530
|
-
wasm.
|
|
531
|
+
wasm.closure445_externref_shim(arg0, arg1, arg2);
|
|
531
532
|
}
|
|
532
533
|
|
|
533
534
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
534
|
-
wasm.
|
|
535
|
+
wasm.closure924_externref_shim(arg0, arg1, arg2, arg3, arg4);
|
|
535
536
|
}
|
|
536
537
|
|
|
537
538
|
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
538
|
-
wasm.
|
|
539
|
+
wasm.closure928_externref_shim(arg0, arg1, arg2, arg3);
|
|
539
540
|
}
|
|
540
541
|
|
|
541
542
|
module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
@@ -553,12 +554,12 @@ module.exports.__wbg_call_833bed5770ea2041 = function() { return handleError(fun
|
|
|
553
554
|
return ret;
|
|
554
555
|
}, arguments) };
|
|
555
556
|
|
|
556
|
-
module.exports.
|
|
557
|
+
module.exports.__wbg_constructor_2b49e4454d172081 = function(arg0) {
|
|
557
558
|
const ret = new Error(arg0);
|
|
558
559
|
return ret;
|
|
559
560
|
};
|
|
560
561
|
|
|
561
|
-
module.exports.
|
|
562
|
+
module.exports.__wbg_constructor_dddf0209b25406fd = function(arg0) {
|
|
562
563
|
const ret = new Error(arg0);
|
|
563
564
|
return ret;
|
|
564
565
|
};
|
|
@@ -674,7 +675,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
|
|
674
675
|
}
|
|
675
676
|
};
|
|
676
677
|
|
|
677
|
-
module.exports.
|
|
678
|
+
module.exports.__wbg_new_2812f5f6a6bd8bcf = function() {
|
|
678
679
|
const ret = new Array();
|
|
679
680
|
return ret;
|
|
680
681
|
};
|
|
@@ -694,7 +695,7 @@ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
|
|
|
694
695
|
return ret;
|
|
695
696
|
};
|
|
696
697
|
|
|
697
|
-
module.exports.
|
|
698
|
+
module.exports.__wbg_new_b110592360513189 = function() {
|
|
698
699
|
const ret = new Map();
|
|
699
700
|
return ret;
|
|
700
701
|
};
|
|
@@ -813,8 +814,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
|
813
814
|
return ret;
|
|
814
815
|
};
|
|
815
816
|
|
|
816
|
-
module.exports.
|
|
817
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
817
|
+
module.exports.__wbindgen_closure_wrapper1366 = function(arg0, arg1, arg2) {
|
|
818
|
+
const ret = makeMutClosure(arg0, arg1, 446, __wbg_adapter_30);
|
|
818
819
|
return ret;
|
|
819
820
|
};
|
|
820
821
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const compressWitness: (a: any) => [number, number, number, number];
|
|
5
|
+
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
6
|
+
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
7
|
+
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
4
8
|
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
5
9
|
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
6
10
|
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
7
|
-
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
8
11
|
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
9
12
|
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
10
13
|
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
11
|
-
export const buildInfo: () => any;
|
|
12
|
-
export const compressWitness: (a: any) => [number, number, number, number];
|
|
13
|
-
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
14
|
-
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
15
|
-
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
16
14
|
export const and: (a: any, b: any) => any;
|
|
17
15
|
export const xor: (a: any, b: any) => any;
|
|
18
16
|
export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
19
17
|
export const blake2s256: (a: number, b: number) => [number, number];
|
|
20
18
|
export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
21
19
|
export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
20
|
+
export const buildInfo: () => any;
|
|
21
|
+
export const initLogLevel: (a: number, b: 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 closure445_externref_shim: (a: number, b: number, c: any) => void;
|
|
31
|
+
export const closure924_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
32
|
+
export const closure928_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
33
33
|
export const __wbindgen_start: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/noir-acvm_js",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.ff7989d6c",
|
|
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": "^1.0.
|
|
41
|
+
"@web/dev-server-esbuild": "^1.0.5",
|
|
42
42
|
"@web/test-runner": "^0.20.2",
|
|
43
43
|
"@web/test-runner-playwright": "^0.11.1",
|
|
44
|
-
"chai": "^
|
|
45
|
-
"eslint": "^
|
|
46
|
-
"eslint-plugin-prettier": "^5.
|
|
47
|
-
"mocha": "^11.5
|
|
48
|
-
"prettier": "3.
|
|
44
|
+
"chai": "^6.2.2",
|
|
45
|
+
"eslint": "^10.0.0",
|
|
46
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
47
|
+
"mocha": "^11.7.5",
|
|
48
|
+
"prettier": "3.8.1",
|
|
49
49
|
"ts-node": "^10.9.2",
|
|
50
50
|
"typescript": "^5.8.3"
|
|
51
51
|
}
|
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
5
|
+
*
|
|
6
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
7
|
+
* @returns {Uint8Array} A compressed witness map
|
|
8
|
+
*/
|
|
9
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
10
|
+
/**
|
|
11
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
12
|
+
* This should be used to only fetch the witness map for the main function.
|
|
13
|
+
*
|
|
14
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
15
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
16
|
+
*/
|
|
17
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
18
|
+
/**
|
|
19
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
20
|
+
*
|
|
21
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
22
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
23
|
+
*/
|
|
24
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
25
|
+
/**
|
|
26
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
27
|
+
*
|
|
28
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
29
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
30
|
+
*/
|
|
31
|
+
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
3
32
|
/**
|
|
4
33
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
34
|
*
|
|
@@ -28,12 +57,6 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
|
|
|
28
57
|
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
29
58
|
*/
|
|
30
59
|
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
60
|
/**
|
|
38
61
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
39
62
|
*
|
|
@@ -58,40 +81,6 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
|
|
|
58
81
|
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
59
82
|
*/
|
|
60
83
|
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;
|
|
66
|
-
/**
|
|
67
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
68
|
-
*
|
|
69
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
70
|
-
* @returns {Uint8Array} A compressed witness map
|
|
71
|
-
*/
|
|
72
|
-
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
73
|
-
/**
|
|
74
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
75
|
-
* This should be used to only fetch the witness map for the main function.
|
|
76
|
-
*
|
|
77
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
78
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
79
|
-
*/
|
|
80
|
-
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
81
|
-
/**
|
|
82
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
83
|
-
*
|
|
84
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
85
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
86
|
-
*/
|
|
87
|
-
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
88
|
-
/**
|
|
89
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
90
|
-
*
|
|
91
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
92
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
93
|
-
*/
|
|
94
|
-
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
95
84
|
/**
|
|
96
85
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
97
86
|
*/
|
|
@@ -116,44 +105,17 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
116
105
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
117
106
|
*/
|
|
118
107
|
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
119
|
-
|
|
120
|
-
// Map from witness index to hex string value of witness.
|
|
121
|
-
export type WitnessMap = Map<number, string>;
|
|
122
|
-
|
|
123
108
|
/**
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* 2. The return witness which contains the given public return values within the full witness.
|
|
109
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
110
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
127
111
|
*/
|
|
128
|
-
export
|
|
129
|
-
solvedWitness: WitnessMap;
|
|
130
|
-
returnWitness: WitnessMap;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
export type StackItem = {
|
|
136
|
-
index: number;
|
|
137
|
-
witness: WitnessMap;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export type WitnessStack = Array<StackItem>;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
export type ForeignCallInput = string[]
|
|
145
|
-
export type ForeignCallOutput = string | string[]
|
|
146
|
-
|
|
112
|
+
export function buildInfo(): BuildInfo;
|
|
147
113
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* @param {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
*/
|
|
154
|
-
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
155
|
-
|
|
156
|
-
|
|
114
|
+
* Sets the package's logging level.
|
|
115
|
+
*
|
|
116
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
117
|
+
*/
|
|
118
|
+
export function initLogLevel(filter: string): void;
|
|
157
119
|
|
|
158
120
|
export type RawAssertionPayload = {
|
|
159
121
|
selector: string;
|
|
@@ -169,6 +131,15 @@ export type ExecutionError = Error & {
|
|
|
169
131
|
|
|
170
132
|
|
|
171
133
|
|
|
134
|
+
export type StackItem = {
|
|
135
|
+
index: number;
|
|
136
|
+
witness: WitnessMap;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export type WitnessStack = Array<StackItem>;
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
172
143
|
/**
|
|
173
144
|
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
174
145
|
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
@@ -183,28 +154,57 @@ export type BuildInfo = {
|
|
|
183
154
|
|
|
184
155
|
|
|
185
156
|
|
|
157
|
+
// Map from witness index to hex string value of witness.
|
|
158
|
+
export type WitnessMap = Map<number, string>;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* An execution result containing two witnesses.
|
|
162
|
+
* 1. The full solved witness of the execution.
|
|
163
|
+
* 2. The return witness which contains the given public return values within the full witness.
|
|
164
|
+
*/
|
|
165
|
+
export type SolvedAndReturnWitness = {
|
|
166
|
+
solvedWitness: WitnessMap;
|
|
167
|
+
returnWitness: WitnessMap;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
export type ForeignCallInput = string[]
|
|
173
|
+
export type ForeignCallOutput = string | string[]
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* A callback which performs an foreign call and returns the response.
|
|
177
|
+
* @callback ForeignCallHandler
|
|
178
|
+
* @param {string} name - The identifier for the type of foreign call being performed.
|
|
179
|
+
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
|
|
180
|
+
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
|
|
181
|
+
*/
|
|
182
|
+
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
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 compressWitness: (a: any) => [number, number, number, number];
|
|
191
|
+
readonly decompressWitness: (a: number, b: number) => [number, number, number];
|
|
192
|
+
readonly compressWitnessStack: (a: any) => [number, number, number, number];
|
|
193
|
+
readonly decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
190
194
|
readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
191
195
|
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
192
196
|
readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
193
|
-
readonly initLogLevel: (a: number, b: number) => [number, number];
|
|
194
197
|
readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
195
198
|
readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
196
199
|
readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
197
|
-
readonly buildInfo: () => any;
|
|
198
|
-
readonly compressWitness: (a: any) => [number, number, number, number];
|
|
199
|
-
readonly decompressWitness: (a: number, b: number) => [number, number, number];
|
|
200
|
-
readonly compressWitnessStack: (a: any) => [number, number, number, number];
|
|
201
|
-
readonly decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
202
200
|
readonly and: (a: any, b: any) => any;
|
|
203
201
|
readonly xor: (a: any, b: any) => any;
|
|
204
202
|
readonly sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
205
203
|
readonly blake2s256: (a: number, b: number) => [number, number];
|
|
206
204
|
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
207
205
|
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
206
|
+
readonly buildInfo: () => any;
|
|
207
|
+
readonly initLogLevel: (a: number, b: 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 closure445_externref_shim: (a: number, b: number, c: any) => void;
|
|
217
|
+
readonly closure924_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
218
|
+
readonly closure928_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
219
219
|
readonly __wbindgen_start: () => void;
|
|
220
220
|
}
|
|
221
221
|
|
package/web/acvm_js.js
CHANGED
|
@@ -198,12 +198,87 @@ function debugString(val) {
|
|
|
198
198
|
return className;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
+
function takeFromExternrefTable0(idx) {
|
|
202
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
203
|
+
wasm.__externref_table_dealloc(idx);
|
|
204
|
+
return value;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
208
|
+
ptr = ptr >>> 0;
|
|
209
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
213
|
+
*
|
|
214
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
215
|
+
* @returns {Uint8Array} A compressed witness map
|
|
216
|
+
*/
|
|
217
|
+
export function compressWitness(witness_map) {
|
|
218
|
+
const ret = wasm.compressWitness(witness_map);
|
|
219
|
+
if (ret[3]) {
|
|
220
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
221
|
+
}
|
|
222
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
223
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
224
|
+
return v1;
|
|
225
|
+
}
|
|
226
|
+
|
|
201
227
|
function passArray8ToWasm0(arg, malloc) {
|
|
202
228
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
203
229
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
204
230
|
WASM_VECTOR_LEN = arg.length;
|
|
205
231
|
return ptr;
|
|
206
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
235
|
+
* This should be used to only fetch the witness map for the main function.
|
|
236
|
+
*
|
|
237
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
238
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
239
|
+
*/
|
|
240
|
+
export function decompressWitness(compressed_witness) {
|
|
241
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
242
|
+
const len0 = WASM_VECTOR_LEN;
|
|
243
|
+
const ret = wasm.decompressWitness(ptr0, len0);
|
|
244
|
+
if (ret[2]) {
|
|
245
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
246
|
+
}
|
|
247
|
+
return takeFromExternrefTable0(ret[0]);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
252
|
+
*
|
|
253
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
254
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
255
|
+
*/
|
|
256
|
+
export function compressWitnessStack(witness_stack) {
|
|
257
|
+
const ret = wasm.compressWitnessStack(witness_stack);
|
|
258
|
+
if (ret[3]) {
|
|
259
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
260
|
+
}
|
|
261
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
262
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
263
|
+
return v1;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
268
|
+
*
|
|
269
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
270
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
271
|
+
*/
|
|
272
|
+
export function decompressWitnessStack(compressed_witness) {
|
|
273
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
274
|
+
const len0 = WASM_VECTOR_LEN;
|
|
275
|
+
const ret = wasm.decompressWitnessStack(ptr0, len0);
|
|
276
|
+
if (ret[2]) {
|
|
277
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
278
|
+
}
|
|
279
|
+
return takeFromExternrefTable0(ret[0]);
|
|
280
|
+
}
|
|
281
|
+
|
|
207
282
|
/**
|
|
208
283
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
209
284
|
*
|
|
@@ -250,25 +325,6 @@ export function executeProgram(program, initial_witness, foreign_call_handler) {
|
|
|
250
325
|
return ret;
|
|
251
326
|
}
|
|
252
327
|
|
|
253
|
-
function takeFromExternrefTable0(idx) {
|
|
254
|
-
const value = wasm.__wbindgen_export_2.get(idx);
|
|
255
|
-
wasm.__externref_table_dealloc(idx);
|
|
256
|
-
return value;
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Sets the package's logging level.
|
|
260
|
-
*
|
|
261
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
262
|
-
*/
|
|
263
|
-
export function initLogLevel(filter) {
|
|
264
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
265
|
-
const len0 = WASM_VECTOR_LEN;
|
|
266
|
-
const ret = wasm.initLogLevel(ptr0, len0);
|
|
267
|
-
if (ret[1]) {
|
|
268
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
328
|
/**
|
|
273
329
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
274
330
|
*
|
|
@@ -329,84 +385,6 @@ export function getPublicWitness(program, solved_witness) {
|
|
|
329
385
|
return takeFromExternrefTable0(ret[0]);
|
|
330
386
|
}
|
|
331
387
|
|
|
332
|
-
/**
|
|
333
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
334
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
335
|
-
*/
|
|
336
|
-
export function buildInfo() {
|
|
337
|
-
const ret = wasm.buildInfo();
|
|
338
|
-
return ret;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
342
|
-
ptr = ptr >>> 0;
|
|
343
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
347
|
-
*
|
|
348
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
349
|
-
* @returns {Uint8Array} A compressed witness map
|
|
350
|
-
*/
|
|
351
|
-
export function compressWitness(witness_map) {
|
|
352
|
-
const ret = wasm.compressWitness(witness_map);
|
|
353
|
-
if (ret[3]) {
|
|
354
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
355
|
-
}
|
|
356
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
357
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
358
|
-
return v1;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
363
|
-
* This should be used to only fetch the witness map for the main function.
|
|
364
|
-
*
|
|
365
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
366
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
367
|
-
*/
|
|
368
|
-
export function decompressWitness(compressed_witness) {
|
|
369
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
370
|
-
const len0 = WASM_VECTOR_LEN;
|
|
371
|
-
const ret = wasm.decompressWitness(ptr0, len0);
|
|
372
|
-
if (ret[2]) {
|
|
373
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
374
|
-
}
|
|
375
|
-
return takeFromExternrefTable0(ret[0]);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
380
|
-
*
|
|
381
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
382
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
383
|
-
*/
|
|
384
|
-
export function compressWitnessStack(witness_stack) {
|
|
385
|
-
const ret = wasm.compressWitnessStack(witness_stack);
|
|
386
|
-
if (ret[3]) {
|
|
387
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
388
|
-
}
|
|
389
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
390
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
391
|
-
return v1;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
396
|
-
*
|
|
397
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
398
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
399
|
-
*/
|
|
400
|
-
export function decompressWitnessStack(compressed_witness) {
|
|
401
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
402
|
-
const len0 = WASM_VECTOR_LEN;
|
|
403
|
-
const ret = wasm.decompressWitnessStack(ptr0, len0);
|
|
404
|
-
if (ret[2]) {
|
|
405
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
406
|
-
}
|
|
407
|
-
return takeFromExternrefTable0(ret[0]);
|
|
408
|
-
}
|
|
409
|
-
|
|
410
388
|
/**
|
|
411
389
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
412
390
|
* @param {string} lhs
|
|
@@ -522,16 +500,39 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
|
|
|
522
500
|
return ret !== 0;
|
|
523
501
|
}
|
|
524
502
|
|
|
503
|
+
/**
|
|
504
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
505
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
506
|
+
*/
|
|
507
|
+
export function buildInfo() {
|
|
508
|
+
const ret = wasm.buildInfo();
|
|
509
|
+
return ret;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* Sets the package's logging level.
|
|
514
|
+
*
|
|
515
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
516
|
+
*/
|
|
517
|
+
export function initLogLevel(filter) {
|
|
518
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
519
|
+
const len0 = WASM_VECTOR_LEN;
|
|
520
|
+
const ret = wasm.initLogLevel(ptr0, len0);
|
|
521
|
+
if (ret[1]) {
|
|
522
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
525
526
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
526
|
-
wasm.
|
|
527
|
+
wasm.closure445_externref_shim(arg0, arg1, arg2);
|
|
527
528
|
}
|
|
528
529
|
|
|
529
530
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
530
|
-
wasm.
|
|
531
|
+
wasm.closure924_externref_shim(arg0, arg1, arg2, arg3, arg4);
|
|
531
532
|
}
|
|
532
533
|
|
|
533
534
|
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
534
|
-
wasm.
|
|
535
|
+
wasm.closure928_externref_shim(arg0, arg1, arg2, arg3);
|
|
535
536
|
}
|
|
536
537
|
|
|
537
538
|
async function __wbg_load(module, imports) {
|
|
@@ -580,11 +581,11 @@ function __wbg_get_imports() {
|
|
|
580
581
|
const ret = arg0.call(arg1, arg2, arg3);
|
|
581
582
|
return ret;
|
|
582
583
|
}, arguments) };
|
|
583
|
-
imports.wbg.
|
|
584
|
+
imports.wbg.__wbg_constructor_2b49e4454d172081 = function(arg0) {
|
|
584
585
|
const ret = new Error(arg0);
|
|
585
586
|
return ret;
|
|
586
587
|
};
|
|
587
|
-
imports.wbg.
|
|
588
|
+
imports.wbg.__wbg_constructor_dddf0209b25406fd = function(arg0) {
|
|
588
589
|
const ret = new Error(arg0);
|
|
589
590
|
return ret;
|
|
590
591
|
};
|
|
@@ -685,7 +686,7 @@ function __wbg_get_imports() {
|
|
|
685
686
|
state0.a = state0.b = 0;
|
|
686
687
|
}
|
|
687
688
|
};
|
|
688
|
-
imports.wbg.
|
|
689
|
+
imports.wbg.__wbg_new_2812f5f6a6bd8bcf = function() {
|
|
689
690
|
const ret = new Array();
|
|
690
691
|
return ret;
|
|
691
692
|
};
|
|
@@ -701,7 +702,7 @@ function __wbg_get_imports() {
|
|
|
701
702
|
const ret = new Error();
|
|
702
703
|
return ret;
|
|
703
704
|
};
|
|
704
|
-
imports.wbg.
|
|
705
|
+
imports.wbg.__wbg_new_b110592360513189 = function() {
|
|
705
706
|
const ret = new Map();
|
|
706
707
|
return ret;
|
|
707
708
|
};
|
|
@@ -797,8 +798,8 @@ function __wbg_get_imports() {
|
|
|
797
798
|
const ret = false;
|
|
798
799
|
return ret;
|
|
799
800
|
};
|
|
800
|
-
imports.wbg.
|
|
801
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
801
|
+
imports.wbg.__wbindgen_closure_wrapper1366 = function(arg0, arg1, arg2) {
|
|
802
|
+
const ret = makeMutClosure(arg0, arg1, 446, __wbg_adapter_30);
|
|
802
803
|
return ret;
|
|
803
804
|
};
|
|
804
805
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
package/web/acvm_js_bg.wasm
CHANGED
|
Binary file
|
package/web/acvm_js_bg.wasm.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const compressWitness: (a: any) => [number, number, number, number];
|
|
5
|
+
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
6
|
+
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
7
|
+
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
4
8
|
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
5
9
|
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
6
10
|
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
7
|
-
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
8
11
|
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
9
12
|
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
10
13
|
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
11
|
-
export const buildInfo: () => any;
|
|
12
|
-
export const compressWitness: (a: any) => [number, number, number, number];
|
|
13
|
-
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
14
|
-
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
15
|
-
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
16
14
|
export const and: (a: any, b: any) => any;
|
|
17
15
|
export const xor: (a: any, b: any) => any;
|
|
18
16
|
export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
19
17
|
export const blake2s256: (a: number, b: number) => [number, number];
|
|
20
18
|
export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
21
19
|
export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
20
|
+
export const buildInfo: () => any;
|
|
21
|
+
export const initLogLevel: (a: number, b: 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 closure445_externref_shim: (a: number, b: number, c: any) => void;
|
|
31
|
+
export const closure924_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
32
|
+
export const closure928_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
33
33
|
export const __wbindgen_start: () => void;
|