@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.
@@ -9,18 +9,6 @@ export function runRayonThread(receiver: number): void;
9
9
  */
10
10
  export function setWasmLogLevel(level: number): void;
11
11
  export function initThreadPool(url: URL, num_threads: number): Promise<void>;
12
- /**
13
- * Verify a SNARK proof against a verifying key and public inputs.
14
- *
15
- * This function verifies a proof produced by an Aleo program that may not be deployed on chain.
16
- * It directly invokes the Varuna proof verification from snarkVM.
17
- *
18
- * @param {VerifyingKey} verifying_key The verifying key for the circuit
19
- * @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
20
- * @param {Proof} proof The proof to verify
21
- * @returns {boolean} True if the proof is valid, false otherwise
22
- */
23
- export function snarkVerify(verifying_key: VerifyingKey, inputs: Array<any>, proof: Proof): boolean;
24
12
  /**
25
13
  * Verify an execution. Executions with multiple transitions must have the program source code and
26
14
  * verifying keys of imported functions supplied from outside to correctly verify. Also, this does
@@ -35,6 +23,18 @@ export function snarkVerify(verifying_key: VerifyingKey, inputs: Array<any>, pro
35
23
  * @returns {boolean} True if the execution is valid, false otherwise
36
24
  */
37
25
  export function verifyFunctionExecution(execution: Execution, verifying_key: VerifyingKey, program: Program, function_id: string, imports: object | null | undefined, imported_verifying_keys: object | null | undefined, block_height: number, program_imports?: ProgramImports | null): boolean;
26
+ /**
27
+ * Verify a SNARK proof against a verifying key and public inputs.
28
+ *
29
+ * This function verifies a proof produced by an Aleo program that may not be deployed on chain.
30
+ * It directly invokes the Varuna proof verification from snarkVM.
31
+ *
32
+ * @param {VerifyingKey} verifying_key The verifying key for the circuit
33
+ * @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
34
+ * @param {Proof} proof The proof to verify
35
+ * @returns {boolean} True if the proof is valid, false otherwise
36
+ */
37
+ export function snarkVerify(verifying_key: VerifyingKey, inputs: Array<any>, proof: Proof): boolean;
38
38
  /**
39
39
  * Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
40
40
  *
@@ -57,7 +57,7 @@ export function stringToField(string: string): Field;
57
57
  * import { getOrInitConsensusVersionTestHeights } from '@provablehq/sdk';
58
58
  *
59
59
  * Set the consensus version heights.
60
- * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18");
60
+ * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20");
61
61
  */
62
62
  export function getOrInitConsensusVersionTestHeights(heights?: string | null): Array<any>;
