@noir-lang/acvm_js 0.39.0 → 0.40.0
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 +39 -39
- package/nodejs/acvm_js.js +155 -146
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +4 -4
- package/package.json +2 -2
- package/web/acvm_js.d.ts +43 -43
- package/web/acvm_js.js +152 -143
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +4 -4
package/nodejs/acvm_js.d.ts
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
5
|
+
*
|
|
6
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
7
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
8
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
9
|
+
* @param {Uint8Array} circuit
|
|
10
|
+
* @param {WitnessMap} solved_witness
|
|
11
|
+
* @returns {WitnessMap}
|
|
12
|
+
*/
|
|
13
|
+
export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
14
|
+
/**
|
|
15
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
16
|
+
*
|
|
17
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
18
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
19
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
20
|
+
* @param {Uint8Array} circuit
|
|
21
|
+
* @param {WitnessMap} solved_witness
|
|
22
|
+
* @returns {WitnessMap}
|
|
23
|
+
*/
|
|
24
|
+
export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
25
|
+
/**
|
|
26
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
27
|
+
*
|
|
28
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
29
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
30
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
31
|
+
* @param {Uint8Array} circuit
|
|
32
|
+
* @param {WitnessMap} witness_map
|
|
33
|
+
* @returns {WitnessMap}
|
|
34
|
+
*/
|
|
35
|
+
export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
36
|
+
/**
|
|
37
|
+
* Sets the package's logging level.
|
|
38
|
+
*
|
|
39
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
40
|
+
*/
|
|
41
|
+
export function initLogLevel(filter: string): void;
|
|
42
|
+
/**
|
|
4
43
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
44
|
*
|
|
6
45
|
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
@@ -74,12 +113,6 @@ export function xor(lhs: string, rhs: string): string;
|
|
|
74
113
|
*/
|
|
75
114
|
export function and(lhs: string, rhs: string): string;
|
|
76
115
|
/**
|
|
77
|
-
* Sets the package's logging level.
|
|
78
|
-
*
|
|
79
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
80
|
-
*/
|
|
81
|
-
export function initLogLevel(filter: string): void;
|
|
82
|
-
/**
|
|
83
116
|
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
84
117
|
*
|
|
85
118
|
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
@@ -98,39 +131,6 @@ export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
|
98
131
|
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
99
132
|
*/
|
|
100
133
|
export function buildInfo(): BuildInfo;
|
|
101
|
-
/**
|
|
102
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
103
|
-
*
|
|
104
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
105
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
106
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
107
|
-
* @param {Uint8Array} circuit
|
|
108
|
-
* @param {WitnessMap} solved_witness
|
|
109
|
-
* @returns {WitnessMap}
|
|
110
|
-
*/
|
|
111
|
-
export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
112
|
-
/**
|
|
113
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
114
|
-
*
|
|
115
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
116
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
117
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
118
|
-
* @param {Uint8Array} circuit
|
|
119
|
-
* @param {WitnessMap} solved_witness
|
|
120
|
-
* @returns {WitnessMap}
|
|
121
|
-
*/
|
|
122
|
-
export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
123
|
-
/**
|
|
124
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
125
|
-
*
|
|
126
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
127
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
128
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
129
|
-
* @param {Uint8Array} circuit
|
|
130
|
-
* @param {WitnessMap} witness_map
|
|
131
|
-
* @returns {WitnessMap}
|
|
132
|
-
*/
|
|
133
|
-
export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
134
134
|
|
|
135
135
|
// Map from witness index to hex string value of witness.
|
|
136
136
|
export type WitnessMap = Map<number, string>;
|
package/nodejs/acvm_js.js
CHANGED
|
@@ -50,28 +50,6 @@ function addHeapObject(obj) {
|
|
|
50
50
|
return idx;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
function isLikeNone(x) {
|
|
54
|
-
return x === undefined || x === null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
let cachedFloat64Memory0 = null;
|
|
58
|
-
|
|
59
|
-
function getFloat64Memory0() {
|
|
60
|
-
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
61
|
-
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
62
|
-
}
|
|
63
|
-
return cachedFloat64Memory0;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
let cachedInt32Memory0 = null;
|
|
67
|
-
|
|
68
|
-
function getInt32Memory0() {
|
|
69
|
-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
70
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
71
|
-
}
|
|
72
|
-
return cachedInt32Memory0;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
53
|
let WASM_VECTOR_LEN = 0;
|
|
76
54
|
|
|
77
55
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
@@ -127,6 +105,28 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
127
105
|
return ptr;
|
|
128
106
|
}
|
|
129
107
|
|
|
108
|
+
function isLikeNone(x) {
|
|
109
|
+
return x === undefined || x === null;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
let cachedInt32Memory0 = null;
|
|
113
|
+
|
|
114
|
+
function getInt32Memory0() {
|
|
115
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
116
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
117
|
+
}
|
|
118
|
+
return cachedInt32Memory0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let cachedFloat64Memory0 = null;
|
|
122
|
+
|
|
123
|
+
function getFloat64Memory0() {
|
|
124
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
125
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
126
|
+
}
|
|
127
|
+
return cachedFloat64Memory0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
130
|
let cachedBigInt64Memory0 = null;
|
|
131
131
|
|
|
132
132
|
function getBigInt64Memory0() {
|
|
@@ -229,13 +229,6 @@ function __wbg_adapter_52(arg0, arg1, arg2) {
|
|
|
229
229
|
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0c6c8312617d6ad4(arg0, arg1, addHeapObject(arg2));
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
function _assertClass(instance, klass) {
|
|
233
|
-
if (!(instance instanceof klass)) {
|
|
234
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
235
|
-
}
|
|
236
|
-
return instance.ptr;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
232
|
function passArray8ToWasm0(arg, malloc) {
|
|
240
233
|
const ptr = malloc(arg.length * 1) >>> 0;
|
|
241
234
|
getUint8Memory0().set(arg, ptr / 1);
|
|
@@ -243,6 +236,117 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
243
236
|
return ptr;
|
|
244
237
|
}
|
|
245
238
|
/**
|
|
239
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
240
|
+
*
|
|
241
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
242
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
243
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
244
|
+
* @param {Uint8Array} circuit
|
|
245
|
+
* @param {WitnessMap} solved_witness
|
|
246
|
+
* @returns {WitnessMap}
|
|
247
|
+
*/
|
|
248
|
+
module.exports.getPublicWitness = function(circuit, solved_witness) {
|
|
249
|
+
try {
|
|
250
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
251
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
252
|
+
const len0 = WASM_VECTOR_LEN;
|
|
253
|
+
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
254
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
255
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
256
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
257
|
+
if (r2) {
|
|
258
|
+
throw takeObject(r1);
|
|
259
|
+
}
|
|
260
|
+
return takeObject(r0);
|
|
261
|
+
} finally {
|
|
262
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
268
|
+
*
|
|
269
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
270
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
271
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
272
|
+
* @param {Uint8Array} circuit
|
|
273
|
+
* @param {WitnessMap} solved_witness
|
|
274
|
+
* @returns {WitnessMap}
|
|
275
|
+
*/
|
|
276
|
+
module.exports.getPublicParametersWitness = function(circuit, solved_witness) {
|
|
277
|
+
try {
|
|
278
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
279
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
280
|
+
const len0 = WASM_VECTOR_LEN;
|
|
281
|
+
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
282
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
283
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
284
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
285
|
+
if (r2) {
|
|
286
|
+
throw takeObject(r1);
|
|
287
|
+
}
|
|
288
|
+
return takeObject(r0);
|
|
289
|
+
} finally {
|
|
290
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
296
|
+
*
|
|
297
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
298
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
299
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
300
|
+
* @param {Uint8Array} circuit
|
|
301
|
+
* @param {WitnessMap} witness_map
|
|
302
|
+
* @returns {WitnessMap}
|
|
303
|
+
*/
|
|
304
|
+
module.exports.getReturnWitness = function(circuit, witness_map) {
|
|
305
|
+
try {
|
|
306
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
307
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
308
|
+
const len0 = WASM_VECTOR_LEN;
|
|
309
|
+
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
310
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
311
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
312
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
313
|
+
if (r2) {
|
|
314
|
+
throw takeObject(r1);
|
|
315
|
+
}
|
|
316
|
+
return takeObject(r0);
|
|
317
|
+
} finally {
|
|
318
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Sets the package's logging level.
|
|
324
|
+
*
|
|
325
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
326
|
+
*/
|
|
327
|
+
module.exports.initLogLevel = function(filter) {
|
|
328
|
+
try {
|
|
329
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
330
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
331
|
+
const len0 = WASM_VECTOR_LEN;
|
|
332
|
+
wasm.initLogLevel(retptr, ptr0, len0);
|
|
333
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
334
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
335
|
+
if (r1) {
|
|
336
|
+
throw takeObject(r0);
|
|
337
|
+
}
|
|
338
|
+
} finally {
|
|
339
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
function _assertClass(instance, klass) {
|
|
344
|
+
if (!(instance instanceof klass)) {
|
|
345
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
346
|
+
}
|
|
347
|
+
return instance.ptr;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
246
350
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
247
351
|
*
|
|
248
352
|
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
@@ -413,17 +517,6 @@ module.exports.and = function(lhs, rhs) {
|
|
|
413
517
|
return takeObject(ret);
|
|
414
518
|
};
|
|
415
519
|
|
|
416
|
-
/**
|
|
417
|
-
* Sets the package's logging level.
|
|
418
|
-
*
|
|
419
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
420
|
-
*/
|
|
421
|
-
module.exports.initLogLevel = function(filter) {
|
|
422
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
423
|
-
const len0 = WASM_VECTOR_LEN;
|
|
424
|
-
wasm.initLogLevel(ptr0, len0);
|
|
425
|
-
};
|
|
426
|
-
|
|
427
520
|
/**
|
|
428
521
|
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
429
522
|
*
|
|
@@ -482,90 +575,6 @@ module.exports.buildInfo = function() {
|
|
|
482
575
|
return takeObject(ret);
|
|
483
576
|
};
|
|
484
577
|
|
|
485
|
-
/**
|
|
486
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
487
|
-
*
|
|
488
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
489
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
490
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
491
|
-
* @param {Uint8Array} circuit
|
|
492
|
-
* @param {WitnessMap} solved_witness
|
|
493
|
-
* @returns {WitnessMap}
|
|
494
|
-
*/
|
|
495
|
-
module.exports.getPublicWitness = function(circuit, solved_witness) {
|
|
496
|
-
try {
|
|
497
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
498
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
499
|
-
const len0 = WASM_VECTOR_LEN;
|
|
500
|
-
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
501
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
502
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
503
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
504
|
-
if (r2) {
|
|
505
|
-
throw takeObject(r1);
|
|
506
|
-
}
|
|
507
|
-
return takeObject(r0);
|
|
508
|
-
} finally {
|
|
509
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
510
|
-
}
|
|
511
|
-
};
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
515
|
-
*
|
|
516
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
517
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
518
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
519
|
-
* @param {Uint8Array} circuit
|
|
520
|
-
* @param {WitnessMap} solved_witness
|
|
521
|
-
* @returns {WitnessMap}
|
|
522
|
-
*/
|
|
523
|
-
module.exports.getPublicParametersWitness = function(circuit, solved_witness) {
|
|
524
|
-
try {
|
|
525
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
526
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
527
|
-
const len0 = WASM_VECTOR_LEN;
|
|
528
|
-
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
529
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
530
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
531
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
532
|
-
if (r2) {
|
|
533
|
-
throw takeObject(r1);
|
|
534
|
-
}
|
|
535
|
-
return takeObject(r0);
|
|
536
|
-
} finally {
|
|
537
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
538
|
-
}
|
|
539
|
-
};
|
|
540
|
-
|
|
541
|
-
/**
|
|
542
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
543
|
-
*
|
|
544
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
545
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
546
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
547
|
-
* @param {Uint8Array} circuit
|
|
548
|
-
* @param {WitnessMap} witness_map
|
|
549
|
-
* @returns {WitnessMap}
|
|
550
|
-
*/
|
|
551
|
-
module.exports.getReturnWitness = function(circuit, witness_map) {
|
|
552
|
-
try {
|
|
553
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
554
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
555
|
-
const len0 = WASM_VECTOR_LEN;
|
|
556
|
-
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
557
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
558
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
559
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
560
|
-
if (r2) {
|
|
561
|
-
throw takeObject(r1);
|
|
562
|
-
}
|
|
563
|
-
return takeObject(r0);
|
|
564
|
-
} finally {
|
|
565
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
566
|
-
}
|
|
567
|
-
};
|
|
568
|
-
|
|
569
578
|
function handleError(f, args) {
|
|
570
579
|
try {
|
|
571
580
|
return f.apply(this, args);
|
|
@@ -647,20 +656,8 @@ module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
|
647
656
|
return addHeapObject(ret);
|
|
648
657
|
};
|
|
649
658
|
|
|
650
|
-
module.exports.
|
|
651
|
-
const
|
|
652
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
653
|
-
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
654
|
-
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
655
|
-
};
|
|
656
|
-
|
|
657
|
-
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
658
|
-
const ret = getObject(arg0);
|
|
659
|
-
return addHeapObject(ret);
|
|
660
|
-
};
|
|
661
|
-
|
|
662
|
-
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
663
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
659
|
+
module.exports.__wbg_constructor_8444207292d12e94 = function(arg0) {
|
|
660
|
+
const ret = new Error(takeObject(arg0));
|
|
664
661
|
return addHeapObject(ret);
|
|
665
662
|
};
|
|
666
663
|
|
|
@@ -669,7 +666,7 @@ module.exports.__wbindgen_is_string = function(arg0) {
|
|
|
669
666
|
return ret;
|
|
670
667
|
};
|
|
671
668
|
|
|
672
|
-
module.exports.
|
|
669
|
+
module.exports.__wbg_new_12499e712355d566 = function() {
|
|
673
670
|
const ret = new Map();
|
|
674
671
|
return addHeapObject(ret);
|
|
675
672
|
};
|
|
@@ -688,6 +685,23 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
|
688
685
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
689
686
|
};
|
|
690
687
|
|
|
688
|
+
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
689
|
+
const obj = getObject(arg1);
|
|
690
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
691
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
692
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
696
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
697
|
+
return addHeapObject(ret);
|
|
698
|
+
};
|
|
699
|
+
|
|
700
|
+
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
701
|
+
const ret = getObject(arg0);
|
|
702
|
+
return addHeapObject(ret);
|
|
703
|
+
};
|
|
704
|
+
|
|
691
705
|
module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
692
706
|
const obj = takeObject(arg0).original;
|
|
693
707
|
if (obj.cnt-- == 1) {
|
|
@@ -698,11 +712,6 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
|
698
712
|
return ret;
|
|
699
713
|
};
|
|
700
714
|
|
|
701
|
-
module.exports.__wbg_constructor_6648e7ae005cd460 = function(arg0) {
|
|
702
|
-
const ret = new Error(takeObject(arg0));
|
|
703
|
-
return addHeapObject(ret);
|
|
704
|
-
};
|
|
705
|
-
|
|
706
715
|
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
707
716
|
const ret = getObject(arg0) === undefined;
|
|
708
717
|
return ret;
|
|
@@ -1221,8 +1230,8 @@ module.exports.__wbindgen_function_table = function() {
|
|
|
1221
1230
|
return addHeapObject(ret);
|
|
1222
1231
|
};
|
|
1223
1232
|
|
|
1224
|
-
module.exports.
|
|
1225
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1233
|
+
module.exports.__wbindgen_closure_wrapper1433 = function(arg0, arg1, arg2) {
|
|
1234
|
+
const ret = makeMutClosure(arg0, arg1, 501, __wbg_adapter_52);
|
|
1226
1235
|
return addHeapObject(ret);
|
|
1227
1236
|
};
|
|
1228
1237
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
5
|
+
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
6
|
+
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
7
|
+
export function initLogLevel(a: number, b: number, c: number): void;
|
|
4
8
|
export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
|
|
5
9
|
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
6
10
|
export function createBlackBoxSolver(): number;
|
|
@@ -12,13 +16,9 @@ export function blake2s256(a: number, b: number, c: number): void;
|
|
|
12
16
|
export function sha256(a: number, b: number, c: number): void;
|
|
13
17
|
export function xor(a: number, b: number): number;
|
|
14
18
|
export function and(a: number, b: number): number;
|
|
15
|
-
export function initLogLevel(a: number, b: number): void;
|
|
16
19
|
export function decompressWitness(a: number, b: number, c: number): void;
|
|
17
20
|
export function compressWitness(a: number, b: number): void;
|
|
18
21
|
export function buildInfo(): number;
|
|
19
|
-
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
20
|
-
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
21
|
-
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
22
22
|
export function __wbg_trap_free(a: number): void;
|
|
23
23
|
export function trap___wbg_wasmer_trap(): void;
|
|
24
24
|
export function __wbindgen_malloc(a: number): number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noir-lang/acvm_js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@web/test-runner": "^0.15.3",
|
|
45
45
|
"@web/test-runner-playwright": "^0.10.0",
|
|
46
46
|
"chai": "^4.3.7",
|
|
47
|
-
"eslint": "^8.
|
|
47
|
+
"eslint": "^8.56.0",
|
|
48
48
|
"eslint-plugin-prettier": "^5.0.0",
|
|
49
49
|
"mocha": "^10.2.0",
|
|
50
50
|
"prettier": "3.0.3",
|
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
5
|
+
*
|
|
6
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
7
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
8
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
9
|
+
* @param {Uint8Array} circuit
|
|
10
|
+
* @param {WitnessMap} solved_witness
|
|
11
|
+
* @returns {WitnessMap}
|
|
12
|
+
*/
|
|
13
|
+
export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
14
|
+
/**
|
|
15
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
16
|
+
*
|
|
17
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
18
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
19
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
20
|
+
* @param {Uint8Array} circuit
|
|
21
|
+
* @param {WitnessMap} solved_witness
|
|
22
|
+
* @returns {WitnessMap}
|
|
23
|
+
*/
|
|
24
|
+
export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
25
|
+
/**
|
|
26
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
27
|
+
*
|
|
28
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
29
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
30
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
31
|
+
* @param {Uint8Array} circuit
|
|
32
|
+
* @param {WitnessMap} witness_map
|
|
33
|
+
* @returns {WitnessMap}
|
|
34
|
+
*/
|
|
35
|
+
export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
36
|
+
/**
|
|
37
|
+
* Sets the package's logging level.
|
|
38
|
+
*
|
|
39
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
40
|
+
*/
|
|
41
|
+
export function initLogLevel(filter: string): void;
|
|
42
|
+
/**
|
|
4
43
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
44
|
*
|
|
6
45
|
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
@@ -74,12 +113,6 @@ export function xor(lhs: string, rhs: string): string;
|
|
|
74
113
|
*/
|
|
75
114
|
export function and(lhs: string, rhs: string): string;
|
|
76
115
|
/**
|
|
77
|
-
* Sets the package's logging level.
|
|
78
|
-
*
|
|
79
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
80
|
-
*/
|
|
81
|
-
export function initLogLevel(filter: string): void;
|
|
82
|
-
/**
|
|
83
116
|
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
84
117
|
*
|
|
85
118
|
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
@@ -98,39 +131,6 @@ export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
|
98
131
|
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
99
132
|
*/
|
|
100
133
|
export function buildInfo(): BuildInfo;
|
|
101
|
-
/**
|
|
102
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
103
|
-
*
|
|
104
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
105
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
106
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
107
|
-
* @param {Uint8Array} circuit
|
|
108
|
-
* @param {WitnessMap} solved_witness
|
|
109
|
-
* @returns {WitnessMap}
|
|
110
|
-
*/
|
|
111
|
-
export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
112
|
-
/**
|
|
113
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
114
|
-
*
|
|
115
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
116
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
117
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
118
|
-
* @param {Uint8Array} circuit
|
|
119
|
-
* @param {WitnessMap} solved_witness
|
|
120
|
-
* @returns {WitnessMap}
|
|
121
|
-
*/
|
|
122
|
-
export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
123
|
-
/**
|
|
124
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
125
|
-
*
|
|
126
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
127
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
128
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
129
|
-
* @param {Uint8Array} circuit
|
|
130
|
-
* @param {WitnessMap} witness_map
|
|
131
|
-
* @returns {WitnessMap}
|
|
132
|
-
*/
|
|
133
|
-
export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
134
134
|
|
|
135
135
|
// Map from witness index to hex string value of witness.
|
|
136
136
|
export type WitnessMap = Map<number, string>;
|
|
@@ -180,6 +180,10 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
180
180
|
|
|
181
181
|
export interface InitOutput {
|
|
182
182
|
readonly memory: WebAssembly.Memory;
|
|
183
|
+
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
184
|
+
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
185
|
+
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
186
|
+
readonly initLogLevel: (a: number, b: number, c: number) => void;
|
|
183
187
|
readonly executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
184
188
|
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
|
|
185
189
|
readonly createBlackBoxSolver: () => number;
|
|
@@ -191,13 +195,9 @@ export interface InitOutput {
|
|
|
191
195
|
readonly sha256: (a: number, b: number, c: number) => void;
|
|
192
196
|
readonly xor: (a: number, b: number) => number;
|
|
193
197
|
readonly and: (a: number, b: number) => number;
|
|
194
|
-
readonly initLogLevel: (a: number, b: number) => void;
|
|
195
198
|
readonly decompressWitness: (a: number, b: number, c: number) => void;
|
|
196
199
|
readonly compressWitness: (a: number, b: number) => void;
|
|
197
200
|
readonly buildInfo: () => number;
|
|
198
|
-
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
199
|
-
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
200
|
-
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
201
201
|
readonly __wbg_trap_free: (a: number) => void;
|
|
202
202
|
readonly trap___wbg_wasmer_trap: () => void;
|
|
203
203
|
readonly __wbindgen_malloc: (a: number) => number;
|
package/web/acvm_js.js
CHANGED
|
@@ -47,28 +47,6 @@ function addHeapObject(obj) {
|
|
|
47
47
|
return idx;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
function isLikeNone(x) {
|
|
51
|
-
return x === undefined || x === null;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
let cachedFloat64Memory0 = null;
|
|
55
|
-
|
|
56
|
-
function getFloat64Memory0() {
|
|
57
|
-
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
58
|
-
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
59
|
-
}
|
|
60
|
-
return cachedFloat64Memory0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
let cachedInt32Memory0 = null;
|
|
64
|
-
|
|
65
|
-
function getInt32Memory0() {
|
|
66
|
-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
67
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
68
|
-
}
|
|
69
|
-
return cachedInt32Memory0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
50
|
let WASM_VECTOR_LEN = 0;
|
|
73
51
|
|
|
74
52
|
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
@@ -124,6 +102,28 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
124
102
|
return ptr;
|
|
125
103
|
}
|
|
126
104
|
|
|
105
|
+
function isLikeNone(x) {
|
|
106
|
+
return x === undefined || x === null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
let cachedInt32Memory0 = null;
|
|
110
|
+
|
|
111
|
+
function getInt32Memory0() {
|
|
112
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
113
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
114
|
+
}
|
|
115
|
+
return cachedInt32Memory0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
let cachedFloat64Memory0 = null;
|
|
119
|
+
|
|
120
|
+
function getFloat64Memory0() {
|
|
121
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
122
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
123
|
+
}
|
|
124
|
+
return cachedFloat64Memory0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
127
|
let cachedBigInt64Memory0 = null;
|
|
128
128
|
|
|
129
129
|
function getBigInt64Memory0() {
|
|
@@ -226,13 +226,6 @@ function __wbg_adapter_52(arg0, arg1, arg2) {
|
|
|
226
226
|
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0c6c8312617d6ad4(arg0, arg1, addHeapObject(arg2));
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
function _assertClass(instance, klass) {
|
|
230
|
-
if (!(instance instanceof klass)) {
|
|
231
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
232
|
-
}
|
|
233
|
-
return instance.ptr;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
229
|
function passArray8ToWasm0(arg, malloc) {
|
|
237
230
|
const ptr = malloc(arg.length * 1) >>> 0;
|
|
238
231
|
getUint8Memory0().set(arg, ptr / 1);
|
|
@@ -240,6 +233,117 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
240
233
|
return ptr;
|
|
241
234
|
}
|
|
242
235
|
/**
|
|
236
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
237
|
+
*
|
|
238
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
239
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
240
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
241
|
+
* @param {Uint8Array} circuit
|
|
242
|
+
* @param {WitnessMap} solved_witness
|
|
243
|
+
* @returns {WitnessMap}
|
|
244
|
+
*/
|
|
245
|
+
export function getPublicWitness(circuit, solved_witness) {
|
|
246
|
+
try {
|
|
247
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
248
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
249
|
+
const len0 = WASM_VECTOR_LEN;
|
|
250
|
+
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
251
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
252
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
253
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
254
|
+
if (r2) {
|
|
255
|
+
throw takeObject(r1);
|
|
256
|
+
}
|
|
257
|
+
return takeObject(r0);
|
|
258
|
+
} finally {
|
|
259
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
265
|
+
*
|
|
266
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
267
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
268
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
269
|
+
* @param {Uint8Array} circuit
|
|
270
|
+
* @param {WitnessMap} solved_witness
|
|
271
|
+
* @returns {WitnessMap}
|
|
272
|
+
*/
|
|
273
|
+
export function getPublicParametersWitness(circuit, solved_witness) {
|
|
274
|
+
try {
|
|
275
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
276
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
277
|
+
const len0 = WASM_VECTOR_LEN;
|
|
278
|
+
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
279
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
280
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
281
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
282
|
+
if (r2) {
|
|
283
|
+
throw takeObject(r1);
|
|
284
|
+
}
|
|
285
|
+
return takeObject(r0);
|
|
286
|
+
} finally {
|
|
287
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
293
|
+
*
|
|
294
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
295
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
296
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
297
|
+
* @param {Uint8Array} circuit
|
|
298
|
+
* @param {WitnessMap} witness_map
|
|
299
|
+
* @returns {WitnessMap}
|
|
300
|
+
*/
|
|
301
|
+
export function getReturnWitness(circuit, witness_map) {
|
|
302
|
+
try {
|
|
303
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
304
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
305
|
+
const len0 = WASM_VECTOR_LEN;
|
|
306
|
+
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
307
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
308
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
309
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
310
|
+
if (r2) {
|
|
311
|
+
throw takeObject(r1);
|
|
312
|
+
}
|
|
313
|
+
return takeObject(r0);
|
|
314
|
+
} finally {
|
|
315
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Sets the package's logging level.
|
|
321
|
+
*
|
|
322
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
323
|
+
*/
|
|
324
|
+
export function initLogLevel(filter) {
|
|
325
|
+
try {
|
|
326
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
327
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
328
|
+
const len0 = WASM_VECTOR_LEN;
|
|
329
|
+
wasm.initLogLevel(retptr, ptr0, len0);
|
|
330
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
331
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
332
|
+
if (r1) {
|
|
333
|
+
throw takeObject(r0);
|
|
334
|
+
}
|
|
335
|
+
} finally {
|
|
336
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
function _assertClass(instance, klass) {
|
|
341
|
+
if (!(instance instanceof klass)) {
|
|
342
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
343
|
+
}
|
|
344
|
+
return instance.ptr;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
243
347
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
244
348
|
*
|
|
245
349
|
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
@@ -410,17 +514,6 @@ export function and(lhs, rhs) {
|
|
|
410
514
|
return takeObject(ret);
|
|
411
515
|
}
|
|
412
516
|
|
|
413
|
-
/**
|
|
414
|
-
* Sets the package's logging level.
|
|
415
|
-
*
|
|
416
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
417
|
-
*/
|
|
418
|
-
export function initLogLevel(filter) {
|
|
419
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
420
|
-
const len0 = WASM_VECTOR_LEN;
|
|
421
|
-
wasm.initLogLevel(ptr0, len0);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
517
|
/**
|
|
425
518
|
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
426
519
|
*
|
|
@@ -479,90 +572,6 @@ export function buildInfo() {
|
|
|
479
572
|
return takeObject(ret);
|
|
480
573
|
}
|
|
481
574
|
|
|
482
|
-
/**
|
|
483
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
484
|
-
*
|
|
485
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
486
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
487
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
488
|
-
* @param {Uint8Array} circuit
|
|
489
|
-
* @param {WitnessMap} solved_witness
|
|
490
|
-
* @returns {WitnessMap}
|
|
491
|
-
*/
|
|
492
|
-
export function getPublicWitness(circuit, solved_witness) {
|
|
493
|
-
try {
|
|
494
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
495
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
496
|
-
const len0 = WASM_VECTOR_LEN;
|
|
497
|
-
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
498
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
499
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
500
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
501
|
-
if (r2) {
|
|
502
|
-
throw takeObject(r1);
|
|
503
|
-
}
|
|
504
|
-
return takeObject(r0);
|
|
505
|
-
} finally {
|
|
506
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
/**
|
|
511
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
512
|
-
*
|
|
513
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
514
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
515
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
516
|
-
* @param {Uint8Array} circuit
|
|
517
|
-
* @param {WitnessMap} solved_witness
|
|
518
|
-
* @returns {WitnessMap}
|
|
519
|
-
*/
|
|
520
|
-
export function getPublicParametersWitness(circuit, solved_witness) {
|
|
521
|
-
try {
|
|
522
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
523
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
524
|
-
const len0 = WASM_VECTOR_LEN;
|
|
525
|
-
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
526
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
527
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
528
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
529
|
-
if (r2) {
|
|
530
|
-
throw takeObject(r1);
|
|
531
|
-
}
|
|
532
|
-
return takeObject(r0);
|
|
533
|
-
} finally {
|
|
534
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
/**
|
|
539
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
540
|
-
*
|
|
541
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
542
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
543
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
544
|
-
* @param {Uint8Array} circuit
|
|
545
|
-
* @param {WitnessMap} witness_map
|
|
546
|
-
* @returns {WitnessMap}
|
|
547
|
-
*/
|
|
548
|
-
export function getReturnWitness(circuit, witness_map) {
|
|
549
|
-
try {
|
|
550
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
551
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
552
|
-
const len0 = WASM_VECTOR_LEN;
|
|
553
|
-
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
554
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
555
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
556
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
557
|
-
if (r2) {
|
|
558
|
-
throw takeObject(r1);
|
|
559
|
-
}
|
|
560
|
-
return takeObject(r0);
|
|
561
|
-
} finally {
|
|
562
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
|
|
566
575
|
function handleError(f, args) {
|
|
567
576
|
try {
|
|
568
577
|
return f.apply(this, args);
|
|
@@ -672,25 +681,15 @@ function __wbg_get_imports() {
|
|
|
672
681
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
673
682
|
return addHeapObject(ret);
|
|
674
683
|
};
|
|
675
|
-
imports.wbg.
|
|
676
|
-
const
|
|
677
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
678
|
-
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
679
|
-
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
680
|
-
};
|
|
681
|
-
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
682
|
-
const ret = getObject(arg0);
|
|
683
|
-
return addHeapObject(ret);
|
|
684
|
-
};
|
|
685
|
-
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
686
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
684
|
+
imports.wbg.__wbg_constructor_8444207292d12e94 = function(arg0) {
|
|
685
|
+
const ret = new Error(takeObject(arg0));
|
|
687
686
|
return addHeapObject(ret);
|
|
688
687
|
};
|
|
689
688
|
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
690
689
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
691
690
|
return ret;
|
|
692
691
|
};
|
|
693
|
-
imports.wbg.
|
|
692
|
+
imports.wbg.__wbg_new_12499e712355d566 = function() {
|
|
694
693
|
const ret = new Map();
|
|
695
694
|
return addHeapObject(ret);
|
|
696
695
|
};
|
|
@@ -706,6 +705,20 @@ function __wbg_get_imports() {
|
|
|
706
705
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
707
706
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
708
707
|
};
|
|
708
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
709
|
+
const obj = getObject(arg1);
|
|
710
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
711
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
712
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
713
|
+
};
|
|
714
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
715
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
716
|
+
return addHeapObject(ret);
|
|
717
|
+
};
|
|
718
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
719
|
+
const ret = getObject(arg0);
|
|
720
|
+
return addHeapObject(ret);
|
|
721
|
+
};
|
|
709
722
|
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
710
723
|
const obj = takeObject(arg0).original;
|
|
711
724
|
if (obj.cnt-- == 1) {
|
|
@@ -715,10 +728,6 @@ function __wbg_get_imports() {
|
|
|
715
728
|
const ret = false;
|
|
716
729
|
return ret;
|
|
717
730
|
};
|
|
718
|
-
imports.wbg.__wbg_constructor_6648e7ae005cd460 = function(arg0) {
|
|
719
|
-
const ret = new Error(takeObject(arg0));
|
|
720
|
-
return addHeapObject(ret);
|
|
721
|
-
};
|
|
722
731
|
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
723
732
|
const ret = getObject(arg0) === undefined;
|
|
724
733
|
return ret;
|
|
@@ -1147,8 +1156,8 @@ function __wbg_get_imports() {
|
|
|
1147
1156
|
const ret = wasm.__wbindgen_export_2;
|
|
1148
1157
|
return addHeapObject(ret);
|
|
1149
1158
|
};
|
|
1150
|
-
imports.wbg.
|
|
1151
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1159
|
+
imports.wbg.__wbindgen_closure_wrapper1433 = function(arg0, arg1, arg2) {
|
|
1160
|
+
const ret = makeMutClosure(arg0, arg1, 501, __wbg_adapter_52);
|
|
1152
1161
|
return addHeapObject(ret);
|
|
1153
1162
|
};
|
|
1154
1163
|
|
package/web/acvm_js_bg.wasm
CHANGED
|
Binary file
|
package/web/acvm_js_bg.wasm.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
5
|
+
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
6
|
+
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
7
|
+
export function initLogLevel(a: number, b: number, c: number): void;
|
|
4
8
|
export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
|
|
5
9
|
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
6
10
|
export function createBlackBoxSolver(): number;
|
|
@@ -12,13 +16,9 @@ export function blake2s256(a: number, b: number, c: number): void;
|
|
|
12
16
|
export function sha256(a: number, b: number, c: number): void;
|
|
13
17
|
export function xor(a: number, b: number): number;
|
|
14
18
|
export function and(a: number, b: number): number;
|
|
15
|
-
export function initLogLevel(a: number, b: number): void;
|
|
16
19
|
export function decompressWitness(a: number, b: number, c: number): void;
|
|
17
20
|
export function compressWitness(a: number, b: number): void;
|
|
18
21
|
export function buildInfo(): number;
|
|
19
|
-
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
20
|
-
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
21
|
-
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
22
22
|
export function __wbg_trap_free(a: number): void;
|
|
23
23
|
export function trap___wbg_wasmer_trap(): void;
|
|
24
24
|
export function __wbindgen_malloc(a: number): number;
|