@provablehq/wasm 0.10.3 → 0.10.4

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 a SNARK proof against a verifying key and public inputs.
340
308
  *
@@ -410,6 +378,38 @@ function verifyFunctionExecution(execution, verifying_key, program, function_id,
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,12 +471,12 @@ function getArrayJsValueFromWasm0(ptr, len) {
471
471
  }
472
472
  return result;
473
473
  }
474
- function __wasm_bindgen_func_elem_7170(arg0, arg1) {
475
- wasm.__wasm_bindgen_func_elem_7170(arg0, arg1);
474
+ function __wasm_bindgen_func_elem_8536(arg0, arg1, arg2) {
475
+ wasm.__wasm_bindgen_func_elem_8536(arg0, arg1, addHeapObject(arg2));
476
476
  }
477
477
 
478
- function __wasm_bindgen_func_elem_8534(arg0, arg1, arg2) {
479
- wasm.__wasm_bindgen_func_elem_8534(arg0, arg1, addHeapObject(arg2));
478
+ function __wasm_bindgen_func_elem_7170(arg0, arg1) {
479
+ wasm.__wasm_bindgen_func_elem_7170(arg0, arg1);
480
480
  }
481
481
 
482
482
  function __wasm_bindgen_func_elem_7443(arg0, arg1, arg2, arg3) {
@@ -9870,6 +9870,16 @@ class Program {
9870
9870
  const ret = wasm.program_getImports(this.__wbg_ptr);
9871
9871
  return takeObject(ret);
9872
9872
  }
9873
+ /**
9874
+ * Get the checksum of the program.
9875
+ *
9876
+ * @returns {Uint8Array} The checksum of the program as a 32-byte Uint8Array
9877
+ * @returns {Uint8Array}
9878
+ */
9879
+ toChecksum() {
9880
+ const ret = wasm.program_toChecksum(this.__wbg_ptr);
9881
+ return takeObject(ret);
9882
+ }
9873
9883
  /**
9874
9884
  * Get a the list of a program's mappings and the names/types of their keys and values.
9875
9885
  *
@@ -18336,7 +18346,7 @@ function __wbg_get_imports(memory) {
18336
18346
  const ret = getObject(arg0).length;
18337
18347
  return ret;
18338
18348
  };
18339
- imports.wbg.__wbg_log_0b9e82a3d425c505 = function(arg0, arg1) {
18349
+ imports.wbg.__wbg_log_4688d4dee83f4df4 = function(arg0, arg1) {
18340
18350
  console.log(getStringFromWasm0(arg0, arg1));
18341
18351
  };
18342
18352
  imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
@@ -18545,7 +18555,7 @@ function __wbg_get_imports(memory) {
18545
18555
  const ret = Signature.__wrap(arg0);
18546
18556
  return addHeapObject(ret);
18547
18557
  };
18548
- imports.wbg.__wbg_spawnWorker_fd8a412decad8341 = function(arg0, arg1, arg2, arg3) {
18558
+ imports.wbg.__wbg_spawnWorker_9ce4a98fc7b6f238 = function(arg0, arg1, arg2, arg3) {
18549
18559
  const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
18550
18560
  return addHeapObject(ret);
18551
18561
  };
@@ -18652,7 +18662,7 @@ function __wbg_get_imports(memory) {
18652
18662
  };
18653
18663
  imports.wbg.__wbindgen_cast_711d7deea8fc39ca = function(arg0, arg1) {
18654
18664
  // Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [Externref], shim_idx: 357, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18655
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7169, __wasm_bindgen_func_elem_8534);
18665
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7169, __wasm_bindgen_func_elem_8536);
18656
18666
  return addHeapObject(ret);
18657
18667
  };
18658
18668
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
@@ -18667,7 +18677,7 @@ function __wbg_get_imports(memory) {
18667
18677
  };
18668
18678
  imports.wbg.__wbindgen_cast_cada7727142cd213 = function(arg0, arg1) {
18669
18679
  // 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`.
18670
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7169, __wasm_bindgen_func_elem_8534);
18680
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7169, __wasm_bindgen_func_elem_8536);
18671
18681
  return addHeapObject(ret);
18672
18682
  };
18673
18683
  imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {