@noir-lang/acvm_js 0.51.0-2a0d211.nightly → 0.51.0-8232bfa.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 +67 -67
- package/nodejs/acvm_js.js +146 -146
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +4 -4
- package/package.json +1 -1
- package/web/acvm_js.d.ts +71 -71
- package/web/acvm_js.js +143 -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,44 @@
|
|
|
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
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
10
|
+
*
|
|
11
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
12
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
13
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
14
|
+
* @param {Uint8Array} program
|
|
15
|
+
* @param {WitnessMap} witness_map
|
|
16
|
+
* @returns {WitnessMap}
|
|
17
|
+
*/
|
|
18
|
+
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
19
|
+
/**
|
|
20
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
21
|
+
*
|
|
22
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
23
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
24
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
25
|
+
* @param {Uint8Array} program
|
|
26
|
+
* @param {WitnessMap} solved_witness
|
|
27
|
+
* @returns {WitnessMap}
|
|
28
|
+
*/
|
|
29
|
+
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
30
|
+
/**
|
|
31
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
32
|
+
*
|
|
33
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
34
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
35
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
36
|
+
* @param {Uint8Array} program
|
|
37
|
+
* @param {WitnessMap} solved_witness
|
|
38
|
+
* @returns {WitnessMap}
|
|
39
|
+
*/
|
|
40
|
+
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
41
|
+
/**
|
|
4
42
|
* Sets the package's logging level.
|
|
5
43
|
*
|
|
6
44
|
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
@@ -114,73 +152,6 @@ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
|
114
152
|
* @returns {WitnessStack} The decompressed witness stack.
|
|
115
153
|
*/
|
|
116
154
|
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
117
|
-
/**
|
|
118
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
119
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
120
|
-
*/
|
|
121
|
-
export function buildInfo(): BuildInfo;
|
|
122
|
-
/**
|
|
123
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
124
|
-
*
|
|
125
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
126
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
127
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
128
|
-
* @param {Uint8Array} program
|
|
129
|
-
* @param {WitnessMap} witness_map
|
|
130
|
-
* @returns {WitnessMap}
|
|
131
|
-
*/
|
|
132
|
-
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
133
|
-
/**
|
|
134
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
135
|
-
*
|
|
136
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
137
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
138
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
139
|
-
* @param {Uint8Array} program
|
|
140
|
-
* @param {WitnessMap} solved_witness
|
|
141
|
-
* @returns {WitnessMap}
|
|
142
|
-
*/
|
|
143
|
-
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
144
|
-
/**
|
|
145
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
146
|
-
*
|
|
147
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
148
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
149
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
150
|
-
* @param {Uint8Array} program
|
|
151
|
-
* @param {WitnessMap} solved_witness
|
|
152
|
-
* @returns {WitnessMap}
|
|
153
|
-
*/
|
|
154
|
-
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
155
|
-
|
|
156
|
-
// Map from witness index to hex string value of witness.
|
|
157
|
-
export type WitnessMap = Map<number, string>;
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* An execution result containing two witnesses.
|
|
161
|
-
* 1. The full solved witness of the execution.
|
|
162
|
-
* 2. The return witness which contains the given public return values within the full witness.
|
|
163
|
-
*/
|
|
164
|
-
export type SolvedAndReturnWitness = {
|
|
165
|
-
solvedWitness: WitnessMap;
|
|
166
|
-
returnWitness: WitnessMap;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
export type ForeignCallInput = string[]
|
|
172
|
-
export type ForeignCallOutput = string | string[]
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* A callback which performs an foreign call and returns the response.
|
|
176
|
-
* @callback ForeignCallHandler
|
|
177
|
-
* @param {string} name - The identifier for the type of foreign call being performed.
|
|
178
|
-
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
|
|
179
|
-
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
|
|
180
|
-
*/
|
|
181
|
-
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
182
|
-
|
|
183
|
-
|
|
184
155
|
|
|
185
156
|
/**
|
|
186
157
|
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
@@ -217,3 +188,32 @@ export type StackItem = {
|
|
|
217
188
|
export type WitnessStack = Array<StackItem>;
|
|
218
189
|
|
|
219
190
|
|
|
191
|
+
|
|
192
|
+
// Map from witness index to hex string value of witness.
|
|
193
|
+
export type WitnessMap = Map<number, string>;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* An execution result containing two witnesses.
|
|
197
|
+
* 1. The full solved witness of the execution.
|
|
198
|
+
* 2. The return witness which contains the given public return values within the full witness.
|
|
199
|
+
*/
|
|
200
|
+
export type SolvedAndReturnWitness = {
|
|
201
|
+
solvedWitness: WitnessMap;
|
|
202
|
+
returnWitness: WitnessMap;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
export type ForeignCallInput = string[]
|
|
208
|
+
export type ForeignCallOutput = string | string[]
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* A callback which performs an foreign call and returns the response.
|
|
212
|
+
* @callback ForeignCallHandler
|
|
213
|
+
* @param {string} name - The identifier for the type of foreign call being performed.
|
|
214
|
+
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
|
|
215
|
+
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
|
|
216
|
+
*/
|
|
217
|
+
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
218
|
+
|
|
219
|
+
|
package/nodejs/acvm_js.js
CHANGED
|
@@ -23,26 +23,22 @@ function takeObject(idx) {
|
|
|
23
23
|
return ret;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
return x === undefined || x === null;
|
|
28
|
-
}
|
|
26
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
cachedTextDecoder.decode();
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
let cachedUint8Memory0 = null;
|
|
31
|
+
|
|
32
|
+
function getUint8Memory0() {
|
|
33
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
34
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return cachedUint8Memory0;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
43
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
44
|
-
}
|
|
45
|
-
return cachedInt32Memory0;
|
|
39
|
+
function getStringFromWasm0(ptr, len) {
|
|
40
|
+
ptr = ptr >>> 0;
|
|
41
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
46
42
|
}
|
|
47
43
|
|
|
48
44
|
function addHeapObject(obj) {
|
|
@@ -54,22 +50,26 @@ function addHeapObject(obj) {
|
|
|
54
50
|
return idx;
|
|
55
51
|
}
|
|
56
52
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
function isLikeNone(x) {
|
|
54
|
+
return x === undefined || x === null;
|
|
55
|
+
}
|
|
60
56
|
|
|
61
|
-
let
|
|
57
|
+
let cachedFloat64Memory0 = null;
|
|
62
58
|
|
|
63
|
-
function
|
|
64
|
-
if (
|
|
65
|
-
|
|
59
|
+
function getFloat64Memory0() {
|
|
60
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
61
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
66
62
|
}
|
|
67
|
-
return
|
|
63
|
+
return cachedFloat64Memory0;
|
|
68
64
|
}
|
|
69
65
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
73
|
}
|
|
74
74
|
|
|
75
75
|
let WASM_VECTOR_LEN = 0;
|
|
@@ -220,6 +220,105 @@ 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__h21c8ca3eb6ab9385(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 passArray8ToWasm0(arg, malloc) {
|
|
233
|
+
const ptr = malloc(arg.length * 1) >>> 0;
|
|
234
|
+
getUint8Memory0().set(arg, ptr / 1);
|
|
235
|
+
WASM_VECTOR_LEN = arg.length;
|
|
236
|
+
return ptr;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
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 return values.
|
|
244
|
+
* @param {Uint8Array} program
|
|
245
|
+
* @param {WitnessMap} witness_map
|
|
246
|
+
* @returns {WitnessMap}
|
|
247
|
+
*/
|
|
248
|
+
module.exports.getReturnWitness = function(program, witness_map) {
|
|
249
|
+
try {
|
|
250
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
251
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
252
|
+
const len0 = WASM_VECTOR_LEN;
|
|
253
|
+
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
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} program
|
|
273
|
+
* @param {WitnessMap} solved_witness
|
|
274
|
+
* @returns {WitnessMap}
|
|
275
|
+
*/
|
|
276
|
+
module.exports.getPublicParametersWitness = function(program, solved_witness) {
|
|
277
|
+
try {
|
|
278
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
279
|
+
const ptr0 = passArray8ToWasm0(program, 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 public inputs.
|
|
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 public inputs.
|
|
300
|
+
* @param {Uint8Array} program
|
|
301
|
+
* @param {WitnessMap} solved_witness
|
|
302
|
+
* @returns {WitnessMap}
|
|
303
|
+
*/
|
|
304
|
+
module.exports.getPublicWitness = function(program, solved_witness) {
|
|
305
|
+
try {
|
|
306
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
307
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
308
|
+
const len0 = WASM_VECTOR_LEN;
|
|
309
|
+
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
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
|
+
|
|
223
322
|
/**
|
|
224
323
|
* Sets the package's logging level.
|
|
225
324
|
*
|
|
@@ -241,12 +340,6 @@ module.exports.initLogLevel = function(filter) {
|
|
|
241
340
|
}
|
|
242
341
|
};
|
|
243
342
|
|
|
244
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
245
|
-
const ptr = malloc(arg.length * 1) >>> 0;
|
|
246
|
-
getUint8Memory0().set(arg, ptr / 1);
|
|
247
|
-
WASM_VECTOR_LEN = arg.length;
|
|
248
|
-
return ptr;
|
|
249
|
-
}
|
|
250
343
|
/**
|
|
251
344
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
252
345
|
*
|
|
@@ -546,99 +639,6 @@ module.exports.decompressWitnessStack = function(compressed_witness) {
|
|
|
546
639
|
}
|
|
547
640
|
};
|
|
548
641
|
|
|
549
|
-
/**
|
|
550
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
551
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
552
|
-
*/
|
|
553
|
-
module.exports.buildInfo = function() {
|
|
554
|
-
const ret = wasm.buildInfo();
|
|
555
|
-
return takeObject(ret);
|
|
556
|
-
};
|
|
557
|
-
|
|
558
|
-
/**
|
|
559
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
560
|
-
*
|
|
561
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
562
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
563
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
564
|
-
* @param {Uint8Array} program
|
|
565
|
-
* @param {WitnessMap} witness_map
|
|
566
|
-
* @returns {WitnessMap}
|
|
567
|
-
*/
|
|
568
|
-
module.exports.getReturnWitness = function(program, witness_map) {
|
|
569
|
-
try {
|
|
570
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
571
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
572
|
-
const len0 = WASM_VECTOR_LEN;
|
|
573
|
-
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
574
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
575
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
576
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
577
|
-
if (r2) {
|
|
578
|
-
throw takeObject(r1);
|
|
579
|
-
}
|
|
580
|
-
return takeObject(r0);
|
|
581
|
-
} finally {
|
|
582
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
583
|
-
}
|
|
584
|
-
};
|
|
585
|
-
|
|
586
|
-
/**
|
|
587
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
588
|
-
*
|
|
589
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
590
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
591
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
592
|
-
* @param {Uint8Array} program
|
|
593
|
-
* @param {WitnessMap} solved_witness
|
|
594
|
-
* @returns {WitnessMap}
|
|
595
|
-
*/
|
|
596
|
-
module.exports.getPublicParametersWitness = function(program, solved_witness) {
|
|
597
|
-
try {
|
|
598
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
599
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
600
|
-
const len0 = WASM_VECTOR_LEN;
|
|
601
|
-
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
602
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
603
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
604
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
605
|
-
if (r2) {
|
|
606
|
-
throw takeObject(r1);
|
|
607
|
-
}
|
|
608
|
-
return takeObject(r0);
|
|
609
|
-
} finally {
|
|
610
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
611
|
-
}
|
|
612
|
-
};
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
616
|
-
*
|
|
617
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
618
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
619
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
620
|
-
* @param {Uint8Array} program
|
|
621
|
-
* @param {WitnessMap} solved_witness
|
|
622
|
-
* @returns {WitnessMap}
|
|
623
|
-
*/
|
|
624
|
-
module.exports.getPublicWitness = function(program, solved_witness) {
|
|
625
|
-
try {
|
|
626
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
627
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
628
|
-
const len0 = WASM_VECTOR_LEN;
|
|
629
|
-
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
630
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
631
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
632
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
633
|
-
if (r2) {
|
|
634
|
-
throw takeObject(r1);
|
|
635
|
-
}
|
|
636
|
-
return takeObject(r0);
|
|
637
|
-
} finally {
|
|
638
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
639
|
-
}
|
|
640
|
-
};
|
|
641
|
-
|
|
642
642
|
function __wbg_adapter_76(arg0, arg1, arg2, arg3, arg4) {
|
|
643
643
|
wasm.wasm_bindgen__convert__closures__invoke3_mut__h17fc532521b46256(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
|
|
644
644
|
}
|
|
@@ -664,19 +664,22 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
|
664
664
|
return ret;
|
|
665
665
|
};
|
|
666
666
|
|
|
667
|
-
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
668
|
-
const obj = getObject(arg1);
|
|
669
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
670
|
-
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
671
|
-
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
672
|
-
};
|
|
673
|
-
|
|
674
667
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
675
668
|
takeObject(arg0);
|
|
676
669
|
};
|
|
677
670
|
|
|
678
|
-
module.exports.
|
|
679
|
-
const ret = new
|
|
671
|
+
module.exports.__wbg_constructor_f4bcf4c70838c703 = function(arg0) {
|
|
672
|
+
const ret = new Error(takeObject(arg0));
|
|
673
|
+
return addHeapObject(ret);
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
677
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
678
|
+
return addHeapObject(ret);
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
module.exports.__wbg_new_e14625531a95427d = function() {
|
|
682
|
+
const ret = new Array();
|
|
680
683
|
return addHeapObject(ret);
|
|
681
684
|
};
|
|
682
685
|
|
|
@@ -685,8 +688,15 @@ module.exports.__wbindgen_number_new = function(arg0) {
|
|
|
685
688
|
return addHeapObject(ret);
|
|
686
689
|
};
|
|
687
690
|
|
|
688
|
-
module.exports.
|
|
689
|
-
const
|
|
691
|
+
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
692
|
+
const obj = getObject(arg1);
|
|
693
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
694
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
695
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
696
|
+
};
|
|
697
|
+
|
|
698
|
+
module.exports.__wbg_new_3b3e21164d5381ca = function() {
|
|
699
|
+
const ret = new Map();
|
|
690
700
|
return addHeapObject(ret);
|
|
691
701
|
};
|
|
692
702
|
|
|
@@ -699,11 +709,6 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
|
699
709
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
700
710
|
};
|
|
701
711
|
|
|
702
|
-
module.exports.__wbg_constructor_f4bcf4c70838c703 = function(arg0) {
|
|
703
|
-
const ret = new Error(takeObject(arg0));
|
|
704
|
-
return addHeapObject(ret);
|
|
705
|
-
};
|
|
706
|
-
|
|
707
712
|
module.exports.__wbindgen_is_array = function(arg0) {
|
|
708
713
|
const ret = Array.isArray(getObject(arg0));
|
|
709
714
|
return ret;
|
|
@@ -714,11 +719,6 @@ module.exports.__wbindgen_is_string = function(arg0) {
|
|
|
714
719
|
return ret;
|
|
715
720
|
};
|
|
716
721
|
|
|
717
|
-
module.exports.__wbg_new_e14625531a95427d = function() {
|
|
718
|
-
const ret = new Array();
|
|
719
|
-
return addHeapObject(ret);
|
|
720
|
-
};
|
|
721
|
-
|
|
722
722
|
module.exports.__wbg_new_abda76e883ba8a5f = function() {
|
|
723
723
|
const ret = new Error();
|
|
724
724
|
return addHeapObject(ret);
|
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 buildInfo(): number;
|
|
5
|
+
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
6
|
+
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
7
|
+
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
4
8
|
export function initLogLevel(a: number, b: number, c: number): void;
|
|
5
9
|
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
6
10
|
export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number;
|
|
@@ -16,10 +20,6 @@ export function compressWitness(a: number, b: number): void;
|
|
|
16
20
|
export function decompressWitness(a: number, b: number, c: number): void;
|
|
17
21
|
export function compressWitnessStack(a: number, b: number): void;
|
|
18
22
|
export function decompressWitnessStack(a: number, b: number, c: number): void;
|
|
19
|
-
export function buildInfo(): number;
|
|
20
|
-
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
21
|
-
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
22
|
-
export function getPublicWitness(a: number, b: number, c: number, d: 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,44 @@
|
|
|
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
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
10
|
+
*
|
|
11
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
12
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
13
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
14
|
+
* @param {Uint8Array} program
|
|
15
|
+
* @param {WitnessMap} witness_map
|
|
16
|
+
* @returns {WitnessMap}
|
|
17
|
+
*/
|
|
18
|
+
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
19
|
+
/**
|
|
20
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
21
|
+
*
|
|
22
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
23
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
24
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
25
|
+
* @param {Uint8Array} program
|
|
26
|
+
* @param {WitnessMap} solved_witness
|
|
27
|
+
* @returns {WitnessMap}
|
|
28
|
+
*/
|
|
29
|
+
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
30
|
+
/**
|
|
31
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
32
|
+
*
|
|
33
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
34
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
35
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
36
|
+
* @param {Uint8Array} program
|
|
37
|
+
* @param {WitnessMap} solved_witness
|
|
38
|
+
* @returns {WitnessMap}
|
|
39
|
+
*/
|
|
40
|
+
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
41
|
+
/**
|
|
4
42
|
* Sets the package's logging level.
|
|
5
43
|
*
|
|
6
44
|
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
@@ -114,73 +152,6 @@ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
|
114
152
|
* @returns {WitnessStack} The decompressed witness stack.
|
|
115
153
|
*/
|
|
116
154
|
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
117
|
-
/**
|
|
118
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
119
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
120
|
-
*/
|
|
121
|
-
export function buildInfo(): BuildInfo;
|
|
122
|
-
/**
|
|
123
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
124
|
-
*
|
|
125
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
126
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
127
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
128
|
-
* @param {Uint8Array} program
|
|
129
|
-
* @param {WitnessMap} witness_map
|
|
130
|
-
* @returns {WitnessMap}
|
|
131
|
-
*/
|
|
132
|
-
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
133
|
-
/**
|
|
134
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
135
|
-
*
|
|
136
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
137
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
138
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
139
|
-
* @param {Uint8Array} program
|
|
140
|
-
* @param {WitnessMap} solved_witness
|
|
141
|
-
* @returns {WitnessMap}
|
|
142
|
-
*/
|
|
143
|
-
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
144
|
-
/**
|
|
145
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
146
|
-
*
|
|
147
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
148
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
149
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
150
|
-
* @param {Uint8Array} program
|
|
151
|
-
* @param {WitnessMap} solved_witness
|
|
152
|
-
* @returns {WitnessMap}
|
|
153
|
-
*/
|
|
154
|
-
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
155
|
-
|
|
156
|
-
// Map from witness index to hex string value of witness.
|
|
157
|
-
export type WitnessMap = Map<number, string>;
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* An execution result containing two witnesses.
|
|
161
|
-
* 1. The full solved witness of the execution.
|
|
162
|
-
* 2. The return witness which contains the given public return values within the full witness.
|
|
163
|
-
*/
|
|
164
|
-
export type SolvedAndReturnWitness = {
|
|
165
|
-
solvedWitness: WitnessMap;
|
|
166
|
-
returnWitness: WitnessMap;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
export type ForeignCallInput = string[]
|
|
172
|
-
export type ForeignCallOutput = string | string[]
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* A callback which performs an foreign call and returns the response.
|
|
176
|
-
* @callback ForeignCallHandler
|
|
177
|
-
* @param {string} name - The identifier for the type of foreign call being performed.
|
|
178
|
-
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
|
|
179
|
-
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
|
|
180
|
-
*/
|
|
181
|
-
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
182
|
-
|
|
183
|
-
|
|
184
155
|
|
|
185
156
|
/**
|
|
186
157
|
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
@@ -218,10 +189,43 @@ export type WitnessStack = Array<StackItem>;
|
|
|
218
189
|
|
|
219
190
|
|
|
220
191
|
|
|
192
|
+
// Map from witness index to hex string value of witness.
|
|
193
|
+
export type WitnessMap = Map<number, string>;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* An execution result containing two witnesses.
|
|
197
|
+
* 1. The full solved witness of the execution.
|
|
198
|
+
* 2. The return witness which contains the given public return values within the full witness.
|
|
199
|
+
*/
|
|
200
|
+
export type SolvedAndReturnWitness = {
|
|
201
|
+
solvedWitness: WitnessMap;
|
|
202
|
+
returnWitness: WitnessMap;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
export type ForeignCallInput = string[]
|
|
208
|
+
export type ForeignCallOutput = string | string[]
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* A callback which performs an foreign call and returns the response.
|
|
212
|
+
* @callback ForeignCallHandler
|
|
213
|
+
* @param {string} name - The identifier for the type of foreign call being performed.
|
|
214
|
+
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
|
|
215
|
+
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
|
|
216
|
+
*/
|
|
217
|
+
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
221
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
222
222
|
|
|
223
223
|
export interface InitOutput {
|
|
224
224
|
readonly memory: WebAssembly.Memory;
|
|
225
|
+
readonly buildInfo: () => number;
|
|
226
|
+
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
227
|
+
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
228
|
+
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
225
229
|
readonly initLogLevel: (a: number, b: number, c: number) => void;
|
|
226
230
|
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
|
|
227
231
|
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: number, d: number) => number;
|
|
@@ -237,10 +241,6 @@ export interface InitOutput {
|
|
|
237
241
|
readonly decompressWitness: (a: number, b: number, c: number) => void;
|
|
238
242
|
readonly compressWitnessStack: (a: number, b: number) => void;
|
|
239
243
|
readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
|
|
240
|
-
readonly buildInfo: () => number;
|
|
241
|
-
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
242
|
-
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
243
|
-
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
244
244
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
245
245
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
246
246
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
package/web/acvm_js.js
CHANGED
|
@@ -20,26 +20,22 @@ function takeObject(idx) {
|
|
|
20
20
|
return ret;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
return x === undefined || x === null;
|
|
25
|
-
}
|
|
23
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
let cachedUint8Memory0 = null;
|
|
28
|
+
|
|
29
|
+
function getUint8Memory0() {
|
|
30
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
31
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
32
32
|
}
|
|
33
|
-
return
|
|
33
|
+
return cachedUint8Memory0;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
40
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
41
|
-
}
|
|
42
|
-
return cachedInt32Memory0;
|
|
36
|
+
function getStringFromWasm0(ptr, len) {
|
|
37
|
+
ptr = ptr >>> 0;
|
|
38
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
43
39
|
}
|
|
44
40
|
|
|
45
41
|
function addHeapObject(obj) {
|
|
@@ -51,22 +47,26 @@ function addHeapObject(obj) {
|
|
|
51
47
|
return idx;
|
|
52
48
|
}
|
|
53
49
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
function isLikeNone(x) {
|
|
51
|
+
return x === undefined || x === null;
|
|
52
|
+
}
|
|
57
53
|
|
|
58
|
-
let
|
|
54
|
+
let cachedFloat64Memory0 = null;
|
|
59
55
|
|
|
60
|
-
function
|
|
61
|
-
if (
|
|
62
|
-
|
|
56
|
+
function getFloat64Memory0() {
|
|
57
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
58
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
63
59
|
}
|
|
64
|
-
return
|
|
60
|
+
return cachedFloat64Memory0;
|
|
65
61
|
}
|
|
66
62
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
70
|
}
|
|
71
71
|
|
|
72
72
|
let WASM_VECTOR_LEN = 0;
|
|
@@ -217,6 +217,105 @@ 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__h21c8ca3eb6ab9385(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 passArray8ToWasm0(arg, malloc) {
|
|
230
|
+
const ptr = malloc(arg.length * 1) >>> 0;
|
|
231
|
+
getUint8Memory0().set(arg, ptr / 1);
|
|
232
|
+
WASM_VECTOR_LEN = arg.length;
|
|
233
|
+
return ptr;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
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 return values.
|
|
241
|
+
* @param {Uint8Array} program
|
|
242
|
+
* @param {WitnessMap} witness_map
|
|
243
|
+
* @returns {WitnessMap}
|
|
244
|
+
*/
|
|
245
|
+
export function getReturnWitness(program, witness_map) {
|
|
246
|
+
try {
|
|
247
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
248
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
249
|
+
const len0 = WASM_VECTOR_LEN;
|
|
250
|
+
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
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} program
|
|
270
|
+
* @param {WitnessMap} solved_witness
|
|
271
|
+
* @returns {WitnessMap}
|
|
272
|
+
*/
|
|
273
|
+
export function getPublicParametersWitness(program, solved_witness) {
|
|
274
|
+
try {
|
|
275
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
276
|
+
const ptr0 = passArray8ToWasm0(program, 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 public inputs.
|
|
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 public inputs.
|
|
297
|
+
* @param {Uint8Array} program
|
|
298
|
+
* @param {WitnessMap} solved_witness
|
|
299
|
+
* @returns {WitnessMap}
|
|
300
|
+
*/
|
|
301
|
+
export function getPublicWitness(program, solved_witness) {
|
|
302
|
+
try {
|
|
303
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
304
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
305
|
+
const len0 = WASM_VECTOR_LEN;
|
|
306
|
+
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
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
|
+
|
|
220
319
|
/**
|
|
221
320
|
* Sets the package's logging level.
|
|
222
321
|
*
|
|
@@ -238,12 +337,6 @@ export function initLogLevel(filter) {
|
|
|
238
337
|
}
|
|
239
338
|
}
|
|
240
339
|
|
|
241
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
242
|
-
const ptr = malloc(arg.length * 1) >>> 0;
|
|
243
|
-
getUint8Memory0().set(arg, ptr / 1);
|
|
244
|
-
WASM_VECTOR_LEN = arg.length;
|
|
245
|
-
return ptr;
|
|
246
|
-
}
|
|
247
340
|
/**
|
|
248
341
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
249
342
|
*
|
|
@@ -543,99 +636,6 @@ export function decompressWitnessStack(compressed_witness) {
|
|
|
543
636
|
}
|
|
544
637
|
}
|
|
545
638
|
|
|
546
|
-
/**
|
|
547
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
548
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
549
|
-
*/
|
|
550
|
-
export function buildInfo() {
|
|
551
|
-
const ret = wasm.buildInfo();
|
|
552
|
-
return takeObject(ret);
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
/**
|
|
556
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
557
|
-
*
|
|
558
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
559
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
560
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
561
|
-
* @param {Uint8Array} program
|
|
562
|
-
* @param {WitnessMap} witness_map
|
|
563
|
-
* @returns {WitnessMap}
|
|
564
|
-
*/
|
|
565
|
-
export function getReturnWitness(program, witness_map) {
|
|
566
|
-
try {
|
|
567
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
568
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
569
|
-
const len0 = WASM_VECTOR_LEN;
|
|
570
|
-
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
571
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
572
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
573
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
574
|
-
if (r2) {
|
|
575
|
-
throw takeObject(r1);
|
|
576
|
-
}
|
|
577
|
-
return takeObject(r0);
|
|
578
|
-
} finally {
|
|
579
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
585
|
-
*
|
|
586
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
587
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
588
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
589
|
-
* @param {Uint8Array} program
|
|
590
|
-
* @param {WitnessMap} solved_witness
|
|
591
|
-
* @returns {WitnessMap}
|
|
592
|
-
*/
|
|
593
|
-
export function getPublicParametersWitness(program, solved_witness) {
|
|
594
|
-
try {
|
|
595
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
596
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
597
|
-
const len0 = WASM_VECTOR_LEN;
|
|
598
|
-
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
599
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
600
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
601
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
602
|
-
if (r2) {
|
|
603
|
-
throw takeObject(r1);
|
|
604
|
-
}
|
|
605
|
-
return takeObject(r0);
|
|
606
|
-
} finally {
|
|
607
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
/**
|
|
612
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
613
|
-
*
|
|
614
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
615
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
616
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
617
|
-
* @param {Uint8Array} program
|
|
618
|
-
* @param {WitnessMap} solved_witness
|
|
619
|
-
* @returns {WitnessMap}
|
|
620
|
-
*/
|
|
621
|
-
export function getPublicWitness(program, solved_witness) {
|
|
622
|
-
try {
|
|
623
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
624
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
625
|
-
const len0 = WASM_VECTOR_LEN;
|
|
626
|
-
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
627
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
628
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
629
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
630
|
-
if (r2) {
|
|
631
|
-
throw takeObject(r1);
|
|
632
|
-
}
|
|
633
|
-
return takeObject(r0);
|
|
634
|
-
} finally {
|
|
635
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
|
|
639
639
|
function __wbg_adapter_76(arg0, arg1, arg2, arg3, arg4) {
|
|
640
640
|
wasm.wasm_bindgen__convert__closures__invoke3_mut__h17fc532521b46256(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
|
|
641
641
|
}
|
|
@@ -694,25 +694,33 @@ function __wbg_get_imports() {
|
|
|
694
694
|
const ret = false;
|
|
695
695
|
return ret;
|
|
696
696
|
};
|
|
697
|
-
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
698
|
-
const obj = getObject(arg1);
|
|
699
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
700
|
-
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
701
|
-
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
702
|
-
};
|
|
703
697
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
704
698
|
takeObject(arg0);
|
|
705
699
|
};
|
|
706
|
-
imports.wbg.
|
|
707
|
-
const ret = new
|
|
700
|
+
imports.wbg.__wbg_constructor_f4bcf4c70838c703 = function(arg0) {
|
|
701
|
+
const ret = new Error(takeObject(arg0));
|
|
702
|
+
return addHeapObject(ret);
|
|
703
|
+
};
|
|
704
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
705
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
706
|
+
return addHeapObject(ret);
|
|
707
|
+
};
|
|
708
|
+
imports.wbg.__wbg_new_e14625531a95427d = function() {
|
|
709
|
+
const ret = new Array();
|
|
708
710
|
return addHeapObject(ret);
|
|
709
711
|
};
|
|
710
712
|
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
711
713
|
const ret = arg0;
|
|
712
714
|
return addHeapObject(ret);
|
|
713
715
|
};
|
|
714
|
-
imports.wbg.
|
|
715
|
-
const
|
|
716
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
717
|
+
const obj = getObject(arg1);
|
|
718
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
719
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
720
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
721
|
+
};
|
|
722
|
+
imports.wbg.__wbg_new_3b3e21164d5381ca = function() {
|
|
723
|
+
const ret = new Map();
|
|
716
724
|
return addHeapObject(ret);
|
|
717
725
|
};
|
|
718
726
|
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
@@ -723,10 +731,6 @@ function __wbg_get_imports() {
|
|
|
723
731
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
724
732
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
725
733
|
};
|
|
726
|
-
imports.wbg.__wbg_constructor_f4bcf4c70838c703 = function(arg0) {
|
|
727
|
-
const ret = new Error(takeObject(arg0));
|
|
728
|
-
return addHeapObject(ret);
|
|
729
|
-
};
|
|
730
734
|
imports.wbg.__wbindgen_is_array = function(arg0) {
|
|
731
735
|
const ret = Array.isArray(getObject(arg0));
|
|
732
736
|
return ret;
|
|
@@ -735,10 +739,6 @@ function __wbg_get_imports() {
|
|
|
735
739
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
736
740
|
return ret;
|
|
737
741
|
};
|
|
738
|
-
imports.wbg.__wbg_new_e14625531a95427d = function() {
|
|
739
|
-
const ret = new Array();
|
|
740
|
-
return addHeapObject(ret);
|
|
741
|
-
};
|
|
742
742
|
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
|
|
743
743
|
const ret = new Error();
|
|
744
744
|
return addHeapObject(ret);
|
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 buildInfo(): number;
|
|
5
|
+
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
6
|
+
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
7
|
+
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
4
8
|
export function initLogLevel(a: number, b: number, c: number): void;
|
|
5
9
|
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
6
10
|
export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number;
|
|
@@ -16,10 +20,6 @@ export function compressWitness(a: number, b: number): void;
|
|
|
16
20
|
export function decompressWitness(a: number, b: number, c: number): void;
|
|
17
21
|
export function compressWitnessStack(a: number, b: number): void;
|
|
18
22
|
export function decompressWitnessStack(a: number, b: number, c: number): void;
|
|
19
|
-
export function buildInfo(): number;
|
|
20
|
-
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
21
|
-
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
22
|
-
export function getPublicWitness(a: number, b: number, c: number, d: 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;
|