@noir-lang/acvm_js 0.47.0-e100017.nightly → 0.47.0-ee8b0cd.nightly
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nodejs/acvm_js.d.ts +50 -50
- package/nodejs/acvm_js.js +126 -126
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +6 -6
- package/package.json +1 -1
- package/web/acvm_js.d.ts +56 -56
- package/web/acvm_js.js +125 -125
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +6 -6
package/nodejs/acvm_js.d.ts
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
5
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
6
|
+
*/
|
|
7
|
+
export function buildInfo(): BuildInfo;
|
|
8
|
+
/**
|
|
9
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
10
|
+
*
|
|
11
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
12
|
+
* @returns {Uint8Array} A compressed witness map
|
|
13
|
+
*/
|
|
14
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
15
|
+
/**
|
|
16
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
17
|
+
* This should be used to only fetch the witness map for the main function.
|
|
18
|
+
*
|
|
19
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
20
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
21
|
+
*/
|
|
22
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
23
|
+
/**
|
|
24
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
25
|
+
*
|
|
26
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
27
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
28
|
+
*/
|
|
29
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
30
|
+
/**
|
|
31
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
32
|
+
*
|
|
33
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
34
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
35
|
+
*/
|
|
36
|
+
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
37
|
+
/**
|
|
4
38
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
39
|
*
|
|
6
40
|
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
@@ -62,12 +96,6 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
|
|
|
62
96
|
*/
|
|
63
97
|
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
64
98
|
/**
|
|
65
|
-
* Sets the package's logging level.
|
|
66
|
-
*
|
|
67
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
68
|
-
*/
|
|
69
|
-
export function initLogLevel(filter: string): void;
|
|
70
|
-
/**
|
|
71
99
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
72
100
|
* @param {string} lhs
|
|
73
101
|
* @param {string} rhs
|
|
@@ -118,39 +146,25 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
118
146
|
*/
|
|
119
147
|
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
120
148
|
/**
|
|
121
|
-
*
|
|
122
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
123
|
-
*/
|
|
124
|
-
export function buildInfo(): BuildInfo;
|
|
125
|
-
/**
|
|
126
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
127
|
-
*
|
|
128
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
129
|
-
* @returns {Uint8Array} A compressed witness map
|
|
130
|
-
*/
|
|
131
|
-
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
132
|
-
/**
|
|
133
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
134
|
-
* This should be used to only fetch the witness map for the main function.
|
|
135
|
-
*
|
|
136
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
137
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
138
|
-
*/
|
|
139
|
-
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
140
|
-
/**
|
|
141
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
149
|
+
* Sets the package's logging level.
|
|
142
150
|
*
|
|
143
|
-
* @param {
|
|
144
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
151
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
145
152
|
*/
|
|
146
|
-
export function
|
|
153
|
+
export function initLogLevel(filter: string): void;
|
|
154
|
+
|
|
147
155
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* @
|
|
151
|
-
* @
|
|
152
|
-
*/
|
|
153
|
-
export
|
|
156
|
+
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
157
|
+
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
158
|
+
* @property {string} version - The version of the package at the built git commit.
|
|
159
|
+
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
160
|
+
*/
|
|
161
|
+
export type BuildInfo = {
|
|
162
|
+
gitHash: string;
|
|
163
|
+
version: string;
|
|
164
|
+
dirty: string;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
|
|
154
168
|
|
|
155
169
|
export type RawAssertionPayload = {
|
|
156
170
|
selector: string;
|
|
@@ -200,17 +214,3 @@ export type ForeignCallOutput = string | string[]
|
|
|
200
214
|
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
201
215
|
|
|
202
216
|
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
206
|
-
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
207
|
-
* @property {string} version - The version of the package at the built git commit.
|
|
208
|
-
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
209
|
-
*/
|
|
210
|
-
export type BuildInfo = {
|
|
211
|
-
gitHash: string;
|
|
212
|
-
version: string;
|
|
213
|
-
dirty: string;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
|
package/nodejs/acvm_js.js
CHANGED
|
@@ -220,12 +220,124 @@ function __wbg_adapter_22(arg0, arg1, arg2) {
|
|
|
220
220
|
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h36bac5ff3ea3c380(arg0, arg1, addHeapObject(arg2));
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
/**
|
|
224
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
225
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
226
|
+
*/
|
|
227
|
+
module.exports.buildInfo = function() {
|
|
228
|
+
const ret = wasm.buildInfo();
|
|
229
|
+
return takeObject(ret);
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
233
|
+
ptr = ptr >>> 0;
|
|
234
|
+
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
238
|
+
*
|
|
239
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
240
|
+
* @returns {Uint8Array} A compressed witness map
|
|
241
|
+
*/
|
|
242
|
+
module.exports.compressWitness = function(witness_map) {
|
|
243
|
+
try {
|
|
244
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
245
|
+
wasm.compressWitness(retptr, addHeapObject(witness_map));
|
|
246
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
247
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
248
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
249
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
250
|
+
if (r3) {
|
|
251
|
+
throw takeObject(r2);
|
|
252
|
+
}
|
|
253
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
254
|
+
wasm.__wbindgen_free(r0, r1 * 1);
|
|
255
|
+
return v1;
|
|
256
|
+
} finally {
|
|
257
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
|
|
223
261
|
function passArray8ToWasm0(arg, malloc) {
|
|
224
262
|
const ptr = malloc(arg.length * 1) >>> 0;
|
|
225
263
|
getUint8Memory0().set(arg, ptr / 1);
|
|
226
264
|
WASM_VECTOR_LEN = arg.length;
|
|
227
265
|
return ptr;
|
|
228
266
|
}
|
|
267
|
+
/**
|
|
268
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
269
|
+
* This should be used to only fetch the witness map for the main function.
|
|
270
|
+
*
|
|
271
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
272
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
273
|
+
*/
|
|
274
|
+
module.exports.decompressWitness = function(compressed_witness) {
|
|
275
|
+
try {
|
|
276
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
277
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
278
|
+
const len0 = WASM_VECTOR_LEN;
|
|
279
|
+
wasm.decompressWitness(retptr, ptr0, len0);
|
|
280
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
281
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
282
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
283
|
+
if (r2) {
|
|
284
|
+
throw takeObject(r1);
|
|
285
|
+
}
|
|
286
|
+
return takeObject(r0);
|
|
287
|
+
} finally {
|
|
288
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
294
|
+
*
|
|
295
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
296
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
297
|
+
*/
|
|
298
|
+
module.exports.compressWitnessStack = function(witness_stack) {
|
|
299
|
+
try {
|
|
300
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
301
|
+
wasm.compressWitnessStack(retptr, addHeapObject(witness_stack));
|
|
302
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
303
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
304
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
305
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
306
|
+
if (r3) {
|
|
307
|
+
throw takeObject(r2);
|
|
308
|
+
}
|
|
309
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
310
|
+
wasm.__wbindgen_free(r0, r1 * 1);
|
|
311
|
+
return v1;
|
|
312
|
+
} finally {
|
|
313
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
319
|
+
*
|
|
320
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
321
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
322
|
+
*/
|
|
323
|
+
module.exports.decompressWitnessStack = function(compressed_witness) {
|
|
324
|
+
try {
|
|
325
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
326
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
327
|
+
const len0 = WASM_VECTOR_LEN;
|
|
328
|
+
wasm.decompressWitnessStack(retptr, ptr0, len0);
|
|
329
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
330
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
331
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
332
|
+
if (r2) {
|
|
333
|
+
throw takeObject(r1);
|
|
334
|
+
}
|
|
335
|
+
return takeObject(r0);
|
|
336
|
+
} finally {
|
|
337
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
|
|
229
341
|
/**
|
|
230
342
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
231
343
|
*
|
|
@@ -356,27 +468,6 @@ module.exports.getPublicWitness = function(program, solved_witness) {
|
|
|
356
468
|
}
|
|
357
469
|
};
|
|
358
470
|
|
|
359
|
-
/**
|
|
360
|
-
* Sets the package's logging level.
|
|
361
|
-
*
|
|
362
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
363
|
-
*/
|
|
364
|
-
module.exports.initLogLevel = function(filter) {
|
|
365
|
-
try {
|
|
366
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
367
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
368
|
-
const len0 = WASM_VECTOR_LEN;
|
|
369
|
-
wasm.initLogLevel(retptr, ptr0, len0);
|
|
370
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
371
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
372
|
-
if (r1) {
|
|
373
|
-
throw takeObject(r0);
|
|
374
|
-
}
|
|
375
|
-
} finally {
|
|
376
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
377
|
-
}
|
|
378
|
-
};
|
|
379
|
-
|
|
380
471
|
/**
|
|
381
472
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
382
473
|
* @param {string} lhs
|
|
@@ -399,10 +490,6 @@ module.exports.xor = function(lhs, rhs) {
|
|
|
399
490
|
return takeObject(ret);
|
|
400
491
|
};
|
|
401
492
|
|
|
402
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
403
|
-
ptr = ptr >>> 0;
|
|
404
|
-
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
405
|
-
}
|
|
406
493
|
/**
|
|
407
494
|
* Calculates the SHA256 hash of the input bytes
|
|
408
495
|
* @param {Uint8Array} inputs
|
|
@@ -509,108 +596,21 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
|
|
|
509
596
|
};
|
|
510
597
|
|
|
511
598
|
/**
|
|
512
|
-
*
|
|
513
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
514
|
-
*/
|
|
515
|
-
module.exports.buildInfo = function() {
|
|
516
|
-
const ret = wasm.buildInfo();
|
|
517
|
-
return takeObject(ret);
|
|
518
|
-
};
|
|
519
|
-
|
|
520
|
-
/**
|
|
521
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
522
|
-
*
|
|
523
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
524
|
-
* @returns {Uint8Array} A compressed witness map
|
|
525
|
-
*/
|
|
526
|
-
module.exports.compressWitness = function(witness_map) {
|
|
527
|
-
try {
|
|
528
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
529
|
-
wasm.compressWitness(retptr, addHeapObject(witness_map));
|
|
530
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
531
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
532
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
533
|
-
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
534
|
-
if (r3) {
|
|
535
|
-
throw takeObject(r2);
|
|
536
|
-
}
|
|
537
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
538
|
-
wasm.__wbindgen_free(r0, r1 * 1);
|
|
539
|
-
return v1;
|
|
540
|
-
} finally {
|
|
541
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
542
|
-
}
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
/**
|
|
546
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
547
|
-
* This should be used to only fetch the witness map for the main function.
|
|
548
|
-
*
|
|
549
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
550
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
551
|
-
*/
|
|
552
|
-
module.exports.decompressWitness = function(compressed_witness) {
|
|
553
|
-
try {
|
|
554
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
555
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
556
|
-
const len0 = WASM_VECTOR_LEN;
|
|
557
|
-
wasm.decompressWitness(retptr, ptr0, len0);
|
|
558
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
559
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
560
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
561
|
-
if (r2) {
|
|
562
|
-
throw takeObject(r1);
|
|
563
|
-
}
|
|
564
|
-
return takeObject(r0);
|
|
565
|
-
} finally {
|
|
566
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
567
|
-
}
|
|
568
|
-
};
|
|
569
|
-
|
|
570
|
-
/**
|
|
571
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
572
|
-
*
|
|
573
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
574
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
575
|
-
*/
|
|
576
|
-
module.exports.compressWitnessStack = function(witness_stack) {
|
|
577
|
-
try {
|
|
578
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
579
|
-
wasm.compressWitnessStack(retptr, addHeapObject(witness_stack));
|
|
580
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
581
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
582
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
583
|
-
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
584
|
-
if (r3) {
|
|
585
|
-
throw takeObject(r2);
|
|
586
|
-
}
|
|
587
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
588
|
-
wasm.__wbindgen_free(r0, r1 * 1);
|
|
589
|
-
return v1;
|
|
590
|
-
} finally {
|
|
591
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
592
|
-
}
|
|
593
|
-
};
|
|
594
|
-
|
|
595
|
-
/**
|
|
596
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
599
|
+
* Sets the package's logging level.
|
|
597
600
|
*
|
|
598
|
-
* @param {
|
|
599
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
601
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
600
602
|
*/
|
|
601
|
-
module.exports.
|
|
603
|
+
module.exports.initLogLevel = function(filter) {
|
|
602
604
|
try {
|
|
603
605
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
604
|
-
const ptr0 =
|
|
606
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
605
607
|
const len0 = WASM_VECTOR_LEN;
|
|
606
|
-
wasm.
|
|
608
|
+
wasm.initLogLevel(retptr, ptr0, len0);
|
|
607
609
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
608
610
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
throw takeObject(r1);
|
|
611
|
+
if (r1) {
|
|
612
|
+
throw takeObject(r0);
|
|
612
613
|
}
|
|
613
|
-
return takeObject(r0);
|
|
614
614
|
} finally {
|
|
615
615
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
616
616
|
}
|
|
@@ -676,11 +676,6 @@ module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
|
676
676
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
677
677
|
};
|
|
678
678
|
|
|
679
|
-
module.exports.__wbindgen_is_string = function(arg0) {
|
|
680
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
|
681
|
-
return ret;
|
|
682
|
-
};
|
|
683
|
-
|
|
684
679
|
module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
685
680
|
const obj = takeObject(arg0).original;
|
|
686
681
|
if (obj.cnt-- == 1) {
|
|
@@ -696,6 +691,11 @@ module.exports.__wbg_new_f139361aad331bd0 = function() {
|
|
|
696
691
|
return addHeapObject(ret);
|
|
697
692
|
};
|
|
698
693
|
|
|
694
|
+
module.exports.__wbindgen_is_string = function(arg0) {
|
|
695
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
696
|
+
return ret;
|
|
697
|
+
};
|
|
698
|
+
|
|
699
699
|
module.exports.__wbg_new_abda76e883ba8a5f = function() {
|
|
700
700
|
const ret = new Error();
|
|
701
701
|
return addHeapObject(ret);
|
|
@@ -914,8 +914,8 @@ module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
|
914
914
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
915
915
|
};
|
|
916
916
|
|
|
917
|
-
module.exports.
|
|
918
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
917
|
+
module.exports.__wbindgen_closure_wrapper748 = function(arg0, arg1, arg2) {
|
|
918
|
+
const ret = makeMutClosure(arg0, arg1, 246, __wbg_adapter_22);
|
|
919
919
|
return addHeapObject(ret);
|
|
920
920
|
};
|
|
921
921
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export function buildInfo(): number;
|
|
5
|
+
export function compressWitness(a: number, b: number): void;
|
|
6
|
+
export function decompressWitness(a: number, b: number, c: number): void;
|
|
7
|
+
export function compressWitnessStack(a: number, b: number): void;
|
|
8
|
+
export function decompressWitnessStack(a: number, b: number, c: number): void;
|
|
4
9
|
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
5
10
|
export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number;
|
|
6
11
|
export function executeProgram(a: number, b: number, c: number, d: number): number;
|
|
7
12
|
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
8
13
|
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
9
14
|
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
10
|
-
export function initLogLevel(a: number, b: number, c: number): void;
|
|
11
15
|
export function and(a: number, b: number): number;
|
|
12
16
|
export function xor(a: number, b: number): number;
|
|
13
17
|
export function sha256(a: number, b: number, c: number): void;
|
|
@@ -15,11 +19,7 @@ export function blake2s256(a: number, b: number, c: number): void;
|
|
|
15
19
|
export function keccak256(a: number, b: number, c: number): void;
|
|
16
20
|
export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
17
21
|
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
18
|
-
export function
|
|
19
|
-
export function compressWitness(a: number, b: number): void;
|
|
20
|
-
export function decompressWitness(a: number, b: number, c: number): void;
|
|
21
|
-
export function compressWitnessStack(a: number, b: number): void;
|
|
22
|
-
export function decompressWitnessStack(a: number, b: number, c: number): void;
|
|
22
|
+
export function initLogLevel(a: number, b: number, c: number): void;
|
|
23
23
|
export function __wbindgen_malloc(a: number): number;
|
|
24
24
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
25
25
|
export const __wbindgen_export_2: WebAssembly.Table;
|
package/package.json
CHANGED
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
5
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
6
|
+
*/
|
|
7
|
+
export function buildInfo(): BuildInfo;
|
|
8
|
+
/**
|
|
9
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
10
|
+
*
|
|
11
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
12
|
+
* @returns {Uint8Array} A compressed witness map
|
|
13
|
+
*/
|
|
14
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
15
|
+
/**
|
|
16
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
17
|
+
* This should be used to only fetch the witness map for the main function.
|
|
18
|
+
*
|
|
19
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
20
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
21
|
+
*/
|
|
22
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
23
|
+
/**
|
|
24
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
25
|
+
*
|
|
26
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
27
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
28
|
+
*/
|
|
29
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
30
|
+
/**
|
|
31
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
32
|
+
*
|
|
33
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
34
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
35
|
+
*/
|
|
36
|
+
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
37
|
+
/**
|
|
4
38
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
39
|
*
|
|
6
40
|
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
@@ -62,12 +96,6 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
|
|
|
62
96
|
*/
|
|
63
97
|
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
64
98
|
/**
|
|
65
|
-
* Sets the package's logging level.
|
|
66
|
-
*
|
|
67
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
68
|
-
*/
|
|
69
|
-
export function initLogLevel(filter: string): void;
|
|
70
|
-
/**
|
|
71
99
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
72
100
|
* @param {string} lhs
|
|
73
101
|
* @param {string} rhs
|
|
@@ -118,39 +146,25 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
118
146
|
*/
|
|
119
147
|
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
120
148
|
/**
|
|
121
|
-
*
|
|
122
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
123
|
-
*/
|
|
124
|
-
export function buildInfo(): BuildInfo;
|
|
125
|
-
/**
|
|
126
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
127
|
-
*
|
|
128
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
129
|
-
* @returns {Uint8Array} A compressed witness map
|
|
130
|
-
*/
|
|
131
|
-
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
132
|
-
/**
|
|
133
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
134
|
-
* This should be used to only fetch the witness map for the main function.
|
|
135
|
-
*
|
|
136
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
137
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
138
|
-
*/
|
|
139
|
-
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
140
|
-
/**
|
|
141
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
149
|
+
* Sets the package's logging level.
|
|
142
150
|
*
|
|
143
|
-
* @param {
|
|
144
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
151
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
145
152
|
*/
|
|
146
|
-
export function
|
|
153
|
+
export function initLogLevel(filter: string): void;
|
|
154
|
+
|
|
147
155
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* @
|
|
151
|
-
* @
|
|
152
|
-
*/
|
|
153
|
-
export
|
|
156
|
+
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
157
|
+
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
158
|
+
* @property {string} version - The version of the package at the built git commit.
|
|
159
|
+
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
160
|
+
*/
|
|
161
|
+
export type BuildInfo = {
|
|
162
|
+
gitHash: string;
|
|
163
|
+
version: string;
|
|
164
|
+
dirty: string;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
|
|
154
168
|
|
|
155
169
|
export type RawAssertionPayload = {
|
|
156
170
|
selector: string;
|
|
@@ -201,31 +215,21 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
|
|
|
201
215
|
|
|
202
216
|
|
|
203
217
|
|
|
204
|
-
/**
|
|
205
|
-
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
206
|
-
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
207
|
-
* @property {string} version - The version of the package at the built git commit.
|
|
208
|
-
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
209
|
-
*/
|
|
210
|
-
export type BuildInfo = {
|
|
211
|
-
gitHash: string;
|
|
212
|
-
version: string;
|
|
213
|
-
dirty: string;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
218
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
219
219
|
|
|
220
220
|
export interface InitOutput {
|
|
221
221
|
readonly memory: WebAssembly.Memory;
|
|
222
|
+
readonly buildInfo: () => number;
|
|
223
|
+
readonly compressWitness: (a: number, b: number) => void;
|
|
224
|
+
readonly decompressWitness: (a: number, b: number, c: number) => void;
|
|
225
|
+
readonly compressWitnessStack: (a: number, b: number) => void;
|
|
226
|
+
readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
|
|
222
227
|
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
|
|
223
228
|
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: number, d: number) => number;
|
|
224
229
|
readonly executeProgram: (a: number, b: number, c: number, d: number) => number;
|
|
225
230
|
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
226
231
|
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
227
232
|
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
228
|
-
readonly initLogLevel: (a: number, b: number, c: number) => void;
|
|
229
233
|
readonly and: (a: number, b: number) => number;
|
|
230
234
|
readonly xor: (a: number, b: number) => number;
|
|
231
235
|
readonly sha256: (a: number, b: number, c: number) => void;
|
|
@@ -233,11 +237,7 @@ export interface InitOutput {
|
|
|
233
237
|
readonly keccak256: (a: number, b: number, c: number) => void;
|
|
234
238
|
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
235
239
|
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
236
|
-
readonly
|
|
237
|
-
readonly compressWitness: (a: number, b: number) => void;
|
|
238
|
-
readonly decompressWitness: (a: number, b: number, c: number) => void;
|
|
239
|
-
readonly compressWitnessStack: (a: number, b: number) => void;
|
|
240
|
-
readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
|
|
240
|
+
readonly initLogLevel: (a: number, b: number, c: number) => void;
|
|
241
241
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
242
242
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
243
243
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
package/web/acvm_js.js
CHANGED
|
@@ -217,12 +217,124 @@ function __wbg_adapter_22(arg0, arg1, arg2) {
|
|
|
217
217
|
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h36bac5ff3ea3c380(arg0, arg1, addHeapObject(arg2));
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
+
/**
|
|
221
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
222
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
223
|
+
*/
|
|
224
|
+
export function buildInfo() {
|
|
225
|
+
const ret = wasm.buildInfo();
|
|
226
|
+
return takeObject(ret);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
230
|
+
ptr = ptr >>> 0;
|
|
231
|
+
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
235
|
+
*
|
|
236
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
237
|
+
* @returns {Uint8Array} A compressed witness map
|
|
238
|
+
*/
|
|
239
|
+
export function compressWitness(witness_map) {
|
|
240
|
+
try {
|
|
241
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
242
|
+
wasm.compressWitness(retptr, addHeapObject(witness_map));
|
|
243
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
244
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
245
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
246
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
247
|
+
if (r3) {
|
|
248
|
+
throw takeObject(r2);
|
|
249
|
+
}
|
|
250
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
251
|
+
wasm.__wbindgen_free(r0, r1 * 1);
|
|
252
|
+
return v1;
|
|
253
|
+
} finally {
|
|
254
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
220
258
|
function passArray8ToWasm0(arg, malloc) {
|
|
221
259
|
const ptr = malloc(arg.length * 1) >>> 0;
|
|
222
260
|
getUint8Memory0().set(arg, ptr / 1);
|
|
223
261
|
WASM_VECTOR_LEN = arg.length;
|
|
224
262
|
return ptr;
|
|
225
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
266
|
+
* This should be used to only fetch the witness map for the main function.
|
|
267
|
+
*
|
|
268
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
269
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
270
|
+
*/
|
|
271
|
+
export function decompressWitness(compressed_witness) {
|
|
272
|
+
try {
|
|
273
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
274
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
275
|
+
const len0 = WASM_VECTOR_LEN;
|
|
276
|
+
wasm.decompressWitness(retptr, ptr0, len0);
|
|
277
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
278
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
279
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
280
|
+
if (r2) {
|
|
281
|
+
throw takeObject(r1);
|
|
282
|
+
}
|
|
283
|
+
return takeObject(r0);
|
|
284
|
+
} finally {
|
|
285
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
291
|
+
*
|
|
292
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
293
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
294
|
+
*/
|
|
295
|
+
export function compressWitnessStack(witness_stack) {
|
|
296
|
+
try {
|
|
297
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
298
|
+
wasm.compressWitnessStack(retptr, addHeapObject(witness_stack));
|
|
299
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
300
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
301
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
302
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
303
|
+
if (r3) {
|
|
304
|
+
throw takeObject(r2);
|
|
305
|
+
}
|
|
306
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
307
|
+
wasm.__wbindgen_free(r0, r1 * 1);
|
|
308
|
+
return v1;
|
|
309
|
+
} finally {
|
|
310
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
316
|
+
*
|
|
317
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
318
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
319
|
+
*/
|
|
320
|
+
export function decompressWitnessStack(compressed_witness) {
|
|
321
|
+
try {
|
|
322
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
323
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
324
|
+
const len0 = WASM_VECTOR_LEN;
|
|
325
|
+
wasm.decompressWitnessStack(retptr, ptr0, len0);
|
|
326
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
327
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
328
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
329
|
+
if (r2) {
|
|
330
|
+
throw takeObject(r1);
|
|
331
|
+
}
|
|
332
|
+
return takeObject(r0);
|
|
333
|
+
} finally {
|
|
334
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
226
338
|
/**
|
|
227
339
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
228
340
|
*
|
|
@@ -353,27 +465,6 @@ export function getPublicWitness(program, solved_witness) {
|
|
|
353
465
|
}
|
|
354
466
|
}
|
|
355
467
|
|
|
356
|
-
/**
|
|
357
|
-
* Sets the package's logging level.
|
|
358
|
-
*
|
|
359
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
360
|
-
*/
|
|
361
|
-
export function initLogLevel(filter) {
|
|
362
|
-
try {
|
|
363
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
364
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
365
|
-
const len0 = WASM_VECTOR_LEN;
|
|
366
|
-
wasm.initLogLevel(retptr, ptr0, len0);
|
|
367
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
368
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
369
|
-
if (r1) {
|
|
370
|
-
throw takeObject(r0);
|
|
371
|
-
}
|
|
372
|
-
} finally {
|
|
373
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
468
|
/**
|
|
378
469
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
379
470
|
* @param {string} lhs
|
|
@@ -396,10 +487,6 @@ export function xor(lhs, rhs) {
|
|
|
396
487
|
return takeObject(ret);
|
|
397
488
|
}
|
|
398
489
|
|
|
399
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
400
|
-
ptr = ptr >>> 0;
|
|
401
|
-
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
402
|
-
}
|
|
403
490
|
/**
|
|
404
491
|
* Calculates the SHA256 hash of the input bytes
|
|
405
492
|
* @param {Uint8Array} inputs
|
|
@@ -506,108 +593,21 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
|
|
|
506
593
|
}
|
|
507
594
|
|
|
508
595
|
/**
|
|
509
|
-
*
|
|
510
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
511
|
-
*/
|
|
512
|
-
export function buildInfo() {
|
|
513
|
-
const ret = wasm.buildInfo();
|
|
514
|
-
return takeObject(ret);
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
/**
|
|
518
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
519
|
-
*
|
|
520
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
521
|
-
* @returns {Uint8Array} A compressed witness map
|
|
522
|
-
*/
|
|
523
|
-
export function compressWitness(witness_map) {
|
|
524
|
-
try {
|
|
525
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
526
|
-
wasm.compressWitness(retptr, addHeapObject(witness_map));
|
|
527
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
528
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
529
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
530
|
-
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
531
|
-
if (r3) {
|
|
532
|
-
throw takeObject(r2);
|
|
533
|
-
}
|
|
534
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
535
|
-
wasm.__wbindgen_free(r0, r1 * 1);
|
|
536
|
-
return v1;
|
|
537
|
-
} finally {
|
|
538
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
/**
|
|
543
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
544
|
-
* This should be used to only fetch the witness map for the main function.
|
|
545
|
-
*
|
|
546
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
547
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
548
|
-
*/
|
|
549
|
-
export function decompressWitness(compressed_witness) {
|
|
550
|
-
try {
|
|
551
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
552
|
-
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
553
|
-
const len0 = WASM_VECTOR_LEN;
|
|
554
|
-
wasm.decompressWitness(retptr, ptr0, len0);
|
|
555
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
556
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
557
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
558
|
-
if (r2) {
|
|
559
|
-
throw takeObject(r1);
|
|
560
|
-
}
|
|
561
|
-
return takeObject(r0);
|
|
562
|
-
} finally {
|
|
563
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
/**
|
|
568
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
569
|
-
*
|
|
570
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
571
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
572
|
-
*/
|
|
573
|
-
export function compressWitnessStack(witness_stack) {
|
|
574
|
-
try {
|
|
575
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
576
|
-
wasm.compressWitnessStack(retptr, addHeapObject(witness_stack));
|
|
577
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
578
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
579
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
580
|
-
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
581
|
-
if (r3) {
|
|
582
|
-
throw takeObject(r2);
|
|
583
|
-
}
|
|
584
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
585
|
-
wasm.__wbindgen_free(r0, r1 * 1);
|
|
586
|
-
return v1;
|
|
587
|
-
} finally {
|
|
588
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
596
|
+
* Sets the package's logging level.
|
|
594
597
|
*
|
|
595
|
-
* @param {
|
|
596
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
598
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
597
599
|
*/
|
|
598
|
-
export function
|
|
600
|
+
export function initLogLevel(filter) {
|
|
599
601
|
try {
|
|
600
602
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
601
|
-
const ptr0 =
|
|
603
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
602
604
|
const len0 = WASM_VECTOR_LEN;
|
|
603
|
-
wasm.
|
|
605
|
+
wasm.initLogLevel(retptr, ptr0, len0);
|
|
604
606
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
605
607
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
throw takeObject(r1);
|
|
608
|
+
if (r1) {
|
|
609
|
+
throw takeObject(r0);
|
|
609
610
|
}
|
|
610
|
-
return takeObject(r0);
|
|
611
611
|
} finally {
|
|
612
612
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
613
613
|
}
|
|
@@ -699,10 +699,6 @@ function __wbg_get_imports() {
|
|
|
699
699
|
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
700
700
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
701
701
|
};
|
|
702
|
-
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
703
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
|
704
|
-
return ret;
|
|
705
|
-
};
|
|
706
702
|
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
707
703
|
const obj = takeObject(arg0).original;
|
|
708
704
|
if (obj.cnt-- == 1) {
|
|
@@ -716,6 +712,10 @@ function __wbg_get_imports() {
|
|
|
716
712
|
const ret = new Array();
|
|
717
713
|
return addHeapObject(ret);
|
|
718
714
|
};
|
|
715
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
716
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
717
|
+
return ret;
|
|
718
|
+
};
|
|
719
719
|
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
|
|
720
720
|
const ret = new Error();
|
|
721
721
|
return addHeapObject(ret);
|
|
@@ -899,8 +899,8 @@ function __wbg_get_imports() {
|
|
|
899
899
|
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
900
900
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
901
901
|
};
|
|
902
|
-
imports.wbg.
|
|
903
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
902
|
+
imports.wbg.__wbindgen_closure_wrapper748 = function(arg0, arg1, arg2) {
|
|
903
|
+
const ret = makeMutClosure(arg0, arg1, 246, __wbg_adapter_22);
|
|
904
904
|
return addHeapObject(ret);
|
|
905
905
|
};
|
|
906
906
|
|
package/web/acvm_js_bg.wasm
CHANGED
|
Binary file
|
package/web/acvm_js_bg.wasm.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export function buildInfo(): number;
|
|
5
|
+
export function compressWitness(a: number, b: number): void;
|
|
6
|
+
export function decompressWitness(a: number, b: number, c: number): void;
|
|
7
|
+
export function compressWitnessStack(a: number, b: number): void;
|
|
8
|
+
export function decompressWitnessStack(a: number, b: number, c: number): void;
|
|
4
9
|
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
5
10
|
export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number;
|
|
6
11
|
export function executeProgram(a: number, b: number, c: number, d: number): number;
|
|
7
12
|
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
8
13
|
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
9
14
|
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
10
|
-
export function initLogLevel(a: number, b: number, c: number): void;
|
|
11
15
|
export function and(a: number, b: number): number;
|
|
12
16
|
export function xor(a: number, b: number): number;
|
|
13
17
|
export function sha256(a: number, b: number, c: number): void;
|
|
@@ -15,11 +19,7 @@ export function blake2s256(a: number, b: number, c: number): void;
|
|
|
15
19
|
export function keccak256(a: number, b: number, c: number): void;
|
|
16
20
|
export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
17
21
|
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
18
|
-
export function
|
|
19
|
-
export function compressWitness(a: number, b: number): void;
|
|
20
|
-
export function decompressWitness(a: number, b: number, c: number): void;
|
|
21
|
-
export function compressWitnessStack(a: number, b: number): void;
|
|
22
|
-
export function decompressWitnessStack(a: number, b: number, c: number): void;
|
|
22
|
+
export function initLogLevel(a: number, b: number, c: number): void;
|
|
23
23
|
export function __wbindgen_malloc(a: number): number;
|
|
24
24
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
25
25
|
export const __wbindgen_export_2: WebAssembly.Table;
|