@noble/post-quantum 0.5.4 → 0.6.0

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/utils.d.ts CHANGED
@@ -3,65 +3,240 @@
3
3
  * @module
4
4
  */
5
5
  /*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */
6
- import { type CHash, type TypedArray, concatBytes, randomBytes as randb } from '@noble/hashes/utils.js';
7
- export { abytes } from '@noble/hashes/utils.js';
8
- export { concatBytes };
6
+ import { type CHash, type TypedArray, abytes, concatBytes, randomBytes as randb } from '@noble/hashes/utils.js';
7
+ /**
8
+ * Asserts that a value is a byte array and optionally checks its length.
9
+ * Returns the original reference unchanged on success, and currently also accepts Node `Buffer`
10
+ * values through the upstream validator.
11
+ * This helper throws on malformed input, so APIs that must return `false` need to guard lengths
12
+ * before decoding or before calling it.
13
+ * @example
14
+ * Validate that a value is a byte array with the expected length.
15
+ * ```ts
16
+ * abytes(new Uint8Array([1]), 1);
17
+ * ```
18
+ */
19
+ declare const abytesDoc: typeof abytes;
20
+ export { abytesDoc as abytes };
21
+ /**
22
+ * Concatenates byte arrays into a new `Uint8Array`.
23
+ * Zero arguments return an empty `Uint8Array`.
24
+ * Invalid segments throw before allocation because each argument is validated first.
25
+ * @example
26
+ * Concatenate two byte arrays into one result.
27
+ * ```ts
28
+ * concatBytes(new Uint8Array([1]), new Uint8Array([2]));
29
+ * ```
30
+ */
31
+ declare const concatBytesDoc: typeof concatBytes;
32
+ export { concatBytesDoc as concatBytes };
33
+ /**
34
+ * Returns cryptographically secure random bytes.
35
+ * Requires `globalThis.crypto.getRandomValues` and throws if that API is unavailable.
36
+ * `bytesLength` is validated by the upstream helper as a non-negative integer before allocation,
37
+ * so negative and fractional values both throw instead of truncating through JS `ToIndex`.
38
+ * @example
39
+ * Generate a fresh random seed.
40
+ * ```ts
41
+ * const seed = randomBytes(4);
42
+ * ```
43
+ */
9
44
  export declare const randomBytes: typeof randb;
45
+ /**
46
+ * Compares two byte arrays in a length-constant way for equal lengths.
47
+ * Unequal lengths return `false` immediately, and there is no runtime type validation.
48
+ * @param a - First byte array.
49
+ * @param b - Second byte array.
50
+ * @returns Whether both arrays contain the same bytes.
51
+ * @example
52
+ * Compare two byte arrays for equality.
53
+ * ```ts
54
+ * equalBytes(new Uint8Array([1]), new Uint8Array([1]));
55
+ * ```
56
+ */
10
57
  export declare function equalBytes(a: Uint8Array, b: Uint8Array): boolean;
58
+ /**
59
+ * Copies bytes into a fresh `Uint8Array`.
60
+ * Returns a detached plain `Uint8Array`, and currently accepts broader array-like / iterable
61
+ * inputs because it delegates directly to `Uint8Array.from(...)`.
62
+ * @param bytes - Source bytes.
63
+ * @returns Copy of the input bytes.
64
+ * @example
65
+ * Copy bytes into a fresh array.
66
+ * ```ts
67
+ * copyBytes(new Uint8Array([1, 2]));
68
+ * ```
69
+ */
11
70
  export declare function copyBytes(bytes: Uint8Array): Uint8Array;
71
+ /**
72
+ * Byte-swaps each 64-bit lane in place.
73
+ * Falcon's exact binary64 tables are stored as little-endian byte payloads, so BE runtimes need
74
+ * this boundary helper before aliasing them as host `Float64Array` lanes.
75
+ * @param arr - Byte buffer whose length is a multiple of 8.
76
+ * @returns The same buffer after in-place 64-bit lane byte swaps.
77
+ */
78
+ export declare function byteSwap64<T extends ArrayBufferView>(arr: T): T;
79
+ export declare const baswap64If: <T extends ArrayBufferView>(arr: T) => T;
80
+ /** Shared key-generation surface for signers and KEMs. */
12
81
  export type CryptoKeys = {
82
+ /** Optional metadata about the algorithm family or variant. */
13
83
  info?: {
14
84
  type?: string;
15
85
  };
86
+ /** Public byte lengths for the exported key material. */
16
87
  lengths: {
17
88
  seed?: number;
18
89
  publicKey?: number;
19
90
  secretKey?: number;
20
91
  };
92
+ /**
93
+ * Generate one secret/public keypair.
94
+ * @param seed - Optional seed bytes for deterministic key generation.
95
+ * @returns Fresh secret/public keypair.
96
+ */
21
97
  keygen: (seed?: Uint8Array) => {
22
98
  secretKey: Uint8Array;
23
99
  publicKey: Uint8Array;
24
100
  };
101
+ /**
102
+ * Derive one public key from a secret key.
103
+ * @param secretKey - Secret key bytes.
104
+ * @returns Public key bytes.
105
+ */
25
106
  getPublicKey: (secretKey: Uint8Array) => Uint8Array;
26
107
  };
