@provablehq/wasm 0.11.10 → 0.11.11

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,39 +314,6 @@ function addBorrowedObject(obj) {
314
314
  heap[--stack_pointer] = obj;
315
315
  return stack_pointer;
316
316
  }
317
- /**
318
- * Verify a SNARK proof against a verifying key and public inputs.
319
- *
320
- * This function verifies a proof produced by an Aleo program that may not be deployed on chain.
321
- * It directly invokes the Varuna proof verification from snarkVM.
322
- *
323
- * @param {VerifyingKey} verifying_key The verifying key for the circuit
324
- * @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
325
- * @param {Proof} proof The proof to verify
326
- * @returns {boolean} True if the proof is valid, false otherwise
327
- * @param {VerifyingKey} verifying_key
328
- * @param {Array<any>} inputs
329
- * @param {Proof} proof
330
- * @returns {boolean}
331
- */
332
- function snarkVerify(verifying_key, inputs, proof) {
333
- try {
334
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
335
- _assertClass(verifying_key, VerifyingKey);
336
- _assertClass(proof, Proof);
337
- wasm.snarkVerify(retptr, verifying_key.__wbg_ptr, addHeapObject(inputs), proof.__wbg_ptr);
338
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
339
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
340
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
341
- if (r2) {
342
- throw takeObject(r1);
343
- }
344
- return r0 !== 0;
345
- } finally {
346
- wasm.__wbindgen_add_to_stack_pointer(16);
347
- }
348
- }
349
-
350
317
  /**
351
318
  * Verify an execution. Executions with multiple transitions must have the program source code and
352
319
  * verifying keys of imported functions supplied from outside to correctly verify. Also, this does
@@ -395,6 +362,39 @@ function verifyFunctionExecution(execution, verifying_key, program, function_id,
395
362
  }
396
363
  }
397
364
 
365
+ /**
366
+ * Verify a SNARK proof against a verifying key and public inputs.
367
+ *
368
+ * This function verifies a proof produced by an Aleo program that may not be deployed on chain.
369
+ * It directly invokes the Varuna proof verification from snarkVM.
370
+ *
371
+ * @param {VerifyingKey} verifying_key The verifying key for the circuit
372
+ * @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
373
+ * @param {Proof} proof The proof to verify
374
+ * @returns {boolean} True if the proof is valid, false otherwise
375
+ * @param {VerifyingKey} verifying_key
376
+ * @param {Array<any>} inputs
377
+ * @param {Proof} proof
378
+ * @returns {boolean}
379
+ */
380
+ function snarkVerify(verifying_key, inputs, proof) {
381
+ try {
382
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
383
+ _assertClass(verifying_key, VerifyingKey);
384
+ _assertClass(proof, Proof);
385
+ wasm.snarkVerify(retptr, verifying_key.__wbg_ptr, addHeapObject(inputs), proof.__wbg_ptr);
386
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
387
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
388
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
389
+ if (r2) {
390
+ throw takeObject(r1);
391
+ }
392
+ return r0 !== 0;
393
+ } finally {
394
+ wasm.__wbindgen_add_to_stack_pointer(16);
395
+ }
396
+ }
397
+
398
398
  /**
399
399
  * Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
400
400
  *
@@ -458,7 +458,7 @@ function stringToField(string) {
458
458
  * import { getOrInitConsensusVersionTestHeights } from '@provablehq/sdk';
459
459
  *
460
460
  * Set the consensus version heights.
461
- * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18");
461
+ * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20");
462
462
  * @param {string | null} [heights]
463
463
  * @returns {Array<any>}
464
464
  */
@@ -505,16 +505,16 @@ function getArrayJsValueFromWasm0(ptr, len) {
505
505
  }
506
506
  return result;
507
507
  }
508
- function __wasm_bindgen_func_elem_8946(arg0, arg1, arg2) {
509
- wasm.__wasm_bindgen_func_elem_8946(arg0, arg1, addHeapObject(arg2));
508
+ function __wasm_bindgen_func_elem_8995(arg0, arg1, arg2) {
509
+ wasm.__wasm_bindgen_func_elem_8995(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_7556(arg0, arg1) {
513
+ wasm.__wasm_bindgen_func_elem_7556(arg0, arg1);
514
514
  }
515
515
 
516
- function __wasm_bindgen_func_elem_7777(arg0, arg1, arg2, arg3) {
517
- wasm.__wasm_bindgen_func_elem_7777(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
516
+ function __wasm_bindgen_func_elem_7829(arg0, arg1, arg2, arg3) {
517
+ wasm.__wasm_bindgen_func_elem_7829(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_6a7c7e39dc2b85ff = function(arg0, arg1) {
19322
+ imports.wbg.__wbg_log_873fe7a781ebc826 = 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_7777(a, state0.b, arg0, arg1);
19340
+ return __wasm_bindgen_func_elem_7829(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_ea93f1cb9997e793 = function(arg0, arg1, arg2, arg3) {
19512
+ imports.wbg.__wbg_spawnWorker_087de831e4bfd369 = 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
  };
@@ -19596,11 +19596,6 @@ function __wbg_get_imports(memory) {
19596
19596
  const ret = getStringFromWasm0(arg0, arg1);
19597
19597
  return addHeapObject(ret);
19598
19598
  };
19599
- imports.wbg.__wbindgen_cast_2adca60326a83a78 = function(arg0, arg1) {
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);
19602
- return addHeapObject(ret);
19603
- };
19604
19599
  imports.wbg.__wbindgen_cast_2ddd8a25ff58642a = function(arg0, arg1) {
19605
19600
  // Cast intrinsic for `I128 -> Externref`.
19606
19601
  const ret = (BigInt.asUintN(64, arg0) | (arg1 << BigInt(64)));
@@ -19613,7 +19608,7 @@ function __wbg_get_imports(memory) {
19613
19608
  };
19614
19609
  imports.wbg.__wbindgen_cast_805ada4c4be963fc = function(arg0, arg1) {
19615
19610
  // 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_8946);
19611
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7555, __wasm_bindgen_func_elem_8995);
19617
19612
  return addHeapObject(ret);
19618
19613
  };
19619
19614
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
@@ -19623,7 +19618,7 @@ function __wbg_get_imports(memory) {
19623
19618
  };
19624
19619
  imports.wbg.__wbindgen_cast_c048d24de4cf58bb = function(arg0, arg1) {
19625
19620
  // 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_8946);
19621
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7555, __wasm_bindgen_func_elem_8995);
19627
19622
  return addHeapObject(ret);
19628
19623
  };
19629
19624
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
@@ -19636,6 +19631,11 @@ function __wbg_get_imports(memory) {
19636
19631
  const ret = (BigInt.asUintN(64, arg0) | (BigInt.asUintN(64, arg1) << BigInt(64)));
19637
19632
  return addHeapObject(ret);
19638
19633
  };
19634
+ imports.wbg.__wbindgen_cast_f10277ab8e6ee562 = function(arg0, arg1) {
19635
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 395, function: Function { arguments: [], shim_idx: 533, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
19636
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7555, __wasm_bindgen_func_elem_7556);
19637
+ return addHeapObject(ret);
19638
+ };
19639
19639
  imports.wbg.__wbindgen_link_b9f45ffe079ef2c1 = function(arg0) {
19640
19640
  const val = `onmessage = function (ev) {
19641
19641
  let [ia, index, value] = ev.data;