@typeberry/native 0.0.4-a402d86 → 0.0.4-e18a946

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.
Files changed (3) hide show
  1. package/index.d.ts +28 -10
  2. package/index.js +50 -17
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  declare namespace bandersnatch_d_exports {
2
- export { InitInput$2 as InitInput, InitOutput$2 as InitOutput, SyncInitInput$2 as SyncInitInput, batch_verify_tickets, __wbg_init$2 as default, derive_public_key, initSync$2 as initSync, ring_commitment, verify_seal };
2
+ export { InitInput$2 as InitInput, InitOutput$2 as InitOutput, SyncInitInput$2 as SyncInitInput, batch_verify_tickets, __wbg_init$2 as default, derive_public_key, generate_seal, initSync$2 as initSync, ring_commitment, verify_seal };
3
3
  }
4
4
  /* tslint:disable */
5
5
  /* eslint-disable */
@@ -11,9 +11,26 @@ declare namespace bandersnatch_d_exports {
11
11
  */
12
12
  declare function verify_seal(signer_key: Uint8Array, seal_data: Uint8Array, payload: Uint8Array, aux_data: Uint8Array): Uint8Array;
13
13
  /**
14
- * Generate ring commitment given concatenation of ring keys.
14
+ * Generate seal that is verifiable using `verify_seal` function.
15
+ *
16
+ * # Arguments
17
+ * * `secret_seed` - Seed used to derive the secret key
18
+ * * `input` - VRF input data
19
+ * * `aux_data` - Auxiliary data for the VRF proof
20
+ *
21
+ * # Returns
22
+ * A byte vector with the following format:
23
+ * - On success (97 bytes):
24
+ * - Byte 0: Status code `0` (RESULT_OK)
25
+ * - Bytes 1-32: Serialized VRF output (32 bytes, compressed)
26
+ * - Bytes 33-96: Serialized IETF VRF proof (64 bytes, compressed)
27
+ * - On error (1 byte):
28
+ * - Byte 0: Status code `1` (RESULT_ERR)
29
+ *
30
+ * Returns an error if the input cannot be converted to a valid VRF input point
31
+ * or if serialization of the output or proof fails.
15
32
  */
16
- declare function ring_commitment(keys: Uint8Array): Uint8Array;
33
+ declare function generate_seal(secret_seed: Uint8Array, input: Uint8Array, aux_data: Uint8Array): Uint8Array;
17
34
  /**
18
35
  * Derive Private and Public Key from Seed
19
36
  *
@@ -27,11 +44,16 @@ declare function derive_public_key(seed: Uint8Array): Uint8Array;
27
44
  * NOTE: the aux_data of VRF function is empty!
28
45
  */
29
46
  declare function batch_verify_tickets(ring_size: number, commitment: Uint8Array, tickets_data: Uint8Array, vrf_input_data_len: number): Uint8Array;
47
+ /**
48
+ * Generate ring commitment given concatenation of ring keys.
49
+ */
50
+ declare function ring_commitment(keys: Uint8Array): Uint8Array;
30
51
  type InitInput$2 = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
31
52
  interface InitOutput$2 {
32
53
  readonly memory: WebAssembly.Memory;
33
54
  readonly batch_verify_tickets: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
34
55
  readonly derive_public_key: (a: number, b: number) => [number, number];
56
+ readonly generate_seal: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
35
57
  readonly ring_commitment: (a: number, b: number) => [number, number];
36
58
  readonly verify_seal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
37
59
  readonly __wbindgen_export_0: WebAssembly.Table;
@@ -70,18 +92,14 @@ declare namespace ed25519_wasm_d_exports {
70
92
  /* eslint-disable */
71
93
  /**
72
94
  *
73
- * * Verify Ed25519 signatures one by one using strict verification.
95
+ * * Verify Ed25519 signatures one by one.
74
96
  * *
75
- * * This function is slower but does strict verification.
76
- *
97
+ * * ed25519-consensus always does strict verification (ZIP-215 compatible).
77
98
  */
78
99
  declare function verify_ed25519(data: Uint8Array): Uint8Array;
79
100
  /**
80
101
  *
81
- * * Verify Ed25519 signatures using build-in batch verification.
82
- * *
83
- * * This function is faster but does not do strict verification.
84
- * * See https://crates.io/crates/ed25519-dalek#batch-verification for more information.
102
+ * * ed25519-consensus doesn't have built-in batch verification.
85
103
  *
86
104
  */
87
105
  declare function verify_ed25519_batch(data: Uint8Array): boolean;