@typeberry/native 0.2.0-bd1a174 → 0.2.0-e2a2c06
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.
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
//#region bandersnatch/wasm-binding/pkg/bandersnatch_wasm.js
|
|
2
2
|
/**
|
|
3
|
+
* @param {Uint8Array} ring_keys
|
|
4
|
+
* @param {number} prover_key_index
|
|
5
|
+
* @param {Uint8Array} secret_seed
|
|
6
|
+
* @param {Uint8Array} inputs_data
|
|
7
|
+
* @param {number} vrf_input_data_len
|
|
8
|
+
* @returns {Uint8Array}
|
|
9
|
+
*/
|
|
10
|
+
function batch_generate_ring_vrf(ring_keys, prover_key_index, secret_seed, inputs_data, vrf_input_data_len) {
|
|
11
|
+
const ptr0 = passArray8ToWasm0(ring_keys, wasm.__wbindgen_malloc);
|
|
12
|
+
const len0 = WASM_VECTOR_LEN;
|
|
13
|
+
const ptr1 = passArray8ToWasm0(secret_seed, wasm.__wbindgen_malloc);
|
|
14
|
+
const len1 = WASM_VECTOR_LEN;
|
|
15
|
+
const ptr2 = passArray8ToWasm0(inputs_data, wasm.__wbindgen_malloc);
|
|
16
|
+
const len2 = WASM_VECTOR_LEN;
|
|
17
|
+
const ret = wasm.batch_generate_ring_vrf(ptr0, len0, prover_key_index, ptr1, len1, ptr2, len2, vrf_input_data_len);
|
|
18
|
+
var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
19
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
20
|
+
return v4;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
3
23
|
* @param {number} ring_size
|
|
4
24
|
* @param {Uint8Array} commitment
|
|
5
25
|
* @param {Uint8Array} tickets_data
|
|
@@ -341,4 +361,4 @@ async function __wbg_init(module_or_path) {
|
|
|
341
361
|
}
|
|
342
362
|
|
|
343
363
|
//#endregion
|
|
344
|
-
export { batch_verify_tickets, __wbg_init as default, derive_public_key, generate_seal, initSync, ring_commitment, verify_header_seals, verify_seal, vrf_output_hash };
|
|
364
|
+
export { batch_generate_ring_vrf, batch_verify_tickets, __wbg_init as default, derive_public_key, generate_seal, initSync, ring_commitment, verify_header_seals, verify_seal, vrf_output_hash };
|
package/index.d.ts
CHANGED
|
@@ -55,8 +55,8 @@ declare namespace reed_solomon_wasm_d_exports {
|
|
|
55
55
|
}
|
|
56
56
|
/* tslint:disable */
|
|
57
57
|
/* eslint-disable */
|
|
58
|
-
declare function decode(original_count: number, recovery_count: number, shards: ShardsCollection): ShardsCollection;
|
|
59
58
|
declare function encode(recovery_count: number, shards: ShardsCollection): ShardsCollection;
|
|
59
|
+
declare function decode(original_count: number, recovery_count: number, shards: ShardsCollection): ShardsCollection;
|
|
60
60
|
/**
|
|
61
61
|
* Collection of shards (either input or output).
|
|
62
62
|
*
|
|
@@ -145,7 +145,7 @@ declare function __wbg_init(module_or_path?: {
|
|
|
145
145
|
//#region bandersnatch/wasm-binding/pkg/bandersnatch_wasm.d.ts
|
|
146
146
|
type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
147
147
|
declare namespace index_d_exports {
|
|
148
|
-
export { BandersnatchApi, InitOptions, batchVerifyTickets, init$1 as default, derivePublicKey, generateSeal, getNativeBindingError, isInitialized, isNativeBinding, ringCommitment, verifyHeaderSeals, verifySeal, vrfOutputHash };
|
|
148
|
+
export { BandersnatchApi, InitOptions, batchGenerateRingVrf, batchVerifyTickets, init$1 as default, derivePublicKey, generateSeal, getNativeBindingError, isInitialized, isNativeBinding, ringCommitment, verifyHeaderSeals, verifySeal, vrfOutputHash };
|
|
149
149
|
}
|
|
150
150
|
type BandersnatchApi = {
|
|
151
151
|
isNativeBinding: () => boolean;
|
|
@@ -155,6 +155,7 @@ type BandersnatchApi = {
|
|
|
155
155
|
verifySeal: (signerKey: Uint8Array, sealData: Uint8Array, payload: Uint8Array, auxData: Uint8Array) => Uint8Array;
|
|
156
156
|
generateSeal: (secretSeed: Uint8Array, input: Uint8Array, auxData: Uint8Array) => Uint8Array;
|
|
157
157
|
vrfOutputHash: (secretSeed: Uint8Array, input: Uint8Array) => Uint8Array;
|
|
158
|
+
batchGenerateRingVrf: (ringKeys: Uint8Array, proverKeyIndex: number, secretSeed: Uint8Array, inputsData: Uint8Array, vrfInputDataLen: number) => Uint8Array;
|
|
158
159
|
batchVerifyTickets: (ringSize: number, commitment: Uint8Array, ticketsData: Uint8Array, vrfInputDataLen: number) => Uint8Array;
|
|
159
160
|
};
|
|
160
161
|
type InitOptions = {
|
|
@@ -179,6 +180,7 @@ declare function verifyHeaderSeals(signerKey: Uint8Array, sealData: Uint8Array,
|
|
|
179
180
|
declare function verifySeal(signerKey: Uint8Array, sealData: Uint8Array, payload: Uint8Array, auxData: Uint8Array): Uint8Array;
|
|
180
181
|
declare function generateSeal(secretSeed: Uint8Array, input: Uint8Array, auxData: Uint8Array): Uint8Array;
|
|
181
182
|
declare function vrfOutputHash(secretSeed: Uint8Array, input: Uint8Array): Uint8Array;
|
|
183
|
+
declare function batchGenerateRingVrf(ringKeys: Uint8Array, proverKeyIndex: number, secretSeed: Uint8Array, inputsData: Uint8Array, vrfInputDataLen: number): Uint8Array;
|
|
182
184
|
declare function batchVerifyTickets(ringSize: number, commitment: Uint8Array, ticketsData: Uint8Array, vrfInputDataLen: number): Uint8Array;
|
|
183
185
|
//#endregion
|
|
184
186
|
//#region native/index.d.ts
|