63
63
  /**
Binary file
@@ -320,39 +320,6 @@ function addBorrowedObject(obj) {
320
320
  heap[--stack_pointer] = obj;
321
321
  return stack_pointer;
322
322
  }
323
- /**
324
- * Verify a SNARK proof against a verifying key and public inputs.
325
- *
326
- * This function verifies a proof produced by an Aleo program that may not be deployed on chain.
327
- * It directly invokes the Varuna proof verification from snarkVM.
328
- *
329
- * @param {VerifyingKey} verifying_key The verifying key for the circuit
330
- * @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
331
- * @param {Proof} proof The proof to verify
332
- * @returns {boolean} True if the proof is valid, false otherwise
333
- * @param {VerifyingKey} verifying_key
334
- * @param {Array<any>} inputs
335
- * @param {Proof} proof
336
- * @returns {boolean}
337
- */
338
- function snarkVerify(verifying_key, inputs, proof) {
339
- try {
340
- const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
341
- _assertClass(verifying_key, VerifyingKey);
342
- _assertClass(proof, Proof);
343
- wasm$1.snarkVerify(retptr, verifying_key.__wbg_ptr, addHeapObject(inputs), proof.__wbg_ptr);
344
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
345
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
346
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
347
- if (r2) {
348
- throw takeObject(r1);
349
- }
350
- return r0 !== 0;
351
- } finally {
352
- wasm$1.__wbindgen_add_to_stack_pointer(16);
353
- }
354
- }
355
-
356
323
  /**
357
324
  * Verify an execution. Executions with multiple transitions must have the program source code and
358
325
  * verifying keys of imported functions supplied from outside to correctly verify. Also, this does
@@ -401,6 +368,39 @@ function verifyFunctionExecution(execution, verifying_key, program, function_id,
401
368
  }
402
369
  }
403
370
 
371
+ /**
372
+ * Verify a SNARK proof against a verifying key and public inputs.
373
+ *
374
+ * This function verifies a proof produced by an Aleo program that may not be deployed on chain.
375
+ * It directly invokes the Varuna proof verification from snarkVM.
376
+ *
377
+ * @param {VerifyingKey} verifying_key The verifying key for the circuit
378
+ * @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
379
+ * @param {Proof} proof The proof to verify
380
+ * @returns {boolean} True if the proof is valid, false otherwise
381
+ * @param {VerifyingKey} verifying_key
382
+ * @param {Array<any>} inputs
383
+ * @param {Proof} proof
384
+ * @returns {boolean}
385
+ */
386
+ function snarkVerify(verifying_key, inputs, proof) {
387
+ try {
388
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
389
+ _assertClass(verifying_key, VerifyingKey);
390
+ _assertClass(proof, Proof);
391
+ wasm$1.snarkVerify(retptr, verifying_key.__wbg_ptr, addHeapObject(inputs), proof.__wbg_ptr);
392
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
393
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
394
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
395
+ if (r2) {
396
+ throw takeObject(r1);
397
+ }
398
+ return r0 !== 0;
399
+ } finally {
400
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
401
+ }
402
+ }
403
+
404
404
  /**
405
405
  * Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
406
406
  *
@@ -464,7 +464,7 @@ function stringToField(string) {
464
464
  * import { getOrInitConsensusVersionTestHeights } from '@provablehq/sdk';
465
465
  *
466
466
  * Set the consensus version heights.
467
- * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18");
467
+ * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20");
468
468
  * @param {string | null} [heights]
469
469
  * @returns {Array<any>}
470
470
  */
@@ -511,16 +511,16 @@ function getArrayJsValueFromWasm0(ptr, len) {
511
511
  }
512
512
  return result;
513
513
  }
