@provablehq/wasm 0.10.1 → 0.10.2
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 +16 -16
- package/dist/mainnet/aleo_wasm.wasm +0 -0
- package/dist/mainnet/index.js +33 -33
- package/dist/mainnet/index.js.map +1 -1
- package/dist/mainnet/worker.js +33 -33
- package/dist/mainnet/worker.js.map +1 -1
- package/dist/testnet/aleo_wasm.d.ts +13 -13
- package/dist/testnet/aleo_wasm.wasm +0 -0
- package/dist/testnet/index.js +58 -58
- package/dist/testnet/index.js.map +1 -1
- package/dist/testnet/worker.js +58 -58
- package/dist/testnet/worker.js.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
6
|
+
* Verify a SNARK proof against a verifying key and public inputs.
|
|
7
7
|
*
|
|
8
|
-
* This function verifies a
|
|
9
|
-
*
|
|
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 {
|
|
12
|
-
* @param {Array<
|
|
13
|
-
* @param {Proof} proof The
|
|
14
|
-
* @returns {boolean} True if the
|
|
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
|
|
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
|
|
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
|
|
35
|
-
*
|
|
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 {
|
|
38
|
-
* @param {Array<string
|
|
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
|
|
42
|
+
export function snarkVerifyBatch(verifying_keys: Array<any>, inputs: Array<any>, proof: Proof): boolean;
|
|
43
43
|
/**
|
|
44
44
|
* Set test consensus version heights for testing.
|
|
45
45
|
*
|
|
Binary file
|
package/dist/mainnet/index.js
CHANGED
|
@@ -304,25 +304,26 @@ function addBorrowedObject(obj) {
|
|
|
304
304
|
return stack_pointer;
|
|
305
305
|
}
|
|
306
306
|
/**
|
|
307
|
-
* Verify a
|
|
307
|
+
* Verify a SNARK proof against a verifying key and public inputs.
|
|
308
308
|
*
|
|
309
|
-
* This function verifies a
|
|
310
|
-
*
|
|
309
|
+
* This function verifies a proof produced by an Aleo program that may not be deployed on chain.
|
|
310
|
+
* It directly invokes the Varuna proof verification from snarkVM.
|
|
311
311
|
*
|
|
312
|
-
* @param {
|
|
313
|
-
* @param {Array<
|
|
314
|
-
* @param {Proof} proof The
|
|
315
|
-
* @returns {boolean} True if the
|
|
316
|
-
* @param {
|
|
312
|
+
* @param {VerifyingKey} verifying_key The verifying key for the circuit
|
|
313
|
+
* @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. ["1field", "2field"])
|
|
314
|
+
* @param {Proof} proof The proof to verify
|
|
315
|
+
* @returns {boolean} True if the proof is valid, false otherwise
|
|
316
|
+
* @param {VerifyingKey} verifying_key
|
|
317
317
|
* @param {Array<any>} inputs
|
|
318
318
|
* @param {Proof} proof
|
|
319
319
|
* @returns {boolean}
|
|
320
320
|
*/
|
|
321
|
-
function
|
|
321
|
+
function snarkVerify(verifying_key, inputs, proof) {
|
|
322
322
|
try {
|
|
323
323
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
324
|
+
_assertClass(verifying_key, VerifyingKey);
|
|
324
325
|
_assertClass(proof, Proof);
|
|
325
|
-
wasm.
|
|
326
|
+
wasm.snarkVerify(retptr, verifying_key.__wbg_ptr, addHeapObject(inputs), proof.__wbg_ptr);
|
|
326
327
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
327
328
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
328
329
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -378,26 +379,25 @@ function verifyFunctionExecution(execution, verifying_key, program, function_id,
|
|
|
378
379
|
}
|
|
379
380
|
|
|
380
381
|
/**
|
|
381
|
-
* Verify a SNARK proof against
|
|
382
|
+
* Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.
|
|
382
383
|
*
|
|
383
|
-
* This function verifies a proof produced by
|
|
384
|
-
*
|
|
384
|
+
* This function verifies a batch proof produced by Aleo programs that may not be deployed on chain.
|
|
385
|
+
* Each verifying key is paired with one or more sets of public inputs (instances).
|
|
385
386
|
*
|
|
386
|
-
* @param {
|
|
387
|
-
* @param {Array<string
|
|
388
|
-
* @param {Proof} proof The proof to verify
|
|
389
|
-
* @returns {boolean} True if the proof is valid, false otherwise
|
|
390
|
-
* @param {
|
|
387
|
+
* @param {Array<string>} verifying_keys Array of verifying key strings, one per circuit
|
|
388
|
+
* @param {Array<Array<Array<string>>>} inputs 3D array of field element strings [circuit_idx][instance_idx][field_idx]
|
|
389
|
+
* @param {Proof} proof The batch proof to verify
|
|
390
|
+
* @returns {boolean} True if the batch proof is valid, false otherwise
|
|
391
|
+
* @param {Array<any>} verifying_keys
|
|
391
392
|
* @param {Array<any>} inputs
|
|
392
393
|
* @param {Proof} proof
|
|
393
394
|
* @returns {boolean}
|
|
394
395
|
*/
|
|
395
|
-
function
|
|
396
|
+
function snarkVerifyBatch(verifying_keys, inputs, proof) {
|
|
396
397
|
try {
|
|
397
398
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
398
|
-
_assertClass(verifying_key, VerifyingKey);
|
|
399
399
|
_assertClass(proof, Proof);
|
|
400
|
-
wasm.
|
|
400
|
+
wasm.snarkVerifyBatch(retptr, addHeapObject(verifying_keys), addHeapObject(inputs), proof.__wbg_ptr);
|
|
401
401
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
402
402
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
403
403
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -471,16 +471,16 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
471
471
|
}
|
|
472
472
|
return result;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
wasm.
|
|
474
|
+
function __wasm_bindgen_func_elem_8534(arg0, arg1, arg2) {
|
|
475
|
+
wasm.__wasm_bindgen_func_elem_8534(arg0, arg1, addHeapObject(arg2));
|
|
476
476
|
}
|
|
477
477
|
|
|
478
|
-
function
|
|
479
|
-
wasm.
|
|
478
|
+
function __wasm_bindgen_func_elem_7174(arg0, arg1) {
|
|
479
|
+
wasm.__wasm_bindgen_func_elem_7174(arg0, arg1);
|
|
480
480
|
}
|
|
481
481
|
|
|
482
|
-
function
|
|
483
|
-
wasm.
|
|
482
|
+
function __wasm_bindgen_func_elem_7445(arg0, arg1, arg2, arg3) {
|
|
483
|
+
wasm.__wasm_bindgen_func_elem_7445(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
484
484
|
}
|
|
485
485
|
|
|
486
486
|
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -18336,7 +18336,7 @@ function __wbg_get_imports(memory) {
|
|
|
18336
18336
|
const ret = getObject(arg0).length;
|
|
18337
18337
|
return ret;
|
|
18338
18338
|
};
|
|
18339
|
-
imports.wbg.
|
|
18339
|
+
imports.wbg.__wbg_log_8439fc9fbc2e093e = function(arg0, arg1) {
|
|
18340
18340
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
18341
18341
|
};
|
|
18342
18342
|
imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
@@ -18358,7 +18358,7 @@ function __wbg_get_imports(memory) {
|
|
|
18358
18358
|
const a = state0.a;
|
|
18359
18359
|
state0.a = 0;
|
|
18360
18360
|
try {
|
|
18361
|
-
return
|
|
18361
|
+
return __wasm_bindgen_func_elem_7445(a, state0.b, arg0, arg1);
|
|
18362
18362
|
} finally {
|
|
18363
18363
|
state0.a = a;
|
|
18364
18364
|
}
|
|
@@ -18545,7 +18545,7 @@ function __wbg_get_imports(memory) {
|
|
|
18545
18545
|
const ret = Signature.__wrap(arg0);
|
|
18546
18546
|
return addHeapObject(ret);
|
|
18547
18547
|
};
|
|
18548
|
-
imports.wbg.
|
|
18548
|
+
imports.wbg.__wbg_spawnWorker_e4acc8b34866a9bd = function(arg0, arg1, arg2, arg3) {
|
|
18549
18549
|
const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
|
|
18550
18550
|
return addHeapObject(ret);
|
|
18551
18551
|
};
|
|
@@ -18652,7 +18652,7 @@ function __wbg_get_imports(memory) {
|
|
|
18652
18652
|
};
|
|
18653
18653
|
imports.wbg.__wbindgen_cast_711d7deea8fc39ca = function(arg0, arg1) {
|
|
18654
18654
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [Externref], shim_idx: 357, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18655
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
18655
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7173, __wasm_bindgen_func_elem_8534);
|
|
18656
18656
|
return addHeapObject(ret);
|
|
18657
18657
|
};
|
|
18658
18658
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
@@ -18662,12 +18662,12 @@ function __wbg_get_imports(memory) {
|
|
|
18662
18662
|
};
|
|
18663
18663
|
imports.wbg.__wbindgen_cast_bff04fdc9653fdb7 = function(arg0, arg1) {
|
|
18664
18664
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [], shim_idx: 465, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18665
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
18665
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7173, __wasm_bindgen_func_elem_7174);
|
|
18666
18666
|
return addHeapObject(ret);
|
|
18667
18667
|
};
|
|
18668
18668
|
imports.wbg.__wbindgen_cast_cada7727142cd213 = function(arg0, arg1) {
|
|
18669
18669
|
// 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`.
|
|
18670
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
18670
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7173, __wasm_bindgen_func_elem_8534);
|
|
18671
18671
|
return addHeapObject(ret);
|
|
18672
18672
|
};
|
|
18673
18673
|
imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|