@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.
- package/dist/mainnet/aleo_wasm.d.ts +16 -16
- package/dist/mainnet/aleo_wasm.wasm +0 -0
- package/dist/mainnet/index.cjs +45 -45
- package/dist/mainnet/index.cjs.map +1 -1
- package/dist/mainnet/index.js +45 -45
- package/dist/mainnet/index.js.map +1 -1
- package/dist/mainnet/worker.js +45 -45
- package/dist/mainnet/worker.js.map +1 -1
- package/dist/testnet/aleo_wasm.d.ts +12 -12
- package/dist/testnet/aleo_wasm.wasm +0 -0
- package/dist/testnet/index.cjs +54 -54
- package/dist/testnet/index.cjs.map +1 -1
- package/dist/testnet/index.js +54 -54
- package/dist/testnet/index.js.map +1 -1
- package/dist/testnet/worker.js +54 -54
- 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 an execution. Executions with multiple transitions must have the program source code and
|
|
19
7
|
* verifying keys of imported functions supplied from outside to correctly verify. Also, this does
|
|
@@ -40,6 +28,18 @@ export function verifyFunctionExecution(execution: Execution, verifying_key: Ver
|
|
|
40
28
|
* @returns {boolean} True if the proof is valid, false otherwise
|
|
41
29
|
*/
|
|
42
30
|
export function snarkVerify(verifying_key: VerifyingKey, inputs: Array<any>, proof: Proof): 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.
|
|
Binary file
|
package/dist/testnet/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 an execution. Executions with multiple transitions must have the program source code and
|
|
346
314
|
* verifying keys of imported functions supplied from outside to correctly verify. Also, this does
|
|
@@ -416,6 +384,38 @@ function snarkVerify(verifying_key, inputs, proof) {
|
|
|
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,16 +477,16 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
477
477
|
}
|
|
478
478
|
return result;
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
wasm$1.
|
|
480
|
+
function __wasm_bindgen_func_elem_7201(arg0, arg1) {
|
|
481
|
+
wasm$1.__wasm_bindgen_func_elem_7201(arg0, arg1);
|
|
482
482
|
}
|
|
483
483
|
|
|
484
|
-
function
|
|
485
|
-
wasm$1.
|
|
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
|
|
489
|
-
wasm$1.
|
|
488
|
+
function __wasm_bindgen_func_elem_7473(arg0, arg1, arg2, arg3) {
|
|
489
|
+
wasm$1.__wasm_bindgen_func_elem_7473(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.
|
|
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
|
|
18543
|
+
return __wasm_bindgen_func_elem_7473(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.
|
|
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
|
};
|
|
@@ -18827,19 +18827,14 @@ function __wbg_get_imports(memory) {
|
|
|
18827
18827
|
const ret = (BigInt.asUintN(64, arg0) | (arg1 << BigInt(64)));
|
|
18828
18828
|
return addHeapObject(ret);
|
|
18829
18829
|
};
|
|
18830
|
-
imports.wbg.__wbindgen_cast_32a97a33ade320ff = function(arg0, arg1) {
|
|
18831
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 359, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 360, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18832
|
-
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7219, __wasm_bindgen_func_elem_8577);
|
|
18833
|
-
return addHeapObject(ret);
|
|
18834
|
-
};
|
|
18835
18830
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
18836
18831
|
// Cast intrinsic for `U64 -> Externref`.
|
|
18837
18832
|
const ret = BigInt.asUintN(64, arg0);
|
|
18838
18833
|
return addHeapObject(ret);
|
|
18839
18834
|
};
|
|
18840
|
-
imports.wbg.
|
|
18841
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
18842
|
-
const ret = makeMutClosure(arg0, arg1, wasm$1.
|
|
18835
|
+
imports.wbg.__wbindgen_cast_711d7deea8fc39ca = function(arg0, arg1) {
|
|
18836
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [Externref], shim_idx: 357, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18837
|
+
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7200, __wasm_bindgen_func_elem_8569);
|
|
18843
18838
|
return addHeapObject(ret);
|
|
18844
18839
|
};
|
|
18845
18840
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
@@ -18847,21 +18842,26 @@ function __wbg_get_imports(memory) {
|
|
|
18847
18842
|
const ret = arg0;
|
|
18848
18843
|
return addHeapObject(ret);
|
|
18849
18844
|
};
|
|
18845
|
+
imports.wbg.__wbindgen_cast_cada7727142cd213 = function(arg0, arg1) {
|
|
18846
|
+
// 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`.
|
|
18847
|
+
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7200, __wasm_bindgen_func_elem_8569);
|
|
18848
|
+
return addHeapObject(ret);
|
|
18849
|
+
};
|
|
18850
18850
|
imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|
|
18851
18851
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
18852
18852
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
18853
18853
|
return addHeapObject(ret);
|
|
18854
18854
|
};
|
|
18855
|
+
imports.wbg.__wbindgen_cast_cdf07f87b2615f8c = function(arg0, arg1) {
|
|
18856
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [], shim_idx: 462, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18857
|
+
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7200, __wasm_bindgen_func_elem_7201);
|
|
18858
|
+
return addHeapObject(ret);
|
|
18859
|
+
};
|
|
18855
18860
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
18856
18861
|
// Cast intrinsic for `F64 -> Externref`.
|
|
18857
18862
|
const ret = arg0;
|
|
18858
18863
|
return addHeapObject(ret);
|
|
18859
18864
|
};
|
|
18860
|
-
imports.wbg.__wbindgen_cast_e424aac48c10ba33 = function(arg0, arg1) {
|
|
18861
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 359, function: Function { arguments: [Externref], shim_idx: 360, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18862
|
-
const ret = makeMutClosure(arg0, arg1, wasm$1.__wasm_bindgen_func_elem_7219, __wasm_bindgen_func_elem_8577);
|
|
18863
|
-
return addHeapObject(ret);
|
|
18864
|
-
};
|
|
18865
18865
|
imports.wbg.__wbindgen_cast_e7b45dd881f38ce3 = function(arg0, arg1) {
|
|
18866
18866
|
// Cast intrinsic for `U128 -> Externref`.
|
|
18867
18867
|
const ret = (BigInt.asUintN(64, arg0) | (BigInt.asUintN(64, arg1) << BigInt(64)));
|