@noir-lang/acvm_js 1.0.0-beta.15-1fce7ca.nightly → 1.0.0-beta.15-d2c71c4.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 +66 -66
- package/nodejs/acvm_js.js +192 -191
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +14 -14
- package/package.json +1 -1
- package/web/acvm_js.d.ts +80 -80
- package/web/acvm_js.js +190 -189
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +14 -14
package/nodejs/acvm_js.js
CHANGED
|
@@ -201,63 +201,31 @@ function debugString(val) {
|
|
|
201
201
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
202
202
|
return className;
|
|
203
203
|
}
|
|
204
|
-
/**
|
|
205
|
-
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
206
|
-
* @param {string} lhs
|
|
207
|
-
* @param {string} rhs
|
|
208
|
-
* @returns {string}
|
|
209
|
-
*/
|
|
210
|
-
module.exports.and = function(lhs, rhs) {
|
|
211
|
-
const ret = wasm.and(lhs, rhs);
|
|
212
|
-
return ret;
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Performs a bitwise XOR operation between `lhs` and `rhs`
|
|
217
|
-
* @param {string} lhs
|
|
218
|
-
* @param {string} rhs
|
|
219
|
-
* @returns {string}
|
|
220
|
-
*/
|
|
221
|
-
module.exports.xor = function(lhs, rhs) {
|
|
222
|
-
const ret = wasm.xor(lhs, rhs);
|
|
223
|
-
return ret;
|
|
224
|
-
};
|
|
225
204
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
231
|
-
}
|
|
232
|
-
return cachedUint32ArrayMemory0;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
function passArray32ToWasm0(arg, malloc) {
|
|
236
|
-
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
237
|
-
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
238
|
-
WASM_VECTOR_LEN = arg.length;
|
|
239
|
-
return ptr;
|
|
205
|
+
function takeFromExternrefTable0(idx) {
|
|
206
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
207
|
+
wasm.__externref_table_dealloc(idx);
|
|
208
|
+
return value;
|
|
240
209
|
}
|
|
241
210
|
|
|
242
|
-
function
|
|
211
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
243
212
|
ptr = ptr >>> 0;
|
|
244
|
-
return
|
|
213
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
245
214
|
}
|
|
246
215
|
/**
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
* @param {
|
|
250
|
-
* @returns {
|
|
216
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
217
|
+
*
|
|
218
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
219
|
+
* @returns {Uint8Array} A compressed witness map
|
|
251
220
|
*/
|
|
252
|
-
module.exports.
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
return v3;
|
|
221
|
+
module.exports.compressWitness = function(witness_map) {
|
|
222
|
+
const ret = wasm.compressWitness(witness_map);
|
|
223
|
+
if (ret[3]) {
|
|
224
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
225
|
+
}
|
|
226
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
227
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
228
|
+
return v1;
|
|
261
229
|
};
|
|
262
230
|
|
|
263
231
|
function passArray8ToWasm0(arg, malloc) {
|
|
@@ -266,84 +234,99 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
266
234
|
WASM_VECTOR_LEN = arg.length;
|
|
267
235
|
return ptr;
|
|
268
236
|
}
|
|
269
|
-
|
|
270
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
271
|
-
ptr = ptr >>> 0;
|
|
272
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
273
|
-
}
|
|
274
237
|
/**
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
238
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
239
|
+
* This should be used to only fetch the witness map for the main function.
|
|
240
|
+
*
|
|
241
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
242
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
278
243
|
*/
|
|
279
|
-
module.exports.
|
|
280
|
-
const ptr0 = passArray8ToWasm0(
|
|
244
|
+
module.exports.decompressWitness = function(compressed_witness) {
|
|
245
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
281
246
|
const len0 = WASM_VECTOR_LEN;
|
|
282
|
-
const ret = wasm.
|
|
283
|
-
|
|
247
|
+
const ret = wasm.decompressWitness(ptr0, len0);
|
|
248
|
+
if (ret[2]) {
|
|
249
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
250
|
+
}
|
|
251
|
+
return takeFromExternrefTable0(ret[0]);
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
256
|
+
*
|
|
257
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
258
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
259
|
+
*/
|
|
260
|
+
module.exports.compressWitnessStack = function(witness_stack) {
|
|
261
|
+
const ret = wasm.compressWitnessStack(witness_stack);
|
|
262
|
+
if (ret[3]) {
|
|
263
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
264
|
+
}
|
|
265
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
284
266
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
285
|
-
return
|
|
267
|
+
return v1;
|
|
286
268
|
};
|
|
287
269
|
|
|
288
270
|
/**
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
* @param {Uint8Array}
|
|
292
|
-
* @
|
|
293
|
-
* @param {Uint8Array} signature
|
|
294
|
-
* @returns {boolean}
|
|
271
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
272
|
+
*
|
|
273
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
274
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
295
275
|
*/
|
|
296
|
-
module.exports.
|
|
297
|
-
const ptr0 = passArray8ToWasm0(
|
|
276
|
+
module.exports.decompressWitnessStack = function(compressed_witness) {
|
|
277
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
298
278
|
const len0 = WASM_VECTOR_LEN;
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
const len3 = WASM_VECTOR_LEN;
|
|
305
|
-
const ret = wasm.ecdsa_secp256k1_verify(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
306
|
-
return ret !== 0;
|
|
279
|
+
const ret = wasm.decompressWitnessStack(ptr0, len0);
|
|
280
|
+
if (ret[2]) {
|
|
281
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
282
|
+
}
|
|
283
|
+
return takeFromExternrefTable0(ret[0]);
|
|
307
284
|
};
|
|
308
285
|
|
|
309
286
|
/**
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
* @param {Uint8Array}
|
|
313
|
-
* @param {
|
|
314
|
-
* @param {
|
|
315
|
-
* @returns {
|
|
287
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
288
|
+
*
|
|
289
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
290
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
291
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
292
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
316
293
|
*/
|
|
317
|
-
module.exports.
|
|
318
|
-
const ptr0 = passArray8ToWasm0(
|
|
294
|
+
module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
|
|
295
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
319
296
|
const len0 = WASM_VECTOR_LEN;
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
const ptr2 = passArray8ToWasm0(public_key_y_bytes, wasm.__wbindgen_malloc);
|
|
323
|
-
const len2 = WASM_VECTOR_LEN;
|
|
324
|
-
const ptr3 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
|
|
325
|
-
const len3 = WASM_VECTOR_LEN;
|
|
326
|
-
const ret = wasm.ecdsa_secp256r1_verify(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
327
|
-
return ret !== 0;
|
|
297
|
+
const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
|
|
298
|
+
return ret;
|
|
328
299
|
};
|
|
329
300
|
|
|
330
|
-
function takeFromExternrefTable0(idx) {
|
|
331
|
-
const value = wasm.__wbindgen_export_2.get(idx);
|
|
332
|
-
wasm.__externref_table_dealloc(idx);
|
|
333
|
-
return value;
|
|
334
|
-
}
|
|
335
301
|
/**
|
|
336
|
-
*
|
|
302
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
303
|
+
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
337
304
|
*
|
|
338
|
-
* @param {
|
|
305
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
306
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
307
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
308
|
+
* @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
|
|
339
309
|
*/
|
|
340
|
-
module.exports.
|
|
341
|
-
const ptr0 =
|
|
310
|
+
module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
|
|
311
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
342
312
|
const len0 = WASM_VECTOR_LEN;
|
|
343
|
-
const ret = wasm.
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
313
|
+
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
|
|
314
|
+
return ret;
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
319
|
+
*
|
|
320
|
+
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
321
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
322
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
323
|
+
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
324
|
+
*/
|
|
325
|
+
module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
|
|
326
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
327
|
+
const len0 = WASM_VECTOR_LEN;
|
|
328
|
+
const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
|
|
329
|
+
return ret;
|
|
347
330
|
};
|
|
348
331
|
|
|
349
332
|
/**
|
|
@@ -416,126 +399,144 @@ module.exports.getPublicWitness = function(program, solved_witness) {
|
|
|
416
399
|
};
|
|
417
400
|
|
|
418
401
|
/**
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
* @param {
|
|
422
|
-
* @returns {
|
|
402
|
+
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
403
|
+
* @param {string} lhs
|
|
404
|
+
* @param {string} rhs
|
|
405
|
+
* @returns {string}
|
|
423
406
|
*/
|
|
424
|
-
module.exports.
|
|
425
|
-
const ret = wasm.
|
|
426
|
-
|
|
427
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
428
|
-
}
|
|
429
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
430
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
431
|
-
return v1;
|
|
407
|
+
module.exports.and = function(lhs, rhs) {
|
|
408
|
+
const ret = wasm.and(lhs, rhs);
|
|
409
|
+
return ret;
|
|
432
410
|
};
|
|
433
411
|
|
|
434
412
|
/**
|
|
435
|
-
*
|
|
436
|
-
*
|
|
437
|
-
*
|
|
438
|
-
* @
|
|
439
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
413
|
+
* Performs a bitwise XOR operation between `lhs` and `rhs`
|
|
414
|
+
* @param {string} lhs
|
|
415
|
+
* @param {string} rhs
|
|
416
|
+
* @returns {string}
|
|
440
417
|
*/
|
|
441
|
-
module.exports.
|
|
442
|
-
const
|
|
443
|
-
|
|
444
|
-
const ret = wasm.decompressWitness(ptr0, len0);
|
|
445
|
-
if (ret[2]) {
|
|
446
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
447
|
-
}
|
|
448
|
-
return takeFromExternrefTable0(ret[0]);
|
|
418
|
+
module.exports.xor = function(lhs, rhs) {
|
|
419
|
+
const ret = wasm.xor(lhs, rhs);
|
|
420
|
+
return ret;
|
|
449
421
|
};
|
|
450
422
|
|
|
423
|
+
let cachedUint32ArrayMemory0 = null;
|
|
424
|
+
|
|
425
|
+
function getUint32ArrayMemory0() {
|
|
426
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
427
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
428
|
+
}
|
|
429
|
+
return cachedUint32ArrayMemory0;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
433
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
434
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
435
|
+
WASM_VECTOR_LEN = arg.length;
|
|
436
|
+
return ptr;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
440
|
+
ptr = ptr >>> 0;
|
|
441
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
442
|
+
}
|
|
451
443
|
/**
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
* @param {
|
|
455
|
-
* @returns {
|
|
444
|
+
* Sha256 compression function
|
|
445
|
+
* @param {Uint32Array} inputs
|
|
446
|
+
* @param {Uint32Array} state
|
|
447
|
+
* @returns {Uint32Array}
|
|
456
448
|
*/
|
|
457
|
-
module.exports.
|
|
458
|
-
const
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
449
|
+
module.exports.sha256_compression = function(inputs, state) {
|
|
450
|
+
const ptr0 = passArray32ToWasm0(inputs, wasm.__wbindgen_malloc);
|
|
451
|
+
const len0 = WASM_VECTOR_LEN;
|
|
452
|
+
const ptr1 = passArray32ToWasm0(state, wasm.__wbindgen_malloc);
|
|
453
|
+
const len1 = WASM_VECTOR_LEN;
|
|
454
|
+
const ret = wasm.sha256_compression(ptr0, len0, ptr1, len1);
|
|
455
|
+
var v3 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
456
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
457
|
+
return v3;
|
|
465
458
|
};
|
|
466
459
|
|
|
467
460
|
/**
|
|
468
|
-
*
|
|
469
|
-
*
|
|
470
|
-
* @
|
|
471
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
461
|
+
* Calculates the Blake2s256 hash of the input bytes
|
|
462
|
+
* @param {Uint8Array} inputs
|
|
463
|
+
* @returns {Uint8Array}
|
|
472
464
|
*/
|
|
473
|
-
module.exports.
|
|
474
|
-
const ptr0 = passArray8ToWasm0(
|
|
465
|
+
module.exports.blake2s256 = function(inputs) {
|
|
466
|
+
const ptr0 = passArray8ToWasm0(inputs, wasm.__wbindgen_malloc);
|
|
475
467
|
const len0 = WASM_VECTOR_LEN;
|
|
476
|
-
const ret = wasm.
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
return takeFromExternrefTable0(ret[0]);
|
|
468
|
+
const ret = wasm.blake2s256(ptr0, len0);
|
|
469
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
470
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
471
|
+
return v2;
|
|
481
472
|
};
|
|
482
473
|
|
|
483
474
|
/**
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
* @param {Uint8Array}
|
|
487
|
-
* @param {
|
|
488
|
-
* @param {
|
|
489
|
-
* @returns {
|
|
475
|
+
* Verifies a ECDSA signature over the secp256k1 curve.
|
|
476
|
+
* @param {Uint8Array} hashed_msg
|
|
477
|
+
* @param {Uint8Array} public_key_x_bytes
|
|
478
|
+
* @param {Uint8Array} public_key_y_bytes
|
|
479
|
+
* @param {Uint8Array} signature
|
|
480
|
+
* @returns {boolean}
|
|
490
481
|
*/
|
|
491
|
-
module.exports.
|
|
492
|
-
const ptr0 = passArray8ToWasm0(
|
|
482
|
+
module.exports.ecdsa_secp256k1_verify = function(hashed_msg, public_key_x_bytes, public_key_y_bytes, signature) {
|
|
483
|
+
const ptr0 = passArray8ToWasm0(hashed_msg, wasm.__wbindgen_malloc);
|
|
493
484
|
const len0 = WASM_VECTOR_LEN;
|
|
494
|
-
const
|
|
495
|
-
|
|
485
|
+
const ptr1 = passArray8ToWasm0(public_key_x_bytes, wasm.__wbindgen_malloc);
|
|
486
|
+
const len1 = WASM_VECTOR_LEN;
|
|
487
|
+
const ptr2 = passArray8ToWasm0(public_key_y_bytes, wasm.__wbindgen_malloc);
|
|
488
|
+
const len2 = WASM_VECTOR_LEN;
|
|
489
|
+
const ptr3 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
|
|
490
|
+
const len3 = WASM_VECTOR_LEN;
|
|
491
|
+
const ret = wasm.ecdsa_secp256k1_verify(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
492
|
+
return ret !== 0;
|
|
496
493
|
};
|
|
497
494
|
|
|
498
495
|
/**
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
502
|
-
* @param {Uint8Array}
|
|
503
|
-
* @param {
|
|
504
|
-
* @
|
|
505
|
-
* @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
|
|
496
|
+
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
497
|
+
* @param {Uint8Array} hashed_msg
|
|
498
|
+
* @param {Uint8Array} public_key_x_bytes
|
|
499
|
+
* @param {Uint8Array} public_key_y_bytes
|
|
500
|
+
* @param {Uint8Array} signature
|
|
501
|
+
* @returns {boolean}
|
|
506
502
|
*/
|
|
507
|
-
module.exports.
|
|
508
|
-
const ptr0 = passArray8ToWasm0(
|
|
503
|
+
module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes, public_key_y_bytes, signature) {
|
|
504
|
+
const ptr0 = passArray8ToWasm0(hashed_msg, wasm.__wbindgen_malloc);
|
|
509
505
|
const len0 = WASM_VECTOR_LEN;
|
|
510
|
-
const
|
|
511
|
-
|
|
506
|
+
const ptr1 = passArray8ToWasm0(public_key_x_bytes, wasm.__wbindgen_malloc);
|
|
507
|
+
const len1 = WASM_VECTOR_LEN;
|
|
508
|
+
const ptr2 = passArray8ToWasm0(public_key_y_bytes, wasm.__wbindgen_malloc);
|
|
509
|
+
const len2 = WASM_VECTOR_LEN;
|
|
510
|
+
const ptr3 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
|
|
511
|
+
const len3 = WASM_VECTOR_LEN;
|
|
512
|
+
const ret = wasm.ecdsa_secp256r1_verify(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
513
|
+
return ret !== 0;
|
|
512
514
|
};
|
|
513
515
|
|
|
514
516
|
/**
|
|
515
|
-
*
|
|
517
|
+
* Sets the package's logging level.
|
|
516
518
|
*
|
|
517
|
-
* @param {
|
|
518
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
519
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
520
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
519
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
521
520
|
*/
|
|
522
|
-
module.exports.
|
|
523
|
-
const ptr0 =
|
|
521
|
+
module.exports.initLogLevel = function(filter) {
|
|
522
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
524
523
|
const len0 = WASM_VECTOR_LEN;
|
|
525
|
-
const ret = wasm.
|
|
526
|
-
|
|
524
|
+
const ret = wasm.initLogLevel(ptr0, len0);
|
|
525
|
+
if (ret[1]) {
|
|
526
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
527
|
+
}
|
|
527
528
|
};
|
|
528
529
|
|
|
529
530
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
530
|
-
wasm.
|
|
531
|
+
wasm.closure577_externref_shim(arg0, arg1, arg2);
|
|
531
532
|
}
|
|
532
533
|
|
|
533
534
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
534
|
-
wasm.
|
|
535
|
+
wasm.closure1172_externref_shim(arg0, arg1, arg2, arg3, arg4);
|
|
535
536
|
}
|
|
536
537
|
|
|
537
538
|
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
538
|
-
wasm.
|
|
539
|
+
wasm.closure1176_externref_shim(arg0, arg1, arg2, arg3);
|
|
539
540
|
}
|
|
540
541
|
|
|
541
542
|
module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
@@ -813,8 +814,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
|
813
814
|
return ret;
|
|
814
815
|
};
|
|
815
816
|
|
|
816
|
-
module.exports.
|
|
817
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
817
|
+
module.exports.__wbindgen_closure_wrapper1979 = function(arg0, arg1, arg2) {
|
|
818
|
+
const ret = makeMutClosure(arg0, arg1, 578, __wbg_adapter_30);
|
|
818
819
|
return ret;
|
|
819
820
|
};
|
|
820
821
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const and: (a: any, b: any) => any;
|
|
5
|
-
export const xor: (a: any, b: any) => any;
|
|
6
|
-
export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
7
|
-
export const blake2s256: (a: number, b: number) => [number, number];
|
|
8
|
-
export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
9
|
-
export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
10
|
-
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
11
|
-
export const buildInfo: () => any;
|
|
12
|
-
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
13
|
-
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
14
|
-
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
15
4
|
export const compressWitness: (a: any) => [number, number, number, number];
|
|
16
5
|
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
17
6
|
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
@@ -19,6 +8,17 @@ export const decompressWitnessStack: (a: number, b: number) => [number, number,
|
|
|
19
8
|
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
20
9
|
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
21
10
|
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
11
|
+
export const buildInfo: () => any;
|
|
12
|
+
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
13
|
+
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
14
|
+
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
15
|
+
export const and: (a: any, b: any) => any;
|
|
16
|
+
export const xor: (a: any, b: any) => any;
|
|
17
|
+
export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
18
|
+
export const blake2s256: (a: number, b: number) => [number, number];
|
|
19
|
+
export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
20
|
+
export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
21
|
+
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
22
22
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
23
23
|
export const __externref_table_alloc: () => number;
|
|
24
24
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -27,7 +27,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
|
27
27
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
28
28
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
29
29
|
export const __externref_table_dealloc: (a: number) => void;
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
30
|
+
export const closure577_externref_shim: (a: number, b: number, c: any) => void;
|
|
31
|
+
export const closure1172_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
32
|
+
export const closure1176_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
33
33
|
export const __wbindgen_start: () => void;
|