108
+ /** Verification options shared by the signature APIs. */
27
109
  export type VerOpts = {
110
+ /** Optional application-defined context string. */
28
111
  context?: Uint8Array;
29
112
  };
113
+ /** Signing options shared by the signature APIs. */
30
114
  export type SigOpts = VerOpts & {
115
+ /** Optional extra entropy or `false` to disable randomized signing. */
31
116
  extraEntropy?: Uint8Array | false;
32
117
  };
118
+ /**
119
+ * Validates that an options bag is a plain object.
120
+ * @param opts - Options object to validate.
121
+ * @throws On wrong argument types. {@link TypeError}
122
+ * @example
123
+ * Validate that an options bag is a plain object.
124
+ * ```ts
125
+ * validateOpts({});
126
+ * ```
127
+ */
33
128
  export declare function validateOpts(opts: object): void;
129
+ /**
130
+ * Validates common verification options.
131
+ * `context` itself is validated with `abytes(...)`, and individual algorithms may narrow support
132
+ * further after this shared plain-object gate.
133
+ * @param opts - Verification options. See {@link VerOpts}.
134
+ * @throws On wrong argument types. {@link TypeError}
135
+ * @example
136
+ * Validate common verification options.
137
+ * ```ts
138
+ * validateVerOpts({ context: new Uint8Array([1]) });
139
+ * ```
140
+ */
34
141
  export declare function validateVerOpts(opts: VerOpts): void;
142
+ /**
143
+ * Validates common signing options.
144
+ * `extraEntropy` is validated with `abytes(...)`; exact lengths and extra algorithm-specific
145
+ * restrictions are enforced later by callers.
146
+ * @param opts - Signing options. See {@link SigOpts}.
147
+ * @throws On wrong argument types. {@link TypeError}
148
+ * @example
149
+ * Validate common signing options.
150
+ * ```ts
151
+ * validateSigOpts({ extraEntropy: new Uint8Array([1]) });
152
+ * ```
153
+ */
35
154
  export declare function validateSigOpts(opts: SigOpts): void;
36
- /** Generic interface for signatures. Has keygen, sign and verify. */
155
+ /** Generic signature interface with key generation, signing, and verification. */
37
156
  export type Signer = CryptoKeys & {
157
+ /** Public byte lengths for signatures and signing randomness. */
38
158
  lengths: {
39
159
  signRand?: number;
40
160
  signature?: number;
41
161
  };
162
+ /**
163
+ * Sign one message.
164
+ * @param msg - Message bytes to sign.
165
+ * @param secretKey - Secret key bytes.
166
+ * @param opts - Optional signing options.
167
+ * @returns Signature bytes.
168
+ */
42
169
  sign: (msg: Uint8Array, secretKey: Uint8Array, opts?: SigOpts) => Uint8Array;
170
+ /**
171
+ * Verify one signature.
172
+ * @param sig - Signature bytes.
173
+ * @param msg - Signed message bytes.
174
+ * @param publicKey - Public key bytes.
175
+ * @param opts - Optional verification options.
176
+ * @returns `true` when the signature is valid, `false` when all inputs are well-formed but the
177
+ * signature check does not pass. Some implementations also treat malformed signature encodings as
178
+ * a verification failure and return `false`.
179
+ * @throws On malformed API arguments or unsupported verification options.
180
+ */
43
181
  verify: (sig: Uint8Array, msg: Uint8Array, publicKey: Uint8Array, opts?: VerOpts) => boolean;
44
182
  };
183
+ /** Generic key encapsulation mechanism interface. */
45
184
  export type KEM = CryptoKeys & {
185
+ /** Public byte lengths for ciphertexts and optional message randomness. */
46
186
  lengths: {
47
187
  cipherText?: number;
48
188
  msg?: number;
49
189
  msgRand?: number;
50
190
  };
191
+ /**
192
+ * Encapsulate one shared secret to a recipient public key.
193
+ * @param publicKey - Recipient public key bytes.
194
+ * @param msg - Optional caller-provided randomness/message seed.
195
+ * @returns Ciphertext plus shared secret.
196
+ */
51
197
  encapsulate: (publicKey: Uint8Array, msg?: Uint8Array) => {
52
198
  cipherText: Uint8Array;
53
199
  sharedSecret: Uint8Array;
54
200
  };
201
+ /**
202
+ * Recover the shared secret from a ciphertext and recipient secret key.
203
+ * @param cipherText - Ciphertext bytes.
204
+ * @param secretKey - Recipient secret key bytes.
205
+ * @returns Decapsulated shared secret.
206
+ */
55
207
  decapsulate: (cipherText: Uint8Array, secretKey: Uint8Array) => Uint8Array;
56
208
  };
209
+ /** Bidirectional encoder/decoder interface. */
57
210
  export interface Coder<F, T> {
211
+ /**
212
+ * Serialize one value.
213
+ * @param from - Value to encode.
214
+ * @returns Encoded representation.
215
+ */
58
216
  encode(from: F): T;
217
+ /**
218
+ * Parse one serialized value.
219
+ * @param to - Encoded representation.
220
+ * @returns Decoded value.
221
+ */
59
222
  decode(to: T): F;
60
223
  }
224
+ /** Encoder/decoder interface specialized for byte arrays. */
61
225
  export interface BytesCoder<T> extends Coder<T, Uint8Array> {
226
+ /**
227
+ * Serialize one value into bytes.
228
+ * @param data - Value to encode.
229
+ * @returns Encoded bytes.
230
+ */
62
231
  encode: (data: T) => Uint8Array;
232
+ /**
233
+ * Parse one byte array into a value.
234
+ * @param bytes - Encoded bytes.
235
+ * @returns Decoded value.
236
+ */
63
237
  decode: (bytes: Uint8Array) => T;
64
238
  }
239
+ /** Fixed-length byte encoder/decoder. */
65
240
  export type BytesCoderLen<T> = BytesCoder<T> & {
66
241
  bytesLen: number;
67
242
  };
@@ -69,14 +244,118 @@ type UnCoder<T> = T extends BytesCoder<infer U> ? U : never;
69
244
  type SplitOut<T extends (number | BytesCoderLen<any>)[]> = {
70
245
  [K in keyof T]: T[K] extends number ? Uint8Array : UnCoder<T[K]>;
71
246
  };
247
+ /**
248
+ * Builds a fixed-layout coder from byte lengths and nested coders.
249
+ * Raw-length fields decode as zero-copy `subarray(...)` views, and nested coders may preserve that
250
+ * aliasing too. Nested coder `encode(...)` results are treated as owned scratch: `splitCoder`
251
+ * copies them into the output and then zeroizes them with `fill(0)`. If a nested encoder forwards
252
+ * caller-owned bytes, it must do so only after detaching them into a disposable copy.
253
+ * @param label - Label used in validation errors.
254
+ * @param lengths - Field lengths or nested coders.
255
+ * @returns Composite fixed-length coder.
256
+ * @example
257
+ * Build a fixed-layout coder from byte lengths and nested coders.
258
+ * ```ts
259
+ * splitCoder('demo', 1, 2).encode([new Uint8Array([1]), new Uint8Array([2, 3])]);
260
+ * ```
261
+ */
72
262
  export declare function splitCoder<T extends (number | BytesCoderLen<any>)[]>(label: string, ...lengths: T): BytesCoder<SplitOut<T>> & {
73
263
  bytesLen: number;
74
264
  };
265
+ /**
266
+ * Builds a fixed-length vector coder from another fixed-length coder.
267
+ * Element decoding receives `subarray(...)` views, so aliasing depends on the element coder.
268
+ * Element coder `encode(...)` results are treated as owned scratch: `vecCoder` copies them into
269
+ * the output and then zeroizes them with `fill(0)`. If an element encoder forwards caller-owned
270
+ * bytes, it must do so only after detaching them into a disposable copy. `vecCoder` also trusts
271
+ * the `BytesCoderLen` contract: each encoded element must already be exactly `c.bytesLen` bytes.
272
+ * @param c - Element coder.
273
+ * @param vecLen - Number of elements in the vector.
274
+ * @returns Fixed-length vector coder.
275
+ * @example
276
+ * Build a fixed-length vector coder from another fixed-length coder.
277
+ * ```ts
278
+ * vecCoder(
279
+ * { bytesLen: 1, encode: (n: number) => Uint8Array.of(n), decode: (b: Uint8Array) => b[0] || 0 },
280
+ * 2
281
+ * ).encode([1, 2]);
282
+ * ```
283
+ */
75
284
  export declare function vecCoder<T>(c: BytesCoderLen<T>, vecLen: number): BytesCoderLen<T[]>;
285
+ /**
286
+ * Overwrites supported typed-array inputs with zeroes in place.
287
+ * Accepts direct typed arrays and one-level arrays of them.
288
+ * @param list - Typed arrays or one-level lists of typed arrays to clear.
289
+ * @example
290
+ * Overwrite typed arrays with zeroes.
291
+ * ```ts
292
+ * const buf = Uint8Array.of(1, 2, 3);
293
+ * cleanBytes(buf);
294
+ * ```
295
+ */
76
296
  export declare function cleanBytes(...list: (TypedArray | TypedArray[])[]): void;
297
+ /**
298
+ * Creates a 32-bit mask with the lowest `bits` bits set.
299
+ * @param bits - Number of low bits to keep.
300
+ * @returns Bit mask with `bits` ones.
301
+ * @example
302
+ * Create a low-bit mask for packed-field operations.
303
+ * ```ts
304
+ * const mask = getMask(4);
305
+ * ```
306
+ */
77
307
  export declare function getMask(bits: number): number;
308
+ /** Shared empty byte array used as the default context. */
78
309
  export declare const EMPTY: Uint8Array;
310
+ /**
311
+ * Builds the domain-separated message payload for the pure sign/verify paths.
312
+ * Context length `255` is valid; only `ctx.length > 255` is rejected.
313
+ * @param msg - Message bytes.
314
+ * @param ctx - Optional context bytes.
315
+ * @returns Domain-separated message payload.
316
+ * @throws On wrong argument ranges or values. {@link RangeError}
317
+ * @example
318
+ * Build the domain-separated payload before direct signing.
319
+ * ```ts
320
+ * const payload = getMessage(new Uint8Array([1, 2]));
321
+ * ```
322
+ */
79
323
  export declare function getMessage(msg: Uint8Array, ctx?: Uint8Array): Uint8Array;
324
+ /**
325
+ * Validates that a hash exposes a NIST hash OID and enough collision resistance.
326
+ * Current accepted surface is broader than the FIPS algorithm tables: any hash/XOF under the NIST
327
+ * `2.16.840.1.101.3.4.2.*` subtree is accepted if its effective `outputLen` is strong enough.
328
+ * XOF callers must pass a callable whose `outputLen` matches the digest length they actually intend
329
+ * to sign; bare `shake128` / `shake256` defaults are too short for the stronger prehash modes.
330
+ * @param hash - Hash function to validate.
331
+ * @param requiredStrength - Minimum required collision-resistance strength in bits.
332
+ * @throws If the hash metadata or collision resistance is insufficient. {@link Error}
333
+ * @example
334
+ * Validate that a hash exposes a NIST hash OID and enough collision resistance.
335
+ * ```ts
336
+ * import { sha256 } from '@noble/hashes/sha2.js';
337
+ * import { checkHash } from '@noble/post-quantum/utils.js';
338
+ * checkHash(sha256, 128);
339
+ * ```
340
+ */
80
341
  export declare function checkHash(hash: CHash, requiredStrength?: number): void;
342
+ /**
343
+ * Builds the domain-separated prehash payload for the prehash sign/verify paths.
344
+ * Callers are expected to vet `hash.oid` first, e.g. via `checkHash(...)`; calling this helper
345
+ * directly with a hash object that lacks `oid` currently throws later inside `concatBytes(...)`.
346
+ * Context length `255` is valid; only `ctx.length > 255` is rejected.
347
+ * @param hash - Prehash function.
348
+ * @param msg - Message bytes.
349
+ * @param ctx - Optional context bytes.
350
+ * @returns Domain-separated prehash payload.
351
+ * @throws On wrong argument ranges or values. {@link RangeError}
352
+ * @example
353
+ * Build the domain-separated prehash payload for external hashing.
354
+ * ```ts
355
+ * import { sha256 } from '@noble/hashes/sha2.js';
356
+ * import { getMessagePrehash } from '@noble/post-quantum/utils.js';
357
+ * getMessagePrehash(sha256, new Uint8Array([1, 2]));
358
+ * ```
359
+ */
81
360
  export declare function getMessagePrehash(hash: CHash, msg: Uint8Array, ctx?: Uint8Array): Uint8Array;
82
361
  //# sourceMappingURL=utils.d.ts.map
package/utils.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,4EAA4E;AAC5E,OAAO,EACL,KAAK,KAAK,EACV,KAAK,UAAU,EAGf,WAAW,EAEX,WAAW,IAAI,KAAK,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,eAAO,MAAM,WAAW,EAAE,OAAO,KAAa,CAAC;AAG/C,wBAAgB,UAAU,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAKhE;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAEvD;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzB,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnE,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,KAAK;QAAE,SAAS,EAAE,UAAU,CAAC;QAAC,SAAS,EAAE,UAAU,CAAA;KAAE,CAAC;IAChF,YAAY,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,UAAU,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,CAAC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