@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.
@@ -3,17 +3,17 @@
3
3
  export function runRayonThread(receiver: number): void;
4
4
  export function initThreadPool(url: URL, num_threads: number): Promise<void>;
5
5
  /**
6
- * Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
6
+ * Verify a SNARK proof against a verifying key and public inputs.
7
7
  *
8
- * This function verifies a batch proof produced by Aleo programs that may not be deployed on chain.
9
- * Each verifying key is paired with one or more sets of public inputs (instances).
8
+ * This function verifies a proof produced by an Aleo program that may not be deployed on chain.
9
+ * It directly invokes the Varuna proof verification from snarkVM.
10
10
  *
11
- * @param {Array<string>} verifying_keys Array of verifying key strings, one per circuit
12
- * @param {Array<Array<Array<string>>>} inputs 3D array of field element strings [circuit_idx][instance_idx][field_idx]
13
- * @param {Proof} proof The batch proof to verify
14
- * @returns {boolean} True if the batch proof is valid, false otherwise
11
+ * @param {VerifyingKey} verifying_key The verifying key for the circuit
12
+ * @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
13
+ * @param {Proof} proof The proof to verify
14
+ * @returns {boolean} True if the proof is valid, false otherwise
15
15
  */
16
- export function snarkVerifyBatch(verifying_keys: Array<any>, inputs: Array<any>, proof: Proof): boolean;
16
+ export function snarkVerify(verifying_key: VerifyingKey, inputs: Array<any>, proof: Proof): boolean;
17
17
  /**
18
18
  * Verify an execution. Executions with multiple transitions must have the program source code and
19
19
  * verifying keys of imported functions supplied from outside to correctly verify. Also, this does
@@ -29,17 +29,17 @@ export function snarkVerifyBatch(verifying_keys: Array<any>, inputs: Array<any>,
29
29
  */
30
30
  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): boolean;
31
31
  /**
32
- * Verify a SNARK proof against a verifying key and public inputs.
32
+ * Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
33
33
  *
34
- * This function verifies a proof produced by an Aleo program that may not be deployed on chain.
35
- * It directly invokes the Varuna proof verification from snarkVM.
34
+ * This function verifies a batch proof produced by Aleo programs that may not be deployed on chain.
35
+ * Each verifying key is paired with one or more sets of public inputs (instances).
36
36
  *
37
- * @param {VerifyingKey} verifying_key The verifying key for the circuit
38
- * @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
39
- * @param {Proof} proof The proof to verify
40
- * @returns {boolean} True if the proof is valid, false otherwise
37
+ * @param {Array<string>} verifying_keys Array of verifying key strings, one per circuit
38
+ * @param {Array<Array<Array<string>>>} inputs 3D array of field element strings [circuit_idx][instance_idx][field_idx]
39
+ * @param {Proof} proof The batch proof to verify
40
+ * @returns {boolean} True if the batch proof is valid, false otherwise
41
41
  */
42
- export function snarkVerify(verifying_key: VerifyingKey, inputs: Array<any>, proof: Proof): boolean;
42
+ export function snarkVerifyBatch(verifying_keys: Array<any>, inputs: Array<any>, proof: Proof): boolean;
43
43
  export function stringToField(string: string): Field;
44
44
  /**
45
45
  * Set test consensus version heights for testing.
Binary file
@@ -310,25 +310,26 @@ function addBorrowedObject(obj) {
310
310
  return stack_pointer;
311
311
  }
312
312
  /**
313
- * Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
313
+ * Verify a SNARK proof against a verifying key and public inputs.
314
314
  *
315
- * This function verifies a batch proof produced by Aleo programs that may not be deployed on chain.
316
- * Each verifying key is paired with one or more sets of public inputs (instances).
315
+ * This function verifies a proof produced by an Aleo program that may not be deployed on chain.
316
+ * It directly invokes the Varuna proof verification from snarkVM.
317
317
  *
318
- * @param {Array<string>} verifying_keys Array of verifying key strings, one per circuit
319
- * @param {Array<Array<Array<string>>>} inputs 3D array of field element strings [circuit_idx][instance_idx][field_idx]
320
- * @param {Proof} proof The batch proof to verify
321
- * @returns {boolean} True if the batch proof is valid, false otherwise
322
- * @param {Array<any>} verifying_keys
318
+ * @param {VerifyingKey} verifying_key The verifying key for the circuit
319
+ * @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
320
+ * @param {Proof} proof The proof to verify
321
+ * @returns {boolean} True if the proof is valid, false otherwise
322
+ * @param {VerifyingKey} verifying_key
323
323
  * @param {Array<any>} inputs
324
324
  * @param {Proof} proof
325
325
  * @returns {boolean}
326
326
  */
