@provablehq/wasm 0.11.7 → 0.11.9

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.
@@ -314,6 +314,38 @@ function addBorrowedObject(obj) {
314
314
  heap[--stack_pointer] = obj;
315
315
  return stack_pointer;
316
316
  }
317
+ /**
318
+ * Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
319
+ *
320
+ * This function verifies a batch proof produced by Aleo programs that may not be deployed on chain.
321
+ * Each verifying key is paired with one or more sets of public inputs (instances).
322
+ *
323
+ * @param {Array<string>} verifying_keys Array of verifying key strings, one per circuit
324
+ * @param {Array<Array<Array<string>>>} inputs 3D array of field element strings [circuit_idx][instance_idx][field_idx]
325
+ * @param {Proof} proof The batch proof to verify
326
+ * @returns {boolean} True if the batch proof is valid, false otherwise
327
+ * @param {Array<any>} verifying_keys
328
+ * @param {Array<any>} inputs
329
+ * @param {Proof} proof
330
+ * @returns {boolean}
331
+ */
332
+ function snarkVerifyBatch(verifying_keys, inputs, proof) {
333
+ try {
334
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
335
+ _assertClass(proof, Proof);
336
+ wasm.snarkVerifyBatch(retptr, addHeapObject(verifying_keys), addHeapObject(inputs), proof.__wbg_ptr);
337
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
338
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
339
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
340
+ if (r2) {
341
+ throw takeObject(r1);
342
+ }
343
+ return r0 !== 0;
344
+ } finally {
345
+ wasm.__wbindgen_add_to_stack_pointer(16);
346
+ }
347
+ }
348
+
317
349
  /**
318
350
  * Verify a SNARK proof against a verifying key and public inputs.
319
351
  *
@@ -396,35 +428,23 @@ function verifyFunctionExecution(execution, verifying_key, program, function_id,
396
428
  }
397
429
 
398
430
  /**
399
- * Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
431
+ * Set test consensus version heights for testing.
400
432
  *
401
- * This function verifies a batch proof produced by Aleo programs that may not be deployed on chain.
402
- * Each verifying key is paired with one or more sets of public inputs (instances).
433
+ * @param {string | undefined} heights The block heights at which each consensus version applies. This input should be a simple csv list of block heights and there should be one number for each consensus version. If left undefined, the default test heights will be applied.
403
434
  *
404
- * @param {Array<string>} verifying_keys Array of verifying key strings, one per circuit
405
- * @param {Array<Array<Array<string>>>} inputs 3D array of field element strings [circuit_idx][instance_idx][field_idx]
406
- * @param {Proof} proof The batch proof to verify
407
- * @returns {boolean} True if the batch proof is valid, false otherwise
408
- * @param {Array<any>} verifying_keys
409
- * @param {Array<any>} inputs
410
- * @param {Proof} proof
411
- * @returns {boolean}
435
+ * @example
436
+ * import { getOrInitConsensusVersionTestHeights } from '@provablehq/sdk';
437
+ *
438
+ * Set the consensus version heights.
439
+ * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18");
440
+ * @param {string | null} [heights]
441
+ * @returns {Array<any>}
412
442
  */
