@typeberry/native 0.0.4-51b82bc → 0.0.4-86135cc
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/index.d.ts +31 -31
- package/index.js +102 -72
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -4,12 +4,26 @@ declare namespace bandersnatch_d_exports {
|
|
|
4
4
|
/* tslint:disable */
|
|
5
5
|
/* eslint-disable */
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Compute VRF output hash from a secret seed and input data.
|
|
8
|
+
*
|
|
9
|
+
* This function derives a deterministic VRF output hash without generating a proof.
|
|
10
|
+
* Unlike `generate_seal`, this produces only the output hash, not a verifiable signature.
|
|
11
|
+
*
|
|
12
|
+
* # Arguments
|
|
13
|
+
* * `secret_seed` - Seed used to derive the secret key
|
|
14
|
+
* * `input` - VRF input data to be hashed
|
|
15
|
+
*
|
|
16
|
+
* # Returns
|
|
17
|
+
* A byte vector with the following format:
|
|
18
|
+
* - On success (33 bytes):
|
|
19
|
+
* - Byte 0: Status code `0` (RESULT_OK)
|
|
20
|
+
* - Bytes 1-32: VRF output hash (32 bytes)
|
|
21
|
+
* - On error (1 byte):
|
|
22
|
+
* - Byte 0: Status code `1` (RESULT_ERR)
|
|
23
|
+
*
|
|
24
|
+
* Returns an error if the input cannot be converted to a valid VRF input point.
|
|
11
25
|
*/
|
|
12
|
-
declare function
|
|
26
|
+
declare function vrf_output_hash(secret_seed: Uint8Array, input: Uint8Array): Uint8Array;
|
|
13
27
|
/**
|
|
14
28
|
* Verify multiple tickets at once as defined in:
|
|
15
29
|
* https://graypaper.fluffylabs.dev/#/68eaa1f/0f3e000f3e00?v=0.6.4
|
|
@@ -17,6 +31,17 @@ declare function verify_seal(signer_key: Uint8Array, seal_data: Uint8Array, payl
|
|
|
17
31
|
* NOTE: the aux_data of VRF function is empty!
|
|
18
32
|
*/
|
|
19
33
|
declare function batch_verify_tickets(ring_size: number, commitment: Uint8Array, tickets_data: Uint8Array, vrf_input_data_len: number): Uint8Array;
|
|
34
|
+
/**
|
|
35
|
+
* Generate ring commitment given concatenation of ring keys.
|
|
36
|
+
*/
|
|
37
|
+
declare function ring_commitment(keys: Uint8Array): Uint8Array;
|
|
38
|
+
/**
|
|
39
|
+
* Seal verification as defined in:
|
|
40
|
+
* https://graypaper.fluffylabs.dev/#/68eaa1f/0eff000eff00?v=0.6.4
|
|
41
|
+
* or
|
|
42
|
+
* https://graypaper.fluffylabs.dev/#/68eaa1f/0e54010e5401?v=0.6.4
|
|
43
|
+
*/
|
|
44
|
+
declare function verify_seal(signer_key: Uint8Array, seal_data: Uint8Array, payload: Uint8Array, aux_data: Uint8Array): Uint8Array;
|
|
20
45
|
/**
|
|
21
46
|
* Generate seal that is verifiable using `verify_seal` function.
|
|
22
47
|
*
|
|
@@ -44,31 +69,6 @@ declare function generate_seal(secret_seed: Uint8Array, input: Uint8Array, aux_d
|
|
|
44
69
|
* returns: `Vec<u8>` containing the exit (1 byte) status followed by the (32 bytes) public key
|
|
45
70
|
*/
|
|
46
71
|
declare function derive_public_key(seed: Uint8Array): Uint8Array;
|
|
47
|
-
/**
|
|
48
|
-
* Compute VRF output hash from a secret seed and input data.
|
|
49
|
-
*
|
|
50
|
-
* This function derives a deterministic VRF output hash without generating a proof.
|
|
51
|
-
* Unlike `generate_seal`, this produces only the output hash, not a verifiable signature.
|
|
52
|
-
*
|
|
53
|
-
* # Arguments
|
|
54
|
-
* * `secret_seed` - Seed used to derive the secret key
|
|
55
|
-
* * `input` - VRF input data to be hashed
|
|
56
|
-
*
|
|
57
|
-
* # Returns
|
|
58
|
-
* A byte vector with the following format:
|
|
59
|
-
* - On success (33 bytes):
|
|
60
|
-
* - Byte 0: Status code `0` (RESULT_OK)
|
|
61
|
-
* - Bytes 1-32: VRF output hash (32 bytes)
|
|
62
|
-
* - On error (1 byte):
|
|
63
|
-
* - Byte 0: Status code `1` (RESULT_ERR)
|
|
64
|
-
*
|
|
65
|
-
* Returns an error if the input cannot be converted to a valid VRF input point.
|
|
66
|
-
*/
|
|
67
|
-
declare function vrf_output_hash(secret_seed: Uint8Array, input: Uint8Array): Uint8Array;
|
|
68
|
-
/**
|
|
69
|
-
* Generate ring commitment given concatenation of ring keys.
|
|
70
|
-
*/
|
|
71
|
-
declare function ring_commitment(keys: Uint8Array): Uint8Array;
|
|
72
72
|
type InitInput$2 = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
73
73
|
interface InitOutput$2 {
|
|
74
74
|
readonly memory: WebAssembly.Memory;
|
|
@@ -164,8 +164,8 @@ declare namespace reed_solomon_wasm_d_exports {
|
|
|
164
164
|
}
|
|
165
165
|
/* tslint:disable */
|
|
166
166
|
/* eslint-disable */
|
|
167
|
-
declare function encode(recovery_count: number, shards: ShardsCollection): ShardsCollection;
|
|
168
167
|
declare function decode(original_count: number, recovery_count: number, shards: ShardsCollection): ShardsCollection;
|
|
168
|
+
declare function encode(recovery_count: number, shards: ShardsCollection): ShardsCollection;
|
|
169
169
|
/**
|
|
170
170
|
* Collection of shards (either input or output).
|
|
171
171
|
*
|