327
- function snarkVerifyBatch(verifying_keys, inputs, proof) {
327
+ function snarkVerify(verifying_key, inputs, proof) {
328
328
  try {
329
329
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
330
+ _assertClass(verifying_key, VerifyingKey);
330
331
  _assertClass(proof, Proof);
331
- wasm$1.snarkVerifyBatch(retptr, addHeapObject(verifying_keys), addHeapObject(inputs), proof.__wbg_ptr);
332
+ wasm$1.snarkVerify(retptr, verifying_key.__wbg_ptr, addHeapObject(inputs), proof.__wbg_ptr);
332
333
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
333
334
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
334
335
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -384,26 +385,25 @@ function verifyFunctionExecution(execution, verifying_key, program, function_id,
384
385
  }
385
386
 
386
387
  /**
387
- * Verify a SNARK proof against a verifying key and public inputs.
388
+ * Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
388
389
  *
389
- * This function verifies a proof produced by an Aleo program that may not be deployed on chain.
390
- * It directly invokes the Varuna proof verification from snarkVM.
390
+ * This function verifies a batch proof produced by Aleo programs that may not be deployed on chain.
391
+ * Each verifying key is paired with one or more sets of public inputs (instances).
391
392
  *
392
- * @param {VerifyingKey} verifying_key The verifying key for the circuit
393
- * @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
394
- * @param {Proof} proof The proof to verify
395
- * @returns {boolean} True if the proof is valid, false otherwise
396
- * @param {VerifyingKey} verifying_key
393
+ * @param {Array<string>} verifying_keys Array of verifying key strings, one per circuit
394
+ * @param {Array<Array<Array<string>>>} inputs 3D array of field element strings [circuit_idx][instance_idx][field_idx]
395
+ * @param {Proof} proof The batch proof to verify
396
+ * @returns {boolean} True if the batch proof is valid, false otherwise
397
+ * @param {Array<any>} verifying_keys
397
398
  * @param {Array<any>} inputs
398
399
  * @param {Proof} proof
399
400
  * @returns {boolean}
400
401
  */
401
- function snarkVerify(verifying_key, inputs, proof) {
402
+ function snarkVerifyBatch(verifying_keys, inputs, proof) {
402
403
  try {
403
404
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
404
- _assertClass(verifying_key, VerifyingKey);
405
405
  _assertClass(proof, Proof);
406
- wasm$1.snarkVerify(retptr, verifying_key.__wbg_ptr, addHeapObject(inputs), proof.__wbg_ptr);
406
+ wasm$1.snarkVerifyBatch(retptr, addHeapObject(verifying_keys), addHeapObject(inputs), proof.__wbg_ptr);
407
407
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
408
408
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
409
409
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -477,16 +477,16 @@ function getArrayJsValueFromWasm0(ptr, len) {
477
477
  }
478
478
  return result;
479
479
  }
480
- function __wasm_bindgen_func_elem_8577(arg0, arg1, arg2) {
481
- wasm$1.__wasm_bindgen_func_elem_8577(arg0, arg1, addHeapObject(arg2));
480
+ function __wasm_bindgen_func_elem_7206(arg0, arg1) {
481
+ wasm$1.__wasm_bindgen_func_elem_7206(arg0, arg1);
482
482
  }
483
483
 
484
- function __wasm_bindgen_func_elem_7212(arg0, arg1) {
485
- wasm$1.__wasm_bindgen_func_elem_7212(arg0, arg1);
484
+ function __wasm_bindgen_func_elem_8569(arg0, arg1, arg2) {
485
+ wasm$1.__wasm_bindgen_func_elem_8569(arg0, arg1, addHeapObject(arg2));
486
486
  }
487
487
 
488
- function __wasm_bindgen_func_elem_7484(arg0, arg1, arg2, arg3) {
489
- wasm$1.__wasm_bindgen_func_elem_7484(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
488
+ function __wasm_bindgen_func_elem_7479(arg0, arg1, arg2, arg3) {
489
+ wasm$1.__wasm_bindgen_func_elem_7479(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
490
490
  }
491
491
 
492
492
  const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
@@ -18518,7 +18518,7 @@ function __wbg_get_imports(memory) {
18518
18518
  const ret = getObject(arg0).length;
18519
18519
  return ret;
18520
18520
  };
18521
- imports.wbg.__wbg_log_22dee88c33d8b7ed = function(arg0, arg1) {
18521
+ imports.wbg.__wbg_log_78f898e0b3066062 = function(arg0, arg1) {
18522
18522
  console.log(getStringFromWasm0(arg0, arg1));
18523
18523
  };
18524
18524
  imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
@@ -18540,7 +18540,7 @@ function __wbg_get_imports(memory) {
18540
18540
  const a = state0.a;
18541
18541
  state0.a = 0;
18542
18542
  try {
18543
- return __wasm_bindgen_func_elem_7484(a, state0.b, arg0, arg1);
18543
+ return __wasm_bindgen_func_elem_7479(a, state0.b, arg0, arg1);
18544
18544
  } finally {
18545
18545
  state0.a = a;
18546
18546
  }
@@ -18727,7 +18727,7 @@ function __wbg_get_imports(memory) {
18727
18727
  const ret = Signature.__wrap(arg0);
18728
18728
  return addHeapObject(ret);
18729
18729
  };
18730
- imports.wbg.__wbg_spawnWorker_33cc8ce5f9639974 = function(arg0, arg1, arg2, arg3) {
18730
+ imports.wbg.__wbg_spawnWorker_16cedfb6613c80ac = function(arg0, arg1, arg2, arg3) {
18731
18731
  const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
18732
18732
  return addHeapObject(ret);
18733
18733
  };
@@ -18822,36 +18822,36 @@ function __wbg_get_imports(memory) {
18822
18822
  const ret = getStringFromWasm0(arg0, arg1);
18823
18823
  return addHeapObject(ret);
18824
18824
  };
18825
- imports.wbg.__wbindgen_cast_28475d7a0f25a997 = function(arg0, arg1) {
18826
- // Cast intrinsic for `Closure(Closure { dtor_idx: 357, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 358, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18827
- const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7211, __wasm_bindgen_func_elem_8577);
18828
- return addHeapObject(ret);
18829
- };
18830
- imports.wbg.__wbindgen_cast_2c5fc068add553f7 = function(arg0, arg1) {
18831
- // Cast intrinsic for `Closure(Closure { dtor_idx: 357, function: Function { arguments: [], shim_idx: 465, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18832
- const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7211, __wasm_bindgen_func_elem_7212);
18833
- return addHeapObject(ret);
18834
- };
18835
18825
  imports.wbg.__wbindgen_cast_2ddd8a25ff58642a = function(arg0, arg1) {
18836
18826
  // Cast intrinsic for `I128 -> Externref`.
18837
18827
  const ret = (BigInt.asUintN(64, arg0) | (arg1 << BigInt(64)));
18838
18828
  return addHeapObject(ret);
18839
18829
  };
18830
+ imports.wbg.__wbindgen_cast_3ebebf8ee554379e = function(arg0, arg1) {
18831
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 354, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 355, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18832
+ const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7205, __wasm_bindgen_func_elem_8569);
18833
+ return addHeapObject(ret);
18834
+ };
18840
18835
  imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
18841
18836
  // Cast intrinsic for `U64 -> Externref`.
18842
18837
  const ret = BigInt.asUintN(64, arg0);
18843
18838
  return addHeapObject(ret);
18844
18839
  };
18840
+ imports.wbg.__wbindgen_cast_5e9bcb6388942484 = function(arg0, arg1) {
18841
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 354, function: Function { arguments: [], shim_idx: 462, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18842
+ const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7205, __wasm_bindgen_func_elem_7206);
18843
+ return addHeapObject(ret);
18844
+ };
18845
+ imports.wbg.__wbindgen_cast_74f3a90a349943d1 = function(arg0, arg1) {
18846
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 354, function: Function { arguments: [Externref], shim_idx: 355, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18847
+ const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7205, __wasm_bindgen_func_elem_8569);
18848
+ return addHeapObject(ret);
18849
+ };
18845
18850
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
18846
18851
  // Cast intrinsic for `I64 -> Externref`.
18847
18852
  const ret = arg0;
18848
18853
  return addHeapObject(ret);
18849
18854
  };
18850
- imports.wbg.__wbindgen_cast_b1bcbba6fa3c236c = function(arg0, arg1) {
18851
- // Cast intrinsic for `Closure(Closure { dtor_idx: 357, function: Function { arguments: [Externref], shim_idx: 358, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18852
- const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7211, __wasm_bindgen_func_elem_8577);
18853
- return addHeapObject(ret);
18854
- };
18855
18855
  imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
18856
18856
  // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
18857
18857
  const ret = getArrayU8FromWasm0(arg0, arg1);