413
- function snarkVerifyBatch(verifying_keys, inputs, proof) {
414
- try {
415
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
416
- _assertClass(proof, Proof);
417
- wasm.snarkVerifyBatch(retptr, addHeapObject(verifying_keys), addHeapObject(inputs), proof.__wbg_ptr);
418
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
419
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
420
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
421
- if (r2) {
422
- throw takeObject(r1);
423
- }
424
- return r0 !== 0;
425
- } finally {
426
- wasm.__wbindgen_add_to_stack_pointer(16);
427
- }
443
+ function getOrInitConsensusVersionTestHeights(heights) {
444
+ var ptr0 = isLikeNone(heights) ? 0 : passStringToWasm0(heights, wasm.__wbindgen_export, wasm.__wbindgen_export2);
445
+ var len0 = WASM_VECTOR_LEN;
446
+ const ret = wasm.getOrInitConsensusVersionTestHeights(ptr0, len0);
447
+ return takeObject(ret);
428
448
  }
429
449
 
430
450
  /**
@@ -466,26 +486,6 @@ function getMaxProgramImports() {
466
486
  return ret >>> 0;
467
487
  }
468
488
 
469
- /**
470
- * Set test consensus version heights for testing.
471
- *
472
- * @param {string | undefined} heights The block heights at which each consensus version applies. This input should be a simple csv list of block heights and there should be one number for each consensus version. If left undefined, the default test heights will be applied.
473
- *
474
- * @example
475
- * import { getOrInitConsensusVersionTestHeights } from '@provablehq/sdk';
476
- *
477
- * Set the consensus version heights.
478
- * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18");
479
- * @param {string | null} [heights]
480
- * @returns {Array<any>}
481
- */
482
- function getOrInitConsensusVersionTestHeights(heights) {
483
- var ptr0 = isLikeNone(heights) ? 0 : passStringToWasm0(heights, wasm.__wbindgen_export, wasm.__wbindgen_export2);
484
- var len0 = WASM_VECTOR_LEN;
485
- const ret = wasm.getOrInitConsensusVersionTestHeights(ptr0, len0);
486
- return takeObject(ret);
487
- }
488
-
489
489
  function passArrayJsValueToWasm0(array, malloc) {
490
490
  const ptr = malloc(array.length * 4, 4) >>> 0;
491
491
  const mem = getDataViewMemory0();
@@ -509,12 +509,12 @@ function __wasm_bindgen_func_elem_8948(arg0, arg1, arg2) {
509
509
  wasm.__wasm_bindgen_func_elem_8948(arg0, arg1, addHeapObject(arg2));
510
510
  }
511
511
 
512
- function __wasm_bindgen_func_elem_7504(arg0, arg1) {
513
- wasm.__wasm_bindgen_func_elem_7504(arg0, arg1);
512
+ function __wasm_bindgen_func_elem_7507(arg0, arg1) {
513
+ wasm.__wasm_bindgen_func_elem_7507(arg0, arg1);
514
514
  }
515
515
 
516
- function __wasm_bindgen_func_elem_7776(arg0, arg1, arg2, arg3) {
517
- wasm.__wasm_bindgen_func_elem_7776(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
516
+ function __wasm_bindgen_func_elem_7780(arg0, arg1, arg2, arg3) {
517
+ wasm.__wasm_bindgen_func_elem_7780(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
518
518
  }
519
519
 
520
520
  const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
@@ -19319,7 +19319,7 @@ function __wbg_get_imports(memory) {
19319
19319
  const ret = getObject(arg0).length;
19320
19320
  return ret;
19321
19321
  };
19322
- imports.wbg.__wbg_log_03049fa0ffffc089 = function(arg0, arg1) {
19322
+ imports.wbg.__wbg_log_94d1dab6039baf0d = function(arg0, arg1) {
19323
19323
  console.log(getStringFromWasm0(arg0, arg1));
19324
19324
  };
19325
19325
  imports.wbg.__wbg_new_1acc0b6eea89d040 = function() {
@@ -19337,7 +19337,7 @@ function __wbg_get_imports(memory) {
19337
19337
  const a = state0.a;
19338
19338
  state0.a = 0;
19339
19339
  try {
19340
- return __wasm_bindgen_func_elem_7776(a, state0.b, arg0, arg1);
19340
+ return __wasm_bindgen_func_elem_7780(a, state0.b, arg0, arg1);
19341
19341
  } finally {
19342
19342
  state0.a = a;
19343
19343
  }
@@ -19509,7 +19509,7 @@ function __wbg_get_imports(memory) {
19509
19509
  const ret = Signature.__wrap(arg0);
19510
19510
  return addHeapObject(ret);
19511
19511
  };
19512
- imports.wbg.__wbg_spawnWorker_6984bbe776b8abdc = function(arg0, arg1, arg2, arg3) {
19512
+ imports.wbg.__wbg_spawnWorker_755c8ce6e1ead587 = function(arg0, arg1, arg2, arg3) {
19513
19513
  const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
19514
19514
  return addHeapObject(ret);
19515
19515
  };
@@ -19598,7 +19598,7 @@ function __wbg_get_imports(memory) {
19598
19598
  };
19599
19599
  imports.wbg.__wbindgen_cast_2adca60326a83a78 = function(arg0, arg1) {
19600
19600
  // Cast intrinsic for `Closure(Closure { dtor_idx: 395, function: Function { arguments: [], shim_idx: 528, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
19601
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7503, __wasm_bindgen_func_elem_7504);
19601
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7506, __wasm_bindgen_func_elem_7507);
19602
19602
  return addHeapObject(ret);
19603
19603
  };
19604
19604
  imports.wbg.__wbindgen_cast_2ddd8a25ff58642a = function(arg0, arg1) {
@@ -19613,7 +19613,7 @@ function __wbg_get_imports(memory) {
19613
19613
  };
19614
19614
  imports.wbg.__wbindgen_cast_805ada4c4be963fc = function(arg0, arg1) {
19615
19615
  // Cast intrinsic for `Closure(Closure { dtor_idx: 395, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 396, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
19616
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7503, __wasm_bindgen_func_elem_8948);
19616
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7506, __wasm_bindgen_func_elem_8948);
19617
19617
  return addHeapObject(ret);
19618
19618
  };
19619
19619
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
@@ -19623,7 +19623,7 @@ function __wbg_get_imports(memory) {
19623
19623
  };
19624
19624
  imports.wbg.__wbindgen_cast_c048d24de4cf58bb = function(arg0, arg1) {
19625
19625
  // Cast intrinsic for `Closure(Closure { dtor_idx: 395, function: Function { arguments: [Externref], shim_idx: 396, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
19626
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7503, __wasm_bindgen_func_elem_8948);
19626
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7506, __wasm_bindgen_func_elem_8948);
19627
19627
  return addHeapObject(ret);
19628
19628
  };
19629
19629
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {