@typeberry/native 0.0.4-22d630b → 0.0.4-23cb00c

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 +24 -28
  2. package/index.js +75 -72
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -3,16 +3,6 @@ declare namespace bandersnatch_d_exports {
3
3
  }
4
4
  /* tslint:disable */
5
5
  /* eslint-disable */
6
- /**
7
- * Generate ring commitment given concatenation of ring keys.
8
- */
9
- declare function ring_commitment(keys: Uint8Array): Uint8Array;
10
- /**
11
- * Derive Private and Public Key from Seed
12
- *
13
- * returns: `Vec<u8>` containing the exit (1 byte) status followed by the (32 bytes) public key
14
- */
15
- declare function derive_public_key(seed: Uint8Array): Uint8Array;
16
6
  /**
17
7
  * Seal verification as defined in:
18
8
  * https://graypaper.fluffylabs.dev/#/68eaa1f/0eff000eff00?v=0.6.4
@@ -27,13 +17,23 @@ declare function verify_seal(signer_key: Uint8Array, seal_data: Uint8Array, payl
27
17
  * NOTE: the aux_data of VRF function is empty!
28
18
  */
29
19
  declare function batch_verify_tickets(ring_size: number, commitment: Uint8Array, tickets_data: Uint8Array, vrf_input_data_len: number): Uint8Array;
20
+ /**
21
+ * Derive Private and Public Key from Seed
22
+ *
23
+ * returns: `Vec<u8>` containing the exit (1 byte) status followed by the (32 bytes) public key
24
+ */
25
+ declare function derive_public_key(seed: Uint8Array): Uint8Array;
26
+ /**
27
+ * Generate ring commitment given concatenation of ring keys.
28
+ */
29
+ declare function ring_commitment(keys: Uint8Array): Uint8Array;
30
30
  type InitInput$2 = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
31
31
  interface InitOutput$2 {
32
32
  readonly memory: WebAssembly.Memory;
33
- readonly ring_commitment: (a: number, b: number) => [number, number];
33
+ readonly batch_verify_tickets: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
34
34
  readonly derive_public_key: (a: number, b: number) => [number, number];
35
+ readonly ring_commitment: (a: number, b: number) => [number, number];
35
36
  readonly verify_seal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
36
- readonly batch_verify_tickets: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
37
37
  readonly __wbindgen_export_0: WebAssembly.Table;
38
38
  readonly __wbindgen_malloc: (a: number, b: number) => number;
39
39
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
@@ -70,18 +70,14 @@ declare namespace ed25519_wasm_d_exports {
70
70
  /* eslint-disable */
71
71
  /**
72
72
  *
73
- * * Verify Ed25519 signatures one by one using strict verification.
73
+ * * Verify Ed25519 signatures one by one.
74
74
  * *
75
- * * This function is slower but does strict verification.
76
- *
75
+ * * ed25519-consensus always does strict verification (ZIP-215 compatible).
77
76
  */
78
77
  declare function verify_ed25519(data: Uint8Array): Uint8Array;
79
78
  /**
80
79
  *
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.
80
+ * * ed25519-consensus doesn't have built-in batch verification.
85
81
  *
86
82
  */
87
83
  declare function verify_ed25519_batch(data: Uint8Array): boolean;
@@ -144,7 +140,6 @@ declare function decode(original_count: number, recovery_count: number, shards:
144
140
  */
145
141
  declare class ShardsCollection {
146
142
  free(): void;
147
- constructor(shard_len: number, data: Uint8Array, indices?: Uint16Array | null);
148
143
  /**
149
144
  * Extract the `indices` from this shards container.
150
145
  *
@@ -152,6 +147,7 @@ declare class ShardsCollection {
152
147
  * NOTE that subsequent calls to that method will return `None`.
153
148
  */
154
149
  take_indices(): Uint16Array | undefined;
150
+ constructor(shard_len: number, data: Uint8Array, indices?: Uint16Array | null);
155
151
  /**
156
152
  * Take the underlying `data` to the JS side.
157
153
  *
@@ -171,16 +167,16 @@ declare class ShardsCollection {
171
167
  type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
172
168
  interface InitOutput {
173
169
  readonly memory: WebAssembly.Memory;
174
- readonly __wbg_shardscollection_free: (a: number, b: number) => void;
175
170
  readonly __wbg_get_shardscollection_length: (a: number) => number;
176
- readonly __wbg_set_shardscollection_length: (a: number, b: number) => void;
177
171
  readonly __wbg_get_shardscollection_shard_len: (a: number) => number;
172
+ readonly __wbg_set_shardscollection_length: (a: number, b: number) => void;
178
173
  readonly __wbg_set_shardscollection_shard_len: (a: number, b: number) => void;
174
+ readonly __wbg_shardscollection_free: (a: number, b: number) => void;
175
+ readonly decode: (a: number, b: number, c: number) => [number, number, number];
176
+ readonly encode: (a: number, b: number) => [number, number, number];
179
177
  readonly shardscollection_new: (a: number, b: any, c: number) => number;
180
- readonly shardscollection_take_indices: (a: number) => any;
181
178
  readonly shardscollection_take_data: (a: number) => any;
182
- readonly encode: (a: number, b: number) => [number, number, number];
183
- readonly decode: (a: number, b: number, c: number) => [number, number, number];
179
+ readonly shardscollection_take_indices: (a: number) => any;
184
180
  readonly __wbindgen_export_0: WebAssembly.Table;
185
181
  readonly __externref_table_alloc: () => number;
186
182
  readonly __externref_table_dealloc: (a: number) => void;
@@ -214,9 +210,9 @@ declare function __wbg_init(module_or_path?: {
214
210
  //#region native/index.d.ts
215
211
  declare function initAll(): Promise<void>;
216
212
  declare const init: {
217
- bandersnatch: () => Promise<InitOutput$2>;
218
- ed25519: () => Promise<InitOutput$1>;
219
- reedSolomon: () => Promise<InitOutput>;
213
+ bandersnatch: any;
214
+ ed25519: any;
215
+ reedSolomon: any;
220
216
  };
221
217
  //#endregion
222
218
  export { bandersnatch_d_exports as bandersnatch, ed25519_wasm_d_exports as ed25519, init, initAll, reed_solomon_wasm_d_exports as reedSolomon };