@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
package/dist/mainnet/worker.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_7206(arg0, arg1) {
|
|
475
|
+
wasm.__wasm_bindgen_func_elem_7206(arg0, arg1);
|
|
476
476
|
}
|
|
477
477
|
|
|
478
|
-
function
|
|
479
|
-
wasm.
|
|
478
|
+
function __wasm_bindgen_func_elem_8569(arg0, arg1, arg2) {
|
|
479
|
+
wasm.__wasm_bindgen_func_elem_8569(arg0, arg1, addHeapObject(arg2));
|
|
480
480
|
}
|
|
481
481
|
|
|
482
|
-
function
|
|
483
|
-
wasm.
|
|
482
|
+
function __wasm_bindgen_func_elem_7479(arg0, arg1, arg2, arg3) {
|
|
483
|
+
wasm.__wasm_bindgen_func_elem_7479(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
484
484
|
}
|
|
485
485
|
|
|
486
486
|
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -18512,7 +18512,7 @@ function __wbg_get_imports(memory) {
|
|
|
18512
18512
|
const ret = getObject(arg0).length;
|
|
18513
18513
|
return ret;
|
|
18514
18514
|
};
|
|
18515
|
-
imports.wbg.
|
|
18515
|
+
imports.wbg.__wbg_log_78f898e0b3066062 = function(arg0, arg1) {
|
|
18516
18516
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
18517
18517
|
};
|
|
18518
18518
|
imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
@@ -18534,7 +18534,7 @@ function __wbg_get_imports(memory) {
|
|
|
18534
18534
|
const a = state0.a;
|
|
18535
18535
|
state0.a = 0;
|
|
18536
18536
|
try {
|
|
18537
|
-
return
|
|
18537
|
+
return __wasm_bindgen_func_elem_7479(a, state0.b, arg0, arg1);
|
|
18538
18538
|
} finally {
|
|
18539
18539
|
state0.a = a;
|
|
18540
18540
|
}
|
|
@@ -18721,7 +18721,7 @@ function __wbg_get_imports(memory) {
|
|
|
18721
18721
|
const ret = Signature.__wrap(arg0);
|
|
18722
18722
|
return addHeapObject(ret);
|
|
18723
18723
|
};
|
|
18724
|
-
imports.wbg.
|
|
18724
|
+
imports.wbg.__wbg_spawnWorker_16cedfb6613c80ac = function(arg0, arg1, arg2, arg3) {
|
|
18725
18725
|
const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
|
|
18726
18726
|
return addHeapObject(ret);
|
|
18727
18727
|
};
|
|
@@ -18816,36 +18816,36 @@ function __wbg_get_imports(memory) {
|
|
|
18816
18816
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
18817
18817
|
return addHeapObject(ret);
|
|
18818
18818
|
};
|
|
18819
|
-
imports.wbg.__wbindgen_cast_28475d7a0f25a997 = function(arg0, arg1) {
|
|
18820
|
-
// 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`.
|
|
18821
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7211, __wasm_bindgen_func_elem_8577);
|
|
18822
|
-
return addHeapObject(ret);
|
|
18823
|
-
};
|
|
18824
|
-
imports.wbg.__wbindgen_cast_2c5fc068add553f7 = function(arg0, arg1) {
|
|
18825
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 357, function: Function { arguments: [], shim_idx: 465, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18826
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7211, __wasm_bindgen_func_elem_7212);
|
|
18827
|
-
return addHeapObject(ret);
|
|
18828
|
-
};
|
|
18829
18819
|
imports.wbg.__wbindgen_cast_2ddd8a25ff58642a = function(arg0, arg1) {
|
|
18830
18820
|
// Cast intrinsic for `I128 -> Externref`.
|
|
18831
18821
|
const ret = (BigInt.asUintN(64, arg0) | (arg1 << BigInt(64)));
|
|
18832
18822
|
return addHeapObject(ret);
|
|
18833
18823
|
};
|
|
18824
|
+
imports.wbg.__wbindgen_cast_3ebebf8ee554379e = function(arg0, arg1) {
|
|
18825
|
+
// 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`.
|
|
18826
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7205, __wasm_bindgen_func_elem_8569);
|
|
18827
|
+
return addHeapObject(ret);
|
|
18828
|
+
};
|
|
18834
18829
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
18835
18830
|
// Cast intrinsic for `U64 -> Externref`.
|
|
18836
18831
|
const ret = BigInt.asUintN(64, arg0);
|
|
18837
18832
|
return addHeapObject(ret);
|
|
18838
18833
|
};
|
|
18834
|
+
imports.wbg.__wbindgen_cast_5e9bcb6388942484 = function(arg0, arg1) {
|
|
18835
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 354, function: Function { arguments: [], shim_idx: 462, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18836
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7205, __wasm_bindgen_func_elem_7206);
|
|
18837
|
+
return addHeapObject(ret);
|
|
18838
|
+
};
|
|
18839
|
+
imports.wbg.__wbindgen_cast_74f3a90a349943d1 = function(arg0, arg1) {
|
|
18840
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 354, function: Function { arguments: [Externref], shim_idx: 355, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18841
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7205, __wasm_bindgen_func_elem_8569);
|
|
18842
|
+
return addHeapObject(ret);
|
|
18843
|
+
};
|
|
18839
18844
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
18840
18845
|
// Cast intrinsic for `I64 -> Externref`.
|
|
18841
18846
|
const ret = arg0;
|
|
18842
18847
|
return addHeapObject(ret);
|
|
18843
18848
|
};
|
|
18844
|
-
imports.wbg.__wbindgen_cast_b1bcbba6fa3c236c = function(arg0, arg1) {
|
|
18845
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 357, function: Function { arguments: [Externref], shim_idx: 358, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
18846
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_7211, __wasm_bindgen_func_elem_8577);
|
|
18847
|
-
return addHeapObject(ret);
|
|
18848
|
-
};
|
|
18849
18849
|
imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|
|
18850
18850
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
18851
18851
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|