@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.
- package/dist/mainnet/aleo_wasm.d.ts +18 -12
- package/dist/mainnet/aleo_wasm.wasm +0 -0
- package/dist/mainnet/index.cjs +50 -40
- package/dist/mainnet/index.cjs.map +1 -1
- package/dist/mainnet/index.js +50 -40
- package/dist/mainnet/index.js.map +1 -1
- package/dist/mainnet/worker.js +50 -40
- package/dist/mainnet/worker.js.map +1 -1
- package/dist/testnet/aleo_wasm.d.ts +6 -0
- package/dist/testnet/aleo_wasm.wasm +0 -0
- package/dist/testnet/index.cjs +22 -12
- package/dist/testnet/index.cjs.map +1 -1
- package/dist/testnet/index.js +22 -12
- package/dist/testnet/index.js.map +1 -1
- package/dist/testnet/worker.js +22 -12
- package/dist/testnet/worker.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,18 +2,6 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export function runRayonThread(receiver: number): void;
|
|
4
4
|
export function initThreadPool(url: URL, num_threads: number): Promise<void>;
|
|
5
|
-
/**
|
|
6
|
-
* Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
|
|
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).
|
|
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
|
|
15
|
-
*/
|
|
16
|
-
export function snarkVerifyBatch(verifying_keys: Array<any>, inputs: Array<any>, proof: Proof): boolean;
|
|
17
5
|
/**
|
|
18
6
|
* Verify a SNARK proof against a verifying key and public inputs.
|
|
19
7
|
*
|
|
@@ -40,6 +28,18 @@ export function snarkVerify(verifying_key: VerifyingKey, inputs: Array<any>, pro
|
|
|
40
28
|
* @returns {boolean} True if the execution is valid, false otherwise
|
|
41
29
|
*/
|
|
42
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
|
+
/**
|
|
32
|
+
* Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
|
|
33
|
+
*
|
|
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
|
+
*
|
|
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
|
+
*/
|
|
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.
|
|
@@ -2813,6 +2813,12 @@ export class Program {
|
|
|
2813
2813
|
* console.log(imports === expected_imports); // Output should be "true"
|
|
2814
2814
|
*/
|
|
2815
2815
|
getImports(): Array<any>;
|
|
2816
|
+
/**
|
|
2817
|
+
* Get the checksum of the program.
|
|
2818
|
+
*
|
|
2819
|
+
* @returns {Uint8Array} The checksum of the program as a 32-byte Uint8Array
|
|
2820
|
+
*/
|
|
2821
|
+
toChecksum(): Uint8Array;
|
|
2816
2822
|
/**
|
|
2817
2823
|
* Get a the list of a program's mappings and the names/types of their keys and values.
|
|
2818
2824
|
*
|
|
Binary file
|
package/dist/mainnet/index.cjs
CHANGED
|
@@ -309,38 +309,6 @@ function addBorrowedObject(obj) {
|
|
|
309
309
|
heap[--stack_pointer] = obj;
|
|
310
310
|
return stack_pointer;
|
|
311
311
|
}
|
|
312
|
-
/**
|
|
313
|
-
* Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
|
|
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).
|
|
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
|
|
323
|
-
* @param {Array<any>} inputs
|
|
324
|
-
* @param {Proof} proof
|
|
325
|
-
* @returns {boolean}
|
|
326
|
-
*/
|
|
327
|
-
function snarkVerifyBatch(verifying_keys, inputs, proof) {
|
|
328
|
-
try {
|
|
329
|
-
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
330
|
-
_assertClass(proof, Proof);
|
|
331
|
-
wasm$1.snarkVerifyBatch(retptr, addHeapObject(verifying_keys), addHeapObject(inputs), proof.__wbg_ptr);
|
|
332
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
333
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
334
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
335
|
-
if (r2) {
|
|
336
|
-
throw takeObject(r1);
|
|
337
|
-
}
|
|
338
|
-
return r0 !== 0;
|
|
339
|
-
} finally {
|
|
340
|
-
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
|
|
344
312
|
/**
|
|
345
313
|
* Verify a SNARK proof against a verifying key and public inputs.
|
|
346
314
|
*
|
|
@@ -416,6 +384,38 @@ function verifyFunctionExecution(execution, verifying_key, program, function_id,
|
|
|
416
384
|
}
|
|
417
385
|
}
|
|
418
386
|
|
|
387
|
+
/**
|
|
388
|
+
* Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
|
|
389
|
+
*
|
|
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).
|
|
392
|
+
*
|
|
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
|
|
398
|
+
* @param {Array<any>} inputs
|
|
399
|
+
* @param {Proof} proof
|
|
400
|
+
* @returns {boolean}
|
|
401
|
+
*/
|
|
402
|
+
function snarkVerifyBatch(verifying_keys, inputs, proof) {
|
|
403
|
+
try {
|
|
404
|
+
const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
|
|
405
|
+
_assertClass(proof, Proof);
|
|
406
|
+
wasm$1.snarkVerifyBatch(retptr, addHeapObject(verifying_keys), addHeapObject(inputs), proof.__wbg_ptr);
|
|
407
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
408
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
409
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
410
|
+
if (r2) {
|
|
411
|
+
throw takeObject(r1);
|
|
412
|
+
}
|
|
413
|
+
return r0 !== 0;
|
|
414
|
+
} finally {
|
|
415
|
+
wasm$1.__wbindgen_add_to_stack_pointer(16);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
419
|
/**
|
|
420
420
|
* @param {string} string
|
|
421
421
|
* @returns {Field}
|
|
@@ -477,12 +477,12 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
477
477
|
}
|
|
478
478
|
return result;
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
wasm$1.
|
|
480
|
+
function __wasm_bindgen_func_elem_8536(arg0, arg1, arg2) {
|
|
481
|
+
wasm$1.__wasm_bindgen_func_elem_8536(arg0, arg1, addHeapObject(arg2));
|
|
482
482
|
}
|
|
483
483
|
|
|
484
|
-
function
|
|
485
|
-
wasm$1.
|
|
484
|
+
function __wasm_bindgen_func_elem_7170(arg0, arg1) {
|
|
485
|
+
wasm$1.__wasm_bindgen_func_elem_7170(arg0, arg1);
|
|
486
486
|
}
|
|
487
487
|
|
|
488
488
|
function __wasm_bindgen_func_elem_7443(arg0, arg1, arg2, arg3) {
|
|
@@ -9876,6 +9876,16 @@ class Program {
|
|
|
9876
9876
|
const ret = wasm$1.program_getImports(this.__wbg_ptr);
|
|
9877
9877
|
return takeObject(ret);
|
|
9878
9878
|
}
|
|
9879
|
+
/**
|
|
9880
|
+
* Get the checksum of the program.
|
|
9881
|
+
*
|
|
9882
|
+
* @returns {Uint8Array} The checksum of the program as a 32-byte Uint8Array
|
|
9883
|
+
* @returns {Uint8Array}
|
|
9884
|
+
*/
|
|
9885
|
+
toChecksum() {
|
|
9886
|
+
const ret = wasm$1.program_toChecksum(this.__wbg_ptr);
|
|
9887
|
+
return takeObject(ret);
|
|
9888
|
+
}
|
|
9879
9889
|
/**
|
|
9880
9890
|
* Get a the list of a program's mappings and the names/types of their keys and values.
|
|
9881
9891
|
*
|
|
@@ -18342,7 +18352,7 @@ function __wbg_get_imports(memory) {
|
|
|
18342
18352
|
const ret = getObject(arg0).length;
|
|
18343
18353
|
return ret;
|
|
18344
18354
|
};
|
|
18345
|
-
imports.wbg.
|
|
18355
|
+
imports.wbg.__wbg_log_4688d4dee83f4df4 = function(arg0, arg1) {
|
|
18346
18356
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
18347
18357
|
};
|
|
18348
18358
|
imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
@@ -18551,7 +18561,7 @@ function __wbg_get_imports(memory) {
|
|
|
18551
18561
|
const ret = Signature.__wrap(arg0);
|
|
18552
18562
|
return addHeapObject(ret);
|
|
18553
18563
|
};
|
|
18554
|
-
imports.wbg.
|
|
18564
|
+
imports.wbg.__wbg_spawnWorker_9ce4a98fc7b6f238 = function(arg0, arg1, arg2, arg3) {
|
|
18555
18565
|
const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
|
|
18556
18566
|
return addHeapObject(ret);
|
|
18557
18567
|
};
|
|
@@ -18658,7 +18668,7 @@ function __wbg_get_imports(memory) {
|
|
|
18658
18668
|
};
|
|
18659
18669
|
imports.wbg.__wbindgen_cast_711d7deea8fc39ca = function(arg0, arg1) {
|
|
18660
18670
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [Externref], shim_idx: 357, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18661
|
-
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7169,
|
|
18671
|
+
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7169, __wasm_bindgen_func_elem_8536);
|
|
18662
18672
|
return addHeapObject(ret);
|
|
18663
18673
|
};
|
|
18664
18674
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
@@ -18673,7 +18683,7 @@ function __wbg_get_imports(memory) {
|
|
|
18673
18683
|
};
|
|
18674
18684
|
imports.wbg.__wbindgen_cast_cada7727142cd213 = function(arg0, arg1) {
|
|
18675
18685
|
// 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`.
|
|
18676
|
-
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7169,
|
|
18686
|
+
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7169, __wasm_bindgen_func_elem_8536);
|
|
18677
18687
|
return addHeapObject(ret);
|
|
18678
18688
|
};
|
|
18679
18689
|
imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|