@noble/post-quantum 0.6.0 → 0.6.1
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/README.md +45 -32
- package/_crystals.d.ts +17 -15
- package/_crystals.d.ts.map +1 -1
- package/_crystals.js +13 -3
- package/_crystals.js.map +1 -1
- package/falcon.d.ts +7 -7
- package/falcon.d.ts.map +1 -1
- package/falcon.js +27 -20
- package/falcon.js.map +1 -1
- package/hybrid.d.ts +23 -23
- package/hybrid.d.ts.map +1 -1
- package/hybrid.js +37 -28
- package/hybrid.js.map +1 -1
- package/index.js +8 -0
- package/index.js.map +1 -1
- package/ml-dsa.d.ts +7 -7
- package/ml-dsa.d.ts.map +1 -1
- package/ml-dsa.js +54 -28
- package/ml-dsa.js.map +1 -1
- package/ml-kem.d.ts +4 -4
- package/ml-kem.d.ts.map +1 -1
- package/ml-kem.js +43 -26
- package/ml-kem.js.map +1 -1
- package/package.json +5 -5
- package/slh-dsa.d.ts +21 -21
- package/slh-dsa.d.ts.map +1 -1
- package/slh-dsa.js +57 -35
- package/slh-dsa.js.map +1 -1
- package/src/_crystals.ts +44 -27
- package/src/falcon.ts +150 -117
- package/src/hybrid.ts +145 -96
- package/src/index.ts +8 -0
- package/src/ml-dsa.ts +124 -69
- package/src/ml-kem.ts +114 -85
- package/src/slh-dsa.ts +211 -132
- package/src/utils.ts +174 -34
- package/utils.d.ts +81 -22
- package/utils.d.ts.map +1 -1
- package/utils.js +30 -8
- package/utils.js.map +1 -1
package/README.md
CHANGED
|
@@ -252,7 +252,9 @@ For [hashes](https://github.com/paulmillr/noble-hashes), use SHA512 or SHA3-512
|
|
|
252
252
|
|
|
253
253
|
The library has not been independently audited yet.
|
|
254
254
|
|
|
255
|
-
|
|
255
|
+
- at version 0.6.1, in Apr 2026, it was audited by ourselves (self-audited)
|
|
256
|
+
- Scope: everything
|
|
257
|
+
- [Changes since audit](https://github.com/paulmillr/noble-post-quantum/compare/0.6.1..main)
|
|
256
258
|
|
|
257
259
|
If you see anything unusual: investigate and report.
|
|
258
260
|
|
|
@@ -287,36 +289,61 @@ which is considered a cryptographically secure PRNG.
|
|
|
287
289
|
|
|
288
290
|
Browsers have had weaknesses in the past - and could again - but implementing a userspace CSPRNG is even worse, as there’s no reliable userspace source of high-quality entropy.
|
|
289
291
|
|
|
292
|
+
## Contributing & testing
|
|
293
|
+
|
|
294
|
+
- `npm install && npm run build && npm test` will build the code and run tests.
|
|
295
|
+
- `npm run lint` / `npm run format` will run linter / fix linter issues.
|
|
296
|
+
- `npm run bench` will run benchmarks
|
|
297
|
+
- `npm run build:release` will build single file
|
|
298
|
+
|
|
299
|
+
Check out [github.com/paulmillr/guidelines](https://github.com/paulmillr/guidelines)
|
|
300
|
+
for general coding practices and rules.
|
|
301
|
+
|
|
302
|
+
See [paulmillr.com/noble](https://paulmillr.com/noble/)
|
|
303
|
+
for useful resources, articles, documentation and demos
|
|
304
|
+
related to the library.
|
|
305
|
+
|
|
290
306
|
## Speed
|
|
291
307
|
|
|
292
308
|
> `npm run bench`
|
|
293
309
|
|
|
294
|
-
Noble is the fastest JS implementation of post-quantum algorithms.
|
|
310
|
+
Noble is the fastest JS implementation of post-quantum algorithms.
|
|
295
311
|
|
|
296
312
|
Benchmarks on Apple M4 (**higher is better**):
|
|
297
313
|
|
|
298
|
-
| OPs/sec | Keygen | Signing | Verification | Shared secret |
|
|
299
|
-
| ----------------- | ------ | ------- | ------------ | ------------- |
|
|
300
|
-
| ECC x/ed25519 | 14216 | 6849 | 1400 | 1981 |
|
|
301
|
-
| ML-KEM-768 | 3778 | | | 3750 |
|
|
302
|
-
| ML-DSA65 | 580 | 272 | 546 | |
|
|
303
|
-
| SLH-DSA-SHA2-192f | 245 | 8 | 169 | |
|
|
304
|
-
|
|
305
314
|
```
|
|
306
315
|
# ML-KEM768
|
|
307
|
-
keygen x
|
|
308
|
-
encapsulate x 3,
|
|
309
|
-
decapsulate x
|
|
316
|
+
keygen x 4,277 ops/sec @ 233μs/op
|
|
317
|
+
encapsulate x 3,470 ops/sec @ 288μs/op
|
|
318
|
+
decapsulate x 3,757 ops/sec @ 266μs/op
|
|
310
319
|
# ML-DSA65
|
|
311
|
-
keygen x
|
|
312
|
-
sign x
|
|
313
|
-
verify x
|
|
320
|
+
keygen x 669 ops/sec @ 1ms/op
|
|
321
|
+
sign x 271 ops/sec @ 3ms/op
|
|
322
|
+
verify x 565 ops/sec @ 1ms/op
|
|
314
323
|
# SLH-DSA SHA2 192f
|
|
315
|
-
keygen x
|
|
316
|
-
sign x 8 ops/sec @
|
|
317
|
-
verify x
|
|
324
|
+
keygen x 235 ops/sec @ 4ms/op
|
|
325
|
+
sign x 8 ops/sec @ 117ms/op
|
|
326
|
+
verify x 159 ops/sec @ 6ms/op
|
|
327
|
+
# Falcon512
|
|
328
|
+
keygen x 14 ops/sec @ 66ms/op ± 11.01% (56ms..96ms)
|
|
329
|
+
sign x 749 ops/sec @ 1ms/op
|
|
330
|
+
verify x 2,160 ops/sec @ 462μs/op
|
|
331
|
+
# Falcon1024
|
|
332
|
+
keygen x 4 ops/sec @ 247ms/op ± 5.22% (234ms..266ms)
|
|
333
|
+
sign x 343 ops/sec @ 2ms/op
|
|
334
|
+
verify x 950 ops/sec @ 1ms/op
|
|
318
335
|
```
|
|
319
336
|
|
|
337
|
+
Compared with pre-quantum:
|
|
338
|
+
|
|
339
|
+
| OPs/sec | Keygen | Signing | Verification | Shared secret |
|
|
340
|
+
| ----------------- | ------ | ------- | ------------ | ------------- |
|
|
341
|
+
| ECC x/ed25519 | 12648 | 6157 | 1255 | 1981 |
|
|
342
|
+
| ML-KEM-768 | 4277 | | | 3757 |
|
|
343
|
+
| ML-DSA65 | 669 | 271 | 565 | |
|
|
344
|
+
| SLH-DSA-SHA2-192f | 235 | 8 | 159 | |
|
|
345
|
+
| Falcon512 | 14 | 749 | 950 | |
|
|
346
|
+
|
|
320
347
|
SLH-DSA:
|
|
321
348
|
|
|
322
349
|
| | sig size | keygen | sign | verify |
|
|
@@ -330,20 +357,6 @@ SLH-DSA:
|
|
|
330
357
|
| shake_192f | 35664 | 21ms | 553ms | 29ms |
|
|
331
358
|
| shake_192s | 16224 | 260ms | 2635ms | 2ms |
|
|
332
359
|
|
|
333
|
-
## Contributing & testing
|
|
334
|
-
|
|
335
|
-
- `npm install && npm run build && npm test` will build the code and run tests.
|
|
336
|
-
- `npm run lint` / `npm run format` will run linter / fix linter issues.
|
|
337
|
-
- `npm run bench` will run benchmarks
|
|
338
|
-
- `npm run build:release` will build single file
|
|
339
|
-
|
|
340
|
-
Check out [github.com/paulmillr/guidelines](https://github.com/paulmillr/guidelines)
|
|
341
|
-
for general coding practices and rules.
|
|
342
|
-
|
|
343
|
-
See [paulmillr.com/noble](https://paulmillr.com/noble/)
|
|
344
|
-
for useful resources, articles, documentation and demos
|
|
345
|
-
related to the library.
|
|
346
|
-
|
|
347
360
|
## License
|
|
348
361
|
|
|
349
362
|
The MIT License (MIT)
|
package/_crystals.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TypedArray } from '@noble/hashes/utils.js';
|
|
2
|
-
import { type BytesCoderLen, type Coder } from './utils.ts';
|
|
2
|
+
import { type BytesCoderLen, type Coder, type TRet } from './utils.ts';
|
|
3
3
|
/** Extendable-output reader used by the CRYSTALS implementations. */
|
|
4
4
|
export type XOF = (seed: Uint8Array, blockLen?: number) => {
|
|
5
5
|
/**
|
|
@@ -50,6 +50,18 @@ export type CrystalOpts<T extends TypedArray> = {
|
|
|
50
50
|
};
|
|
51
51
|
/** Constructor function for typed polynomial containers. */
|
|
52
52
|
export type TypedCons<T extends TypedArray> = (n: number) => T;
|
|
53
|
+
type Crystals<T extends TypedArray> = {
|
|
54
|
+
mod: (a: number, modulo?: number) => number;
|
|
55
|
+
smod: (a: number, modulo?: number) => number;
|
|
56
|
+
nttZetas: T;
|
|
57
|
+
NTT: {
|
|
58
|
+
/** Forward transform in place. Mutates and returns `r`. */
|
|
59
|
+
encode: (r: T) => T;
|
|
60
|
+
/** Inverse transform in place. Mutates and returns `r`. */
|
|
61
|
+
decode: (r: T) => T;
|
|
62
|
+
};
|
|
63
|
+
bitsCoder: (d: number, c: Coder<number, number>) => BytesCoderLen<T>;
|
|
64
|
+
};
|
|
53
65
|
/**
|
|
54
66
|
* Creates shared modular arithmetic, NTT, and packing helpers for CRYSTALS schemes.
|
|
55
67
|
* @param opts - Polynomial and transform parameters. See {@link CrystalOpts}.
|
|
@@ -69,18 +81,7 @@ export type TypedCons<T extends TypedArray> = (n: number) => T;
|
|
|
69
81
|
* const reduced = crystals.mod(-1);
|
|
70
82
|
* ```
|
|
71
83
|
*/
|
|
72
|
-
export declare const genCrystals: <T extends TypedArray>(opts: CrystalOpts<T>) =>
|
|
73
|
-
mod: (a: number, modulo?: number) => number;
|
|
74
|
-
smod: (a: number, modulo?: number) => number;
|
|
75
|
-
nttZetas: T;
|
|
76
|
-
NTT: {
|
|
77
|
-
/** Forward transform in place. Mutates and returns `r`. */
|
|
78
|
-
encode: (r: T) => T;
|
|
79
|
-
/** Inverse transform in place. Mutates and returns `r`. */
|
|
80
|
-
decode: (r: T) => T;
|
|
81
|
-
};
|
|
82
|
-
bitsCoder: (d: number, c: Coder<number, number>) => BytesCoderLen<T>;
|
|
83
|
-
};
|
|
84
|
+
export declare const genCrystals: <T extends TypedArray>(opts: CrystalOpts<T>) => TRet<Crystals<T>>;
|
|
84
85
|
/**
|
|
85
86
|
* SHAKE128-based extendable-output reader factory used by ML-KEM.
|
|
86
87
|
* `get(x, y)` selects one coordinate pair at a time; calling it again invalidates previously
|
|
@@ -97,7 +98,7 @@ export declare const genCrystals: <T extends TypedArray>(opts: CrystalOpts<T>) =
|
|
|
97
98
|
* const block = reader.get(0, 0)();
|
|
98
99
|
* ```
|
|
99
100
|
*/
|
|
100
|
-
export declare const XOF128: XOF
|
|
101
|
+
export declare const XOF128: TRet<XOF>;
|
|
101
102
|
/**
|
|
102
103
|
* SHAKE256-based extendable-output reader factory used by ML-DSA.
|
|
103
104
|
* `get(x, y)` appends raw one-byte coordinates to the seed, invalidates previously returned
|
|
@@ -114,5 +115,6 @@ export declare const XOF128: XOF;
|
|
|
114
115
|
* const block = reader.get(0, 0)();
|
|
115
116
|
* ```
|
|
116
117
|
*/
|
|
117
|
-
export declare const XOF256: XOF
|
|
118
|
+
export declare const XOF256: TRet<XOF>;
|
|
119
|
+
export {};
|
|
118
120
|
//# sourceMappingURL=_crystals.d.ts.map
|
package/_crystals.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_crystals.d.ts","sourceRoot":"","sources":["src/_crystals.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"_crystals.d.ts","sourceRoot":"","sources":["src/_crystals.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,KAAK,EAGV,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,qEAAqE;AACrE,MAAM,MAAM,GAAG,GAAG,CAChB,IAAI,EAAE,UAAU,EAChB,QAAQ,CAAC,EAAE,MAAM,KACd;IACH;;;OAGG;IACH,KAAK,EAAE,MAAM;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C;;;;;;;;;OASG;IACH,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,UAAU,CAAC;IAChD,mEAAmE;IACnE,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,wCAAwC;AACxC,oEAAoE;AACpE,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,UAAU,IAAI;IAC9C;;;;OAIG;IACH,OAAO,EAAE,SAAS,CAAC,CAAC,C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AG,CAA4C,CAAC;AAC1E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,EAAE,IAAI,CAAC,GAAG,CAA4C,CAAC"}
|
package/_crystals.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */
|
|
6
6
|
import { FFTCore, reverseBits } from '@noble/curves/abstract/fft.js';
|
|
7
7
|
import { shake128, shake256 } from '@noble/hashes/sha3.js';
|
|
8
|
-
import { cleanBytes, getMask } from "./utils.js";
|
|
8
|
+
import { cleanBytes, getMask, } from "./utils.js";
|
|
9
9
|
/**
|
|
10
10
|
* Creates shared modular arithmetic, NTT, and packing helpers for CRYSTALS schemes.
|
|
11
11
|
* @param opts - Polynomial and transform parameters. See {@link CrystalOpts}.
|
|
@@ -95,7 +95,8 @@ export const genCrystals = (opts) => {
|
|
|
95
95
|
const bytesLen = d * (N / 8);
|
|
96
96
|
return {
|
|
97
97
|
bytesLen,
|
|
98
|
-
encode: (
|
|
98
|
+
encode: (poly_) => {
|
|
99
|
+
const poly = poly_;
|
|
99
100
|
const r = new Uint8Array(bytesLen);
|
|
100
101
|
for (let i = 0, buf = 0, bufLen = 0, pos = 0; i < poly.length; i++) {
|
|
101
102
|
buf |= (c.encode(poly[i]) & mask) << bufLen;
|
|
@@ -117,7 +118,16 @@ export const genCrystals = (opts) => {
|
|
|
117
118
|
},
|
|
118
119
|
};
|
|
119
120
|
};
|
|
120
|
-
return {
|
|
121
|
+
return {
|
|
122
|
+
mod,
|
|
123
|
+
smod,
|
|
124
|
+
nttZetas: nttZetas,
|
|
125
|
+
NTT: {
|
|
126
|
+
encode: (r) => NTT.encode(r),
|
|
127
|
+
decode: (r) => NTT.decode(r),
|
|
128
|
+
},
|
|
129
|
+
bitsCoder: bitsCoder,
|
|
130
|
+
};
|
|
121
131
|
};
|
|
122
132
|
const createXofShake = (shake) => (seed, blockLen) => {
|
|
123
133
|
if (!blockLen)
|
package/_crystals.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_crystals.js","sourceRoot":"","sources":["src/_crystals.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,4EAA4E;AAC5E,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,
|
|
1
|
+
{"version":3,"file":"_crystals.js","sourceRoot":"","sources":["src/_crystals.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,4EAA4E;AAC5E,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAEL,UAAU,EAEV,OAAO,GAGR,MAAM,YAAY,CAAC;AAoEpB;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAuB,IAAoB,EAAqB,EAAE;IAC3F,mDAAmD;IACnD,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACnE,qFAAqF;IACrF,oEAAoE;IACpE,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,MAAM,GAAG,CAAC,EAAU,EAAE;QAC5C,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC;QAC9B,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAChE,CAAC,CAAC;IACF,mFAAmF;IACnF,2CAA2C;IAC3C,uDAAuD;IACvD,MAAM,IAAI,GAAG,CAAC,CAAS,E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E,KAAK,EAAE,IAAI,EAAE,CAAC;QAC9B,GAAG,EAAE,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE;YAC5B,gFAAgF;YAChF,6EAA6E;YAC7E,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;YACvB,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;YACvB,CAAC,CAAC,OAAO,EAAE,CAAC;YACZ,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACnC,KAAK,EAAE,CAAC;YACR,OAAO,GAAG,EAAE;gBACV,IAAI,EAAE,CAAC;gBACP,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAqB,CAAC;YAC5C,CAAC,CAAC;QACJ,CAAC;QACD,KAAK,EAAE,GAAG,EAAE;YACV,CAAC,CAAC,OAAO,EAAE,CAAC;YACZ,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEJ;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,MAAM,GAAc,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;AAC1E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,MAAM,GAAc,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC"}
|
package/falcon.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { type CryptoKeys, type Signer, type SigOpts, type TRet, type VerOpts } from './utils.ts';
|
|
2
|
+
type FalconRandom = (bytesLength?: number) => TRet<Uint8Array>;
|
|
3
3
|
type FalconSigOpts = SigOpts & {
|
|
4
|
-
random?:
|
|
4
|
+
random?: FalconRandom;
|
|
5
5
|
};
|
|
6
6
|
/** Falcon attached-signature API. */
|
|
7
7
|
export type FalconAttached = CryptoKeys & {
|
|
@@ -42,7 +42,7 @@ export type Falcon = Signer & {
|
|
|
42
42
|
* falcon512.verify(sig, msg, publicKey);
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
|
-
export declare const falcon512: Falcon
|
|
45
|
+
export declare const falcon512: TRet<Falcon>;
|
|
46
46
|
/**
|
|
47
47
|
* Falcon-512 padded detached-signature API with the attached helper exposed as `.attached`.
|
|
48
48
|
* @example
|
|
@@ -54,7 +54,7 @@ export declare const falcon512: Falcon;
|
|
|
54
54
|
* falcon512padded.verify(sig, msg, publicKey);
|
|
55
55
|
* ```
|
|
56
56
|
*/
|
|
57
|
-
export declare const falcon512padded: Falcon
|
|
57
|
+
export declare const falcon512padded: TRet<Falcon>;
|
|
58
58
|
/**
|
|
59
59
|
* Falcon-1024 detached-signature API with the attached helper exposed as `.attached`.
|
|
60
60
|
* @example
|
|
@@ -66,7 +66,7 @@ export declare const falcon512padded: Falcon;
|
|
|
66
66
|
* falcon1024.verify(sig, msg, publicKey);
|
|
67
67
|
* ```
|
|
68
68
|
*/
|
|
69
|
-
export declare const falcon1024: Falcon
|
|
69
|
+
export declare const falcon1024: TRet<Falcon>;
|
|
70
70
|
/**
|
|
71
71
|
* Falcon-1024 padded detached-signature API with the attached helper exposed as `.attached`.
|
|
72
72
|
* @example
|
|
@@ -78,7 +78,7 @@ export declare const falcon1024: Falcon;
|
|
|
78
78
|
* falcon1024padded.verify(sig, msg, publicKey);
|
|
79
79
|
* ```
|
|
80
80
|
*/
|
|
81
|
-
export declare const falcon1024padded: Falcon
|
|
81
|
+
export declare const falcon1024padded: TRet<Falcon>;
|
|
82
82
|
export declare const __tests: any;
|
|
83
83
|
export {};
|
|
84
84
|
//# sourceMappingURL=falcon.d.ts.map
|
package/falcon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"falcon.d.ts","sourceRoot":"","sources":["src/falcon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"falcon.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AC;AAGR,eAAO,MAAM,OAAO,EAAE,GAaf,CAAC"}
|
package/falcon.js
CHANGED
|
@@ -12,7 +12,7 @@ import { bytesToNumberLE, numberToHexUnpadded } from '@noble/curves/utils.js';
|
|
|
12
12
|
import { shake256 } from '@noble/hashes/sha3.js';
|
|
13
13
|
import { abytes, bytesToHex, createView, hexToBytes, randomBytes, swap32IfBE, u32, u8, } from '@noble/hashes/utils.js';
|
|
14
14
|
import { genCrystals } from "./_crystals.js";
|
|
15
|
-
import { cleanBytes, getMask,
|
|
15
|
+
import { baswap64If, cleanBytes, getMask, splitCoder, validateSigOpts, validateVerOpts, } from "./utils.js";
|
|
16
16
|
/*
|
|
17
17
|
FIPS-206 would likely improve the situation with spec.
|
|
18
18
|
|
|
@@ -124,10 +124,11 @@ const bitsCoderMSB = (newPoly, N, d, c) => {
|
|
|
124
124
|
// encode() zeroizes the temporary encoded body after copying, so wrapped encoders must return
|
|
125
125
|
// owned scratch bytes rather than caller-owned buffers.
|
|
126
126
|
const headerCoder = (tag, restCoder) => {
|
|
127
|
+
const coder = restCoder;
|
|
127
128
|
return {
|
|
128
|
-
bytesLen: 1 +
|
|
129
|
+
bytesLen: 1 + coder.bytesLen,
|
|
129
130
|
encode(value) {
|
|
130
|
-
const body =
|
|
131
|
+
const body = coder.encode(value);
|
|
131
132
|
const out = new Uint8Array(1 + body.length);
|
|
132
133
|
out[0] = tag;
|
|
133
134
|
out.set(body, 1);
|
|
@@ -137,7 +138,7 @@ const headerCoder = (tag, restCoder) => {
|
|
|
137
138
|
decode(data) {
|
|
138
139
|
if (data[0] !== tag)
|
|
139
140
|
throw new Error(`wrong tag: expected ${tag}, got 0x${data[0]}`);
|
|
140
|
-
return
|
|
141
|
+
return coder.decode(data.subarray(1));
|
|
141
142
|
},
|
|
142
143
|
};
|
|
143
144
|
};
|
|
@@ -377,7 +378,7 @@ const u8f = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
|
377
378
|
const f64a = (arr) => new Float64Array(baswap64If(Uint8Array.from(arr.subarray(0, Math.floor(arr.byteLength / 8) * 8))).buffer);
|
|
378
379
|
// Exact big-endian binary64 hex helper for constants. Only decode() is currently used; malformed
|
|
379
380
|
// inputs fail through lower-level hex / DataView checks instead of an explicit wrapper guard.
|
|
380
|
-
const Float = {
|
|
381
|
+
const Float = /* @__PURE__ */ Object.freeze({
|
|
381
382
|
encode(n) {
|
|
382
383
|
const bytes = new Uint8Array(8);
|
|
383
384
|
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
@@ -389,7 +390,7 @@ const Float = {
|
|
|
389
390
|
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
390
391
|
return view.getFloat64(0, false);
|
|
391
392
|
},
|
|
392
|
-
};
|
|
393
|
+
});
|
|
393
394
|
// Decode a 64-bit bigint bit pattern into the exact binary64 value.
|
|
394
395
|
const f64b = (n) => Float.decode(numberToHexUnpadded(n));
|
|
395
396
|
// Constants
|
|
@@ -469,7 +470,7 @@ const gauss_1024_12289 = [
|
|
|
469
470
|
];
|
|
470
471
|
// Exact binary64 1/sigma payloads from round-3 fpr.h. Nearby decimal spellings round 1 ULP low in
|
|
471
472
|
// JS, so keep these as decoded bit patterns and recheck the raw payloads after edits.
|
|
472
|
-
const INV_SIGMA = [
|
|
473
|
+
const INV_SIGMA = /* @__PURE__ */ Object.freeze([
|
|
473
474
|
0.0, // unused
|
|
474
475
|
f64b(BigInt('4574611497772390042')),
|
|
475
476
|
f64b(BigInt('4574501679055810265')),
|
|
@@ -481,11 +482,11 @@ const INV_SIGMA = [
|
|
|
481
482
|
f64b(BigInt('4573721358406441454')),
|
|
482
483
|
f64b(BigInt('4573606369665796042')),
|
|
483
484
|
f64b(BigInt('4573496814039276259')),
|
|
484
|
-
];
|
|
485
|
+
]);
|
|
485
486
|
// Exact binary64 sigma_min constants from round-3 fpr.h indexed by logn; despite one PQClean
|
|
486
487
|
// summary comment, these are sigma_min itself, not 1/sigma_min, which is why this table stays
|
|
487
488
|
// separate from INV_SIGMA.
|
|
488
|
-
const SIGMA_MIN = [
|
|
489
|
+
const SIGMA_MIN = /* @__PURE__ */ Object.freeze([
|
|
489
490
|
0.0, // unused
|
|
490
491
|
f64b(BigInt('4607707126469777035')),
|
|
491
492
|
f64b(BigInt('4607777455861499430')),
|
|
@@ -497,7 +498,7 @@ const SIGMA_MIN = [
|
|
|
497
498
|
f64b(BigInt('4608340089478362016')),
|
|
498
499
|
f64b(BigInt('4608433670533905013')),
|
|
499
500
|
f64b(BigInt('4608525754002622308')),
|
|
500
|
-
];
|
|
501
|
+
]);
|
|
501
502
|
// Falcon Table 3.1 RCDT values for chi, split into 24-bit limbs; storage is [high, mid, low],
|
|
502
503
|
// so gaussian0() intentionally compares them against v0, v1, v2 in reverse order. The final
|
|
503
504
|
// RCDT[18] = 0 row is omitted because the algorithm iterates only over i = 0..17.
|
|
@@ -2171,12 +2172,12 @@ function genFalcon(opts) {
|
|
|
2171
2172
|
intPoly.sub(s1, c0); // 5: s₁ ← c - s₂h mod q ▷ s₁ should be normalized between -q/2 and q/2
|
|
2172
2173
|
return intPoly.isShort(signedCoder.encode(s1), s2); // 6: if ||(s₁, s₂)||² < [β²] then
|
|
2173
2174
|
};
|
|
2174
|
-
const info = { type: 'falcon' };
|
|
2175
|
-
const keyLengths = {
|
|
2175
|
+
const info = Object.freeze({ type: 'falcon' });
|
|
2176
|
+
const keyLengths = Object.freeze({
|
|
2176
2177
|
seed: 48,
|
|
2177
2178
|
publicKey: publicKeyCoder.bytesLen,
|
|
2178
2179
|
secretKey: secretKeyCoder.bytesLen,
|
|
2179
|
-
};
|
|
2180
|
+
});
|
|
2180
2181
|
// Noble exposes a 48-byte sampler-seed hook,
|
|
2181
2182
|
// but Falcon still samples/encodes a separate 40-byte nonce per signature.
|
|
2182
2183
|
const getRnd = (opts = {}) => {
|
|
@@ -2197,11 +2198,17 @@ function genFalcon(opts) {
|
|
|
2197
2198
|
if (opts.context !== undefined)
|
|
2198
2199
|
throw new Error('context is not supported');
|
|
2199
2200
|
};
|
|
2200
|
-
const tests = {
|
|
2201
|
+
const tests = Object.freeze({
|
|
2202
|
+
publicKeyCoder: Object.freeze(publicKeyCoder),
|
|
2203
|
+
privateKeyCoder: Object.freeze(secretKeyCoder),
|
|
2204
|
+
maxS2Len: opts.maxS2Len,
|
|
2205
|
+
});
|
|
2201
2206
|
// `signRand` documents only the sampler-seed input length;
|
|
2202
2207
|
// detached/attached signatures still include their own 40-byte nonce.
|
|
2203
|
-
const attachedLengths = { ...keyLengths, signRand: 48 };
|
|
2204
|
-
const lengths = opts.padded
|
|
2208
|
+
const attachedLengths = Object.freeze({ ...keyLengths, signRand: 48 });
|
|
2209
|
+
const lengths = opts.padded
|
|
2210
|
+
? Object.freeze({ ...attachedLengths, signature: opts.sigLen })
|
|
2211
|
+
: attachedLengths;
|
|
2205
2212
|
const keygen = (seed) => {
|
|
2206
2213
|
const randSeed = seed === undefined;
|
|
2207
2214
|
if (randSeed)
|
|
@@ -2249,7 +2256,7 @@ function genFalcon(opts) {
|
|
|
2249
2256
|
return false;
|
|
2250
2257
|
}
|
|
2251
2258
|
};
|
|
2252
|
-
const attached = {
|
|
2259
|
+
const attached = Object.freeze({
|
|
2253
2260
|
info,
|
|
2254
2261
|
lengths: attachedLengths,
|
|
2255
2262
|
keygen,
|
|
@@ -2267,7 +2274,7 @@ function genFalcon(opts) {
|
|
|
2267
2274
|
return msg;
|
|
2268
2275
|
throw new Error('invalid signature');
|
|
2269
2276
|
},
|
|
2270
|
-
};
|
|
2277
|
+
});
|
|
2271
2278
|
const res = {
|
|
2272
2279
|
info,
|
|
2273
2280
|
lengths,
|
|
@@ -2278,7 +2285,7 @@ function genFalcon(opts) {
|
|
|
2278
2285
|
verify,
|
|
2279
2286
|
};
|
|
2280
2287
|
res.__test = tests;
|
|
2281
|
-
return res;
|
|
2288
|
+
return Object.freeze(res);
|
|
2282
2289
|
}
|
|
2283
2290
|
const falcon512opts = {
|
|
2284
2291
|
N: 512,
|
|
@@ -2362,7 +2369,7 @@ export const falcon1024padded = /* @__PURE__ */ (() => genFalcon({
|
|
|
2362
2369
|
maxS2Len: 1239,
|
|
2363
2370
|
}))();
|
|
2364
2371
|
// NOTE: for tests only, don't use
|
|
2365
|
-
export const __tests = /* @__PURE__ */ (() => ({
|
|
2372
|
+
export const __tests = /* @__PURE__ */ (() => Object.freeze({
|
|
2366
2373
|
BNORM_MAX,
|
|
2367
2374
|
COMPLEX_ROOTS,
|
|
2368
2375
|
Float,
|