@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.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
- let cachedUint32ArrayMemory0 = null;
227
-
228
- function getUint32ArrayMemory0() {
229
- if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
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 getArrayU32FromWasm0(ptr, len) {
211
+ function getArrayU8FromWasm0(ptr, len) {
243
212
  ptr = ptr >>> 0;
244
- return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
213
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
245
214
  }
246
215
  /**
247
- * Sha256 compression function
248
- * @param {Uint32Array} inputs
249
- * @param {Uint32Array} state
250
- * @returns {Uint32Array}
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.sha256_compression = function(inputs, state) {
253
- const ptr0 = passArray32ToWasm0(inputs, wasm.__wbindgen_malloc);
254
- const len0 = WASM_VECTOR_LEN;
255
- const ptr1 = passArray32ToWasm0(state, wasm.__wbindgen_malloc);
256
- const len1 = WASM_VECTOR_LEN;
257
- const ret = wasm.sha256_compression(ptr0, len0, ptr1, len1);
258
- var v3 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
259
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
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
- * Calculates the Blake2s256 hash of the input bytes
276
- * @param {Uint8Array} inputs
277
- * @returns {Uint8Array}
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.blake2s256 = function(inputs) {
280
- const ptr0 = passArray8ToWasm0(inputs, wasm.__wbindgen_malloc);
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.blake2s256(ptr0, len0);
283
- var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
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 v2;
267
+ return v1;
286
268
  };
287
269
 
288
270
  /**
289
- * Verifies a ECDSA signature over the secp256k1 curve.
290
- * @param {Uint8Array} hashed_msg
291
- * @param {Uint8Array} public_key_x_bytes
292
- * @param {Uint8Array} public_key_y_bytes
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.ecdsa_secp256k1_verify = function(hashed_msg, public_key_x_bytes, public_key_y_bytes, signature) {
297
- const ptr0 = passArray8ToWasm0(hashed_msg, wasm.__wbindgen_malloc);
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 ptr1 = passArray8ToWasm0(public_key_x_bytes, wasm.__wbindgen_malloc);
300
- const len1 = WASM_VECTOR_LEN;
301
- const ptr2 = passArray8ToWasm0(public_key_y_bytes, wasm.__wbindgen_malloc);
302
- const len2 = WASM_VECTOR_LEN;
303
- const ptr3 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
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
- * Verifies a ECDSA signature over the secp256r1 curve.
311
- * @param {Uint8Array} hashed_msg
312
- * @param {Uint8Array} public_key_x_bytes
313
- * @param {Uint8Array} public_key_y_bytes
314
- * @param {Uint8Array} signature
315
- * @returns {boolean}
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.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes, public_key_y_bytes, signature) {
318
- const ptr0 = passArray8ToWasm0(hashed_msg, wasm.__wbindgen_malloc);
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 ptr1 = passArray8ToWasm0(public_key_x_bytes, wasm.__wbindgen_malloc);
321
- const len1 = WASM_VECTOR_LEN;
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
- * Sets the package's logging level.
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 {LogLevel} level - The maximum level of logging to be emitted.
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.initLogLevel = function(filter) {
341
- const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
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.initLogLevel(ptr0, len0);
344
- if (ret[1]) {
345
- throw takeFromExternrefTable0(ret[0]);
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
- * Compresses a `WitnessMap` into the binary format outputted by Nargo.
420
- *
421
- * @param {WitnessMap} witness_map - A witness map.
422
- * @returns {Uint8Array} A compressed witness map
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.compressWitness = function(witness_map) {
425
- const ret = wasm.compressWitness(witness_map);
426
- if (ret[3]) {
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
- * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
436
- * This should be used to only fetch the witness map for the main function.
437
- *
438
- * @param {Uint8Array} compressed_witness - A compressed witness.
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.decompressWitness = function(compressed_witness) {
442
- const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
443
- const len0 = WASM_VECTOR_LEN;
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
- * Compresses a `WitnessStack` into the binary format outputted by Nargo.
453
- *
454
- * @param {WitnessStack} witness_stack - A witness stack.
455
- * @returns {Uint8Array} A compressed witness stack
444
+ * Sha256 compression function
445
+ * @param {Uint32Array} inputs
446
+ * @param {Uint32Array} state
447
+ * @returns {Uint32Array}
456
448
  */
457
- module.exports.compressWitnessStack = function(witness_stack) {
458
- const ret = wasm.compressWitnessStack(witness_stack);
459
- if (ret[3]) {
460
- throw takeFromExternrefTable0(ret[2]);
461
- }
462
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
463
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
464
- return v1;
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
- * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
469
- *
470
- * @param {Uint8Array} compressed_witness - A compressed witness.
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.decompressWitnessStack = function(compressed_witness) {
474
- const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
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.decompressWitnessStack(ptr0, len0);
477
- if (ret[2]) {
478
- throw takeFromExternrefTable0(ret[1]);
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
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
485
- *
486
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
487
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
488
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
489
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
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.executeCircuit = function(program, initial_witness, foreign_call_handler) {
492
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
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 ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
495
- return ret;
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
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
500
- * This method also extracts the public return values from the solved witness into its own return witness.
501
- *
502
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
503
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
504
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
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.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
508
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
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 ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
511
- return ret;
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
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
517
+ * Sets the package's logging level.
516
518
  *
517
- * @param {Uint8Array} program - A serialized representation of an ACIR program
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.executeProgram = function(program, initial_witness, foreign_call_handler) {
523
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
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.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
526
- return ret;
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.closure583_externref_shim(arg0, arg1, arg2);
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.closure1178_externref_shim(arg0, arg1, arg2, arg3, arg4);
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.closure1182_externref_shim(arg0, arg1, arg2, arg3);
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.__wbindgen_closure_wrapper1982 = function(arg0, arg1, arg2) {
817
- const ret = makeMutClosure(arg0, arg1, 584, __wbg_adapter_30);
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
 
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 closure583_externref_shim: (a: number, b: number, c: any) => void;
31
- export const closure1178_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
- export const closure1182_externref_shim: (a: number, b: number, c: any, d: any) => void;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noir-lang/acvm_js",
3
- "version": "1.0.0-beta.15-1fce7ca.nightly",
3
+ "version": "1.0.0-beta.15-d2c71c4.nightly",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },