@provablehq/wasm 0.10.5-rc.1 → 0.10.5

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.
@@ -303,38 +303,6 @@ function addBorrowedObject(obj) {
303
303
  heap[--stack_pointer] = obj;
304
304
  return stack_pointer;
305
305
  }
306
- /**
307
- * Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
308
- *
309
- * This function verifies a batch proof produced by Aleo programs that may not be deployed on chain.
310
- * Each verifying key is paired with one or more sets of public inputs (instances).
311
- *
312
- * @param {Array<string>} verifying_keys Array of verifying key strings, one per circuit
313
- * @param {Array<Array<Array<string>>>} inputs 3D array of field element strings [circuit_idx][instance_idx][field_idx]
314
- * @param {Proof} proof The batch proof to verify
315
- * @returns {boolean} True if the batch proof is valid, false otherwise
316
- * @param {Array<any>} verifying_keys
317
- * @param {Array<any>} inputs
318
- * @param {Proof} proof
319
- * @returns {boolean}
320
- */
321
- function snarkVerifyBatch(verifying_keys, inputs, proof) {
322
- try {
323
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
324
- _assertClass(proof, Proof);
325
- wasm.snarkVerifyBatch(retptr, addHeapObject(verifying_keys), addHeapObject(inputs), proof.__wbg_ptr);
326
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
327
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
328
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
329
- if (r2) {
330
- throw takeObject(r1);
331
- }
332
- return r0 !== 0;
333
- } finally {
334
- wasm.__wbindgen_add_to_stack_pointer(16);
335
- }
336
- }
337
-
338
306
  /**
339
307
  * Verify an execution. Executions with multiple transitions must have the program source code and
340
308
  * verifying keys of imported functions supplied from outside to correctly verify. Also, this does
@@ -410,6 +378,38 @@ function snarkVerify(verifying_key, inputs, proof) {
410
378
  }
411
379
  }
412
380
 
381
+ /**
382
+ * Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
383
+ *
384
+ * This function verifies a batch proof produced by Aleo programs that may not be deployed on chain.
385
+ * Each verifying key is paired with one or more sets of public inputs (instances).
386
+ *
387
+ * @param {Array<string>} verifying_keys Array of verifying key strings, one per circuit
388
+ * @param {Array<Array<Array<string>>>} inputs 3D array of field element strings [circuit_idx][instance_idx][field_idx]
389
+ * @param {Proof} proof The batch proof to verify
390
+ * @returns {boolean} True if the batch proof is valid, false otherwise
391
+ * @param {Array<any>} verifying_keys
392
+ * @param {Array<any>} inputs
393
+ * @param {Proof} proof
394
+ * @returns {boolean}
395
+ */
396
+ function snarkVerifyBatch(verifying_keys, inputs, proof) {
397
+ try {
398
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
399
+ _assertClass(proof, Proof);
400
+ wasm.snarkVerifyBatch(retptr, addHeapObject(verifying_keys), addHeapObject(inputs), proof.__wbg_ptr);
401
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
402
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
403
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
404
+ if (r2) {
405
+ throw takeObject(r1);
406
+ }
407
+ return r0 !== 0;
408
+ } finally {
409
+ wasm.__wbindgen_add_to_stack_pointer(16);
410
+ }
411
+ }
412
+
413
413
  /**
414
414
  * @param {string} string
415
415
  * @returns {Field}
@@ -471,16 +471,16 @@ function getArrayJsValueFromWasm0(ptr, len) {
471
471
  }
472
472
  return result;
473
473
  }
474
- function __wasm_bindgen_func_elem_8577(arg0, arg1, arg2) {
475
- wasm.__wasm_bindgen_func_elem_8577(arg0, arg1, addHeapObject(arg2));
474
+ function __wasm_bindgen_func_elem_7201(arg0, arg1) {
475
+ wasm.__wasm_bindgen_func_elem_7201(arg0, arg1);
476
476
  }
477
477
 
478
- function __wasm_bindgen_func_elem_7220(arg0, arg1) {
479
- wasm.__wasm_bindgen_func_elem_7220(arg0, arg1);
478
+ function __wasm_bindgen_func_elem_8569(arg0, arg1, arg2) {
479
+ wasm.__wasm_bindgen_func_elem_8569(arg0, arg1, addHeapObject(arg2));
480
480
  }
481
481
 
482
- function __wasm_bindgen_func_elem_7492(arg0, arg1, arg2, arg3) {
483
- wasm.__wasm_bindgen_func_elem_7492(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
482
+ function __wasm_bindgen_func_elem_7473(arg0, arg1, arg2, arg3) {
483
+ wasm.__wasm_bindgen_func_elem_7473(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
484
484
  }
485
485
 
486
486
  const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
@@ -18512,7 +18512,7 @@ function __wbg_get_imports(memory) {
18512
18512
  const ret = getObject(arg0).length;
18513
18513
  return ret;
18514
18514
  };
18515
- imports.wbg.__wbg_log_22dee88c33d8b7ed = function(arg0, arg1) {
18515
+ imports.wbg.__wbg_log_78f898e0b3066062 = function(arg0, arg1) {
18516
18516
  console.log(getStringFromWasm0(arg0, arg1));
18517
18517
  };
18518
18518
  imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
@@ -18534,7 +18534,7 @@ function __wbg_get_imports(memory) {
18534
18534
  const a = state0.a;
18535
18535
  state0.a = 0;
18536
18536
  try {
18537
- return __wasm_bindgen_func_elem_7492(a, state0.b, arg0, arg1);
18537
+ return __wasm_bindgen_func_elem_7473(a, state0.b, arg0, arg1);
18538
18538
  } finally {
18539
18539
  state0.a = a;
18540
18540
  }
@@ -18721,7 +18721,7 @@ function __wbg_get_imports(memory) {
18721
18721
  const ret = Signature.__wrap(arg0);
18722
18722
  return addHeapObject(ret);
18723
18723
  };
18724
- imports.wbg.__wbg_spawnWorker_33cc8ce5f9639974 = function(arg0, arg1, arg2, arg3) {
18724
+ imports.wbg.__wbg_spawnWorker_16cedfb6613c80ac = function(arg0, arg1, arg2, arg3) {
18725
18725
  const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
18726
18726
  return addHeapObject(ret);
18727
18727
  };
@@ -18821,19 +18821,14 @@ function __wbg_get_imports(memory) {
18821
18821
  const ret = (BigInt.asUintN(64, arg0) | (arg1 << BigInt(64)));
18822
18822
  return addHeapObject(ret);
18823
18823
  };
18824
- imports.wbg.__wbindgen_cast_32a97a33ade320ff = function(arg0, arg1) {
18825
- // Cast intrinsic for `Closure(Closure { dtor_idx: 359, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 360, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18826
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7219, __wasm_bindgen_func_elem_8577);
18827
- return addHeapObject(ret);
18828
- };
18829
18824
  imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
18830
18825
  // Cast intrinsic for `U64 -> Externref`.
18831
18826
  const ret = BigInt.asUintN(64, arg0);
18832
18827
  return addHeapObject(ret);
18833
18828
  };
18834
- imports.wbg.__wbindgen_cast_54fdaf61e7a5e679 = function(arg0, arg1) {
18835
- // Cast intrinsic for `Closure(Closure { dtor_idx: 359, function: Function { arguments: [], shim_idx: 465, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18836
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7219, __wasm_bindgen_func_elem_7220);
18829
+ imports.wbg.__wbindgen_cast_711d7deea8fc39ca = function(arg0, arg1) {
18830
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [Externref], shim_idx: 357, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18831
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7200, __wasm_bindgen_func_elem_8569);
18837
18832
  return addHeapObject(ret);
18838
18833
  };
18839
18834
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
@@ -18841,21 +18836,26 @@ function __wbg_get_imports(memory) {
18841
18836
  const ret = arg0;
18842
18837
  return addHeapObject(ret);
18843
18838
  };
18839
+ imports.wbg.__wbindgen_cast_cada7727142cd213 = function(arg0, arg1) {
18840
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 357, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18841
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7200, __wasm_bindgen_func_elem_8569);
18842
+ return addHeapObject(ret);
18843
+ };
18844
18844
  imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
18845
18845
  // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
18846
18846
  const ret = getArrayU8FromWasm0(arg0, arg1);
18847
18847
  return addHeapObject(ret);
18848
18848
  };
18849
+ imports.wbg.__wbindgen_cast_cdf07f87b2615f8c = function(arg0, arg1) {
18850
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [], shim_idx: 462, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18851
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7200, __wasm_bindgen_func_elem_7201);
18852
+ return addHeapObject(ret);
18853
+ };
18849
18854
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
18850
18855
  // Cast intrinsic for `F64 -> Externref`.
18851
18856
  const ret = arg0;
18852
18857
  return addHeapObject(ret);
18853
18858
  };
18854
- imports.wbg.__wbindgen_cast_e424aac48c10ba33 = function(arg0, arg1) {
18855
- // Cast intrinsic for `Closure(Closure { dtor_idx: 359, function: Function { arguments: [Externref], shim_idx: 360, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18856
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7219, __wasm_bindgen_func_elem_8577);
18857
- return addHeapObject(ret);
18858
- };
18859
18859
  imports.wbg.__wbindgen_cast_e7b45dd881f38ce3 = function(arg0, arg1) {
18860
18860
  // Cast intrinsic for `U128 -> Externref`.
18861
18861
  const ret = (BigInt.asUintN(64, arg0) | (BigInt.asUintN(64, arg1) << BigInt(64)));