514
- function __wasm_bindgen_func_elem_8946(arg0, arg1, arg2) {
515
- wasm$1.__wasm_bindgen_func_elem_8946(arg0, arg1, addHeapObject(arg2));
514
+ function __wasm_bindgen_func_elem_8995(arg0, arg1, arg2) {
515
+ wasm$1.__wasm_bindgen_func_elem_8995(arg0, arg1, addHeapObject(arg2));
516
516
  }
517
517
 
518
- function __wasm_bindgen_func_elem_7504(arg0, arg1) {
519
- wasm$1.__wasm_bindgen_func_elem_7504(arg0, arg1);
518
+ function __wasm_bindgen_func_elem_7556(arg0, arg1) {
519
+ wasm$1.__wasm_bindgen_func_elem_7556(arg0, arg1);
520
520
  }
521
521
 
522
- function __wasm_bindgen_func_elem_7777(arg0, arg1, arg2, arg3) {
523
- wasm$1.__wasm_bindgen_func_elem_7777(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
522
+ function __wasm_bindgen_func_elem_7829(arg0, arg1, arg2, arg3) {
523
+ wasm$1.__wasm_bindgen_func_elem_7829(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
524
524
  }
525
525
 
526
526
  const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
@@ -19325,7 +19325,7 @@ function __wbg_get_imports(memory) {
19325
19325
  const ret = getObject(arg0).length;
19326
19326
  return ret;
19327
19327
  };
19328
- imports.wbg.__wbg_log_6a7c7e39dc2b85ff = function(arg0, arg1) {
19328
+ imports.wbg.__wbg_log_873fe7a781ebc826 = function(arg0, arg1) {
19329
19329
  console.log(getStringFromWasm0(arg0, arg1));
19330
19330
  };
19331
19331
  imports.wbg.__wbg_new_1acc0b6eea89d040 = function() {
@@ -19343,7 +19343,7 @@ function __wbg_get_imports(memory) {
19343
19343
  const a = state0.a;
19344
19344
  state0.a = 0;
19345
19345
  try {
19346
- return __wasm_bindgen_func_elem_7777(a, state0.b, arg0, arg1);
19346
+ return __wasm_bindgen_func_elem_7829(a, state0.b, arg0, arg1);
19347
19347
  } finally {
19348
19348
  state0.a = a;
19349
19349
  }
@@ -19515,7 +19515,7 @@ function __wbg_get_imports(memory) {
19515
19515
  const ret = Signature.__wrap(arg0);
19516
19516
  return addHeapObject(ret);
19517
19517
  };
19518
- imports.wbg.__wbg_spawnWorker_ea93f1cb9997e793 = function(arg0, arg1, arg2, arg3) {
19518
+ imports.wbg.__wbg_spawnWorker_087de831e4bfd369 = function(arg0, arg1, arg2, arg3) {
19519
19519
  const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
19520
19520
  return addHeapObject(ret);
19521
19521
  };
@@ -19602,11 +19602,6 @@ function __wbg_get_imports(memory) {
19602
19602
  const ret = getStringFromWasm0(arg0, arg1);
19603
19603
  return addHeapObject(ret);
19604
19604
  };
19605
- imports.wbg.__wbindgen_cast_2adca60326a83a78 = function(arg0, arg1) {
19606
- // Cast intrinsic for `Closure(Closure { dtor_idx: 395, function: Function { arguments: [], shim_idx: 528, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
19607
- const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7503, __wasm_bindgen_func_elem_7504);
19608
- return addHeapObject(ret);
19609
- };
19610
19605
  imports.wbg.__wbindgen_cast_2ddd8a25ff58642a = function(arg0, arg1) {
19611
19606
  // Cast intrinsic for `I128 -> Externref`.
19612
19607
  const ret = (BigInt.asUintN(64, arg0) | (arg1 << BigInt(64)));
@@ -19619,7 +19614,7 @@ function __wbg_get_imports(memory) {
19619
19614
  };
19620
19615
  imports.wbg.__wbindgen_cast_805ada4c4be963fc = function(arg0, arg1) {
19621
19616
  // 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`.
19622
- const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7503, __wasm_bindgen_func_elem_8946);
19617
+ const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7555, __wasm_bindgen_func_elem_8995);
19623
19618
  return addHeapObject(ret);
19624
19619
  };
19625
19620
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
@@ -19629,7 +19624,7 @@ function __wbg_get_imports(memory) {
19629
19624
  };
19630
19625
  imports.wbg.__wbindgen_cast_c048d24de4cf58bb = function(arg0, arg1) {
19631
19626
  // Cast intrinsic for `Closure(Closure { dtor_idx: 395, function: Function { arguments: [Externref], shim_idx: 396, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
19632
- const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7503, __wasm_bindgen_func_elem_8946);
19627
+ const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7555, __wasm_bindgen_func_elem_8995);
19633
19628
  return addHeapObject(ret);
19634
19629
  };
19635
19630
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
@@ -19642,6 +19637,11 @@ function __wbg_get_imports(memory) {
19642
19637
  const ret = (BigInt.asUintN(64, arg0) | (BigInt.asUintN(64, arg1) << BigInt(64)));
19643
19638
  return addHeapObject(ret);
19644
19639
  };
19640
+ imports.wbg.__wbindgen_cast_f10277ab8e6ee562 = function(arg0, arg1) {
19641
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 395, function: Function { arguments: [], shim_idx: 533, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
19642
+ const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7555, __wasm_bindgen_func_elem_7556);
19643
+ return addHeapObject(ret);
19644
+ };
19645
19645
  imports.wbg.__wbindgen_link_b9f45ffe079ef2c1 = function(arg0) {
19646
19646
  const val = `onmessage = function (ev) {
19647
19647
  let [ia, index, value] = ev.data;