@noble/post-quantum 0.2.1 → 0.3.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 +62 -73
- package/_crystals.d.ts +1 -1
- package/_crystals.d.ts.map +1 -1
- package/_crystals.js +4 -0
- package/_crystals.js.map +1 -1
- package/esm/_crystals.d.ts +1 -1
- package/esm/_crystals.d.ts.map +1 -1
- package/esm/_crystals.js +4 -0
- package/esm/_crystals.js.map +1 -1
- package/esm/index.js +19 -1
- package/esm/index.js.map +1 -1
- package/esm/ml-dsa.d.ts +13 -32
- package/esm/ml-dsa.d.ts.map +1 -1
- package/esm/ml-dsa.js +14 -9
- package/esm/ml-dsa.js.map +1 -1
- package/esm/ml-kem.d.ts +20 -41
- package/esm/ml-kem.d.ts.map +1 -1
- package/esm/ml-kem.js +26 -25
- package/esm/ml-kem.js.map +1 -1
- package/esm/slh-dsa.d.ts +17 -4
- package/esm/slh-dsa.d.ts.map +1 -1
- package/esm/slh-dsa.js +68 -19
- package/esm/slh-dsa.js.map +1 -1
- package/esm/utils.d.ts +8 -3
- package/esm/utils.d.ts.map +1 -1
- package/esm/utils.js +7 -3
- package/esm/utils.js.map +1 -1
- package/index.js +19 -1
- package/index.js.map +1 -1
- package/ml-dsa.d.ts +13 -32
- package/ml-dsa.d.ts.map +1 -1
- package/ml-dsa.js +13 -8
- package/ml-dsa.js.map +1 -1
- package/ml-kem.d.ts +20 -41
- package/ml-kem.d.ts.map +1 -1
- package/ml-kem.js +25 -24
- package/ml-kem.js.map +1 -1
- package/package.json +16 -15
- package/slh-dsa.d.ts +17 -4
- package/slh-dsa.d.ts.map +1 -1
- package/slh-dsa.js +41 -2
- package/slh-dsa.js.map +1 -1
- package/src/_crystals.ts +19 -4
- package/src/index.ts +19 -1
- package/src/ml-dsa.ts +26 -18
- package/src/ml-kem.ts +53 -33
- package/src/slh-dsa.ts +58 -47
- package/src/utils.ts +18 -8
- package/utils.d.ts +8 -3
- package/utils.d.ts.map +1 -1
- package/utils.js +7 -2
- package/utils.js.map +1 -1
package/src/slh-dsa.ts
CHANGED
@@ -1,10 +1,38 @@
|
|
1
|
+
/**
|
2
|
+
* SLH-DSA: StateLess Hash-based Digital Signature Standard from
|
3
|
+
* [FIPS-205](https://csrc.nist.gov/pubs/fips/205/ipd). A.k.a. Sphincs+ v3.1.
|
4
|
+
*
|
5
|
+
* There are many different kinds of SLH, but basically `sha2` / `shake` indicate internal hash,
|
6
|
+
* `128` / `192` / `256` indicate security level, and `s` /`f` indicate trade-off (Small / Fast).
|
7
|
+
*
|
8
|
+
* Hashes function similarly to signatures. You hash a private key to get a public key,
|
9
|
+
* which can be used to verify the private key. However, this only works once since
|
10
|
+
* disclosing the pre-image invalidates the key.
|
11
|
+
*
|
12
|
+
* To address the "one-time" limitation, we can use a Merkle tree root hash:
|
13
|
+
* h(h(h(0) || h(1)) || h(h(2) || h(3))))
|
14
|
+
*
|
15
|
+
* This allows us to have the same public key output from the hash, but disclosing one
|
16
|
+
* path in the tree doesn't invalidate the others. By choosing a path related to the
|
17
|
+
* message, we can "sign" it.
|
18
|
+
*
|
19
|
+
* Limitation: Only a fixed number of signatures can be made. For instance, a Merkle tree
|
20
|
+
* with depth 8 allows 256 distinct messages. Using different trees for each node can
|
21
|
+
* prevent forgeries, but the key will still degrade over time.
|
22
|
+
*
|
23
|
+
* WOTS: One-time signatures (can be forged if same key used twice).
|
24
|
+
* FORS: Forest of Random Subsets
|
25
|
+
*
|
26
|
+
* Check out [official site](https://sphincs.org) & [repo](https://github.com/sphincs/sphincsplus).
|
27
|
+
* @module
|
28
|
+
*/
|
1
29
|
/*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */
|
2
30
|
import { HMAC } from '@noble/hashes/hmac';
|
3
31
|
import { sha256, sha512 } from '@noble/hashes/sha2';
|
4
32
|
import { shake256 } from '@noble/hashes/sha3';
|
5
|
-
import { bytesToHex,
|
33
|
+
import { bytesToHex, concatBytes, createView, hexToBytes } from '@noble/hashes/utils';
|
6
34
|
import {
|
7
|
-
Signer,
|
35
|
+
type Signer,
|
8
36
|
cleanBytes,
|
9
37
|
ensureBytes,
|
10
38
|
equalBytes,
|
@@ -14,35 +42,6 @@ import {
|
|
14
42
|
vecCoder,
|
15
43
|
} from './utils.js';
|
16
44
|
|
17
|
-
/*
|
18
|
-
Hash-based digital signature algorithm. See [official site](https://sphincs.org).
|
19
|
-
We implement spec v3.1 with latest FIPS-205 changes.
|
20
|
-
It's compatible with the latest version in the [official repo](https://github.com/sphincs/sphincsplus).
|
21
|
-
|
22
|
-
*/
|
23
|
-
|
24
|
-
/*
|
25
|
-
WOTS: One-time signatures (can be forged if same key used twice)
|
26
|
-
FORS: Forest of Random Subsets
|
27
|
-
|
28
|
-
Hashes are like signatures. You take private key, hash it, and share the result pubKey.
|
29
|
-
After that you can verify it was yours by also sharing the private key.
|
30
|
-
However, it will only work once: after pre-image was disclosed, it can't be used again.
|
31
|
-
It also doesn't sign the message: can be interceptd and message can be replaced.
|
32
|
-
|
33
|
-
How to solve "one-time" hashing? Instead of hash(k), we can provide merkle tree root hash:
|
34
|
-
|
35
|
-
h(h(h(0) || h(1)) || h(h(2) || h(3))))
|
36
|
-
|
37
|
-
Now, we have the same pubKey output of hash, but disclosing one path in tree doesn't
|
38
|
-
invalidate the others, since they are still unknown. By choosing path which is related
|
39
|
-
to the message, we can "sign" it.
|
40
|
-
|
41
|
-
There is a limitation: only a fixed amount of signatures can be made,
|
42
|
-
a merkle tree with depth: 8 would mean 2**8 (256) paths aka 256 distinct messages.
|
43
|
-
Attaching a different tree to each node will solve forgeries, but the key would still degrade.
|
44
|
-
*/
|
45
|
-
|
46
45
|
/**
|
47
46
|
* * N: Security parameter (in bytes). W: Winternitz parameter
|
48
47
|
* * H: Hypertree height. D: Hypertree layers
|
@@ -62,6 +61,7 @@ export type SphincsHashOpts = {
|
|
62
61
|
getContext: GetContext;
|
63
62
|
};
|
64
63
|
|
64
|
+
/** Winternitz signature params. */
|
65
65
|
export const PARAMS: Record<string, SphincsOpts> = {
|
66
66
|
'128f': { W: 16, N: 16, H: 66, D: 22, K: 33, A: 6 },
|
67
67
|
'128s': { W: 16, N: 16, H: 63, D: 7, K: 14, A: 12 },
|
@@ -81,9 +81,10 @@ const enum AddressType {
|
|
81
81
|
FORSPRF,
|
82
82
|
}
|
83
83
|
|
84
|
+
/** Address, byte array of size ADDR_BYTES */
|
84
85
|
export type ADRS = Uint8Array;
|
85
86
|
|
86
|
-
type Context = {
|
87
|
+
export type Context = {
|
87
88
|
PRFaddr: (addr: ADRS) => Uint8Array;
|
88
89
|
PRFmsg: (skPRF: Uint8Array, random: Uint8Array, msg: Uint8Array) => Uint8Array;
|
89
90
|
Hmsg: (R: Uint8Array, pk: Uint8Array, m: Uint8Array, outLen: number) => Uint8Array;
|
@@ -130,7 +131,7 @@ function getMaskBig(bits: number) {
|
|
130
131
|
return (1n << BigInt(bits)) - 1n; // 4 -> 0b1111
|
131
132
|
}
|
132
133
|
|
133
|
-
type SphincsSigner = Signer & { seedLen: number };
|
134
|
+
export type SphincsSigner = Signer & { seedLen: number };
|
134
135
|
|
135
136
|
function gen(opts: SphincsOpts, hashOpts: SphincsHashOpts): SphincsSigner {
|
136
137
|
const { N, W, H, D, K, A } = opts;
|
@@ -562,13 +563,18 @@ const genShake =
|
|
562
563
|
|
563
564
|
const SHAKE_SIMPLE = { getContext: genShake() };
|
564
565
|
|
565
|
-
|
566
|
-
export const slh_dsa_shake_128f = /* @__PURE__ */ gen(PARAMS['128f'], SHAKE_SIMPLE);
|
567
|
-
|
568
|
-
export const
|
569
|
-
|
570
|
-
export const
|
571
|
-
|
566
|
+
/** SLH-DSA: 128-bit fast SHAKE version. */
|
567
|
+
export const slh_dsa_shake_128f: SphincsSigner = /* @__PURE__ */ gen(PARAMS['128f'], SHAKE_SIMPLE);
|
568
|
+
/** SLH-DSA: 128-bit short SHAKE version. */
|
569
|
+
export const slh_dsa_shake_128s: SphincsSigner = /* @__PURE__ */ gen(PARAMS['128s'], SHAKE_SIMPLE);
|
570
|
+
/** SLH-DSA: 192-bit fast SHAKE version. */
|
571
|
+
export const slh_dsa_shake_192f: SphincsSigner = /* @__PURE__ */ gen(PARAMS['192f'], SHAKE_SIMPLE);
|
572
|
+
/** SLH-DSA: 192-bit short SHAKE version. */
|
573
|
+
export const slh_dsa_shake_192s: SphincsSigner = /* @__PURE__ */ gen(PARAMS['192s'], SHAKE_SIMPLE);
|
574
|
+
/** SLH-DSA: 256-bit fast SHAKE version. */
|
575
|
+
export const slh_dsa_shake_256f: SphincsSigner = /* @__PURE__ */ gen(PARAMS['256f'], SHAKE_SIMPLE);
|
576
|
+
/** SLH-DSA: 256-bit short SHAKE version. */
|
577
|
+
export const slh_dsa_shake_256s: SphincsSigner = /* @__PURE__ */ gen(PARAMS['256s'], SHAKE_SIMPLE);
|
572
578
|
|
573
579
|
type ShaType = typeof sha256 | typeof sha512;
|
574
580
|
const genSha =
|
@@ -668,10 +674,15 @@ const SHA512_SIMPLE = {
|
|
668
674
|
getContext: genSha(sha256, sha512),
|
669
675
|
};
|
670
676
|
|
671
|
-
|
672
|
-
export const slh_dsa_sha2_128f = /* @__PURE__ */ gen(PARAMS['128f'], SHA256_SIMPLE);
|
673
|
-
|
674
|
-
export const
|
675
|
-
|
676
|
-
export const
|
677
|
-
|
677
|
+
/** SLH-DSA: 128-bit fast SHA2 version. */
|
678
|
+
export const slh_dsa_sha2_128f: SphincsSigner = /* @__PURE__ */ gen(PARAMS['128f'], SHA256_SIMPLE);
|
679
|
+
/** SLH-DSA: 128-bit small SHA2 version. */
|
680
|
+
export const slh_dsa_sha2_128s: SphincsSigner = /* @__PURE__ */ gen(PARAMS['128s'], SHA256_SIMPLE);
|
681
|
+
/** SLH-DSA: 192-bit fast SHA2 version. */
|
682
|
+
export const slh_dsa_sha2_192f: SphincsSigner = /* @__PURE__ */ gen(PARAMS['192f'], SHA512_SIMPLE);
|
683
|
+
/** SLH-DSA: 192-bit small SHA2 version. */
|
684
|
+
export const slh_dsa_sha2_192s: SphincsSigner = /* @__PURE__ */ gen(PARAMS['192s'], SHA512_SIMPLE);
|
685
|
+
/** SLH-DSA: 256-bit fast SHA2 version. */
|
686
|
+
export const slh_dsa_sha2_256f: SphincsSigner = /* @__PURE__ */ gen(PARAMS['256f'], SHA512_SIMPLE);
|
687
|
+
/** SLH-DSA: 256-bit small SHA2 version. */
|
688
|
+
export const slh_dsa_sha2_256s: SphincsSigner = /* @__PURE__ */ gen(PARAMS['256s'], SHA512_SIMPLE);
|
package/src/utils.ts
CHANGED
@@ -1,19 +1,29 @@
|
|
1
|
+
/**
|
2
|
+
* Utilities for hex, bytearray and number handling.
|
3
|
+
* @module
|
4
|
+
*/
|
1
5
|
/*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */
|
2
|
-
import {
|
3
|
-
import {
|
6
|
+
import { abytes } from '@noble/hashes/_assert';
|
7
|
+
import {
|
8
|
+
type TypedArray,
|
9
|
+
concatBytes,
|
10
|
+
randomBytes as randb,
|
11
|
+
utf8ToBytes,
|
12
|
+
} from '@noble/hashes/utils';
|
4
13
|
|
5
|
-
export const ensureBytes = abytes;
|
6
|
-
export const randomBytes = randb;
|
7
|
-
export { concatBytes };
|
14
|
+
export const ensureBytes: typeof abytes = abytes;
|
15
|
+
export const randomBytes: typeof randb = randb;
|
16
|
+
export { concatBytes, utf8ToBytes };
|
8
17
|
|
9
18
|
// Compares 2 u8a-s in kinda constant time
|
10
|
-
export function equalBytes(a: Uint8Array, b: Uint8Array) {
|
19
|
+
export function equalBytes(a: Uint8Array, b: Uint8Array): boolean {
|
11
20
|
if (a.length !== b.length) return false;
|
12
21
|
let diff = 0;
|
13
22
|
for (let i = 0; i < a.length; i++) diff |= a[i] ^ b[i];
|
14
23
|
return diff === 0;
|
15
24
|
}
|
16
25
|
|
26
|
+
/** Generic interface for signatures. Has keygen, sign and verify. */
|
17
27
|
export type Signer = {
|
18
28
|
signRandBytes: number;
|
19
29
|
keygen: (seed: Uint8Array) => {
|
@@ -102,13 +112,13 @@ export function vecCoder<T>(c: BytesCoderLen<T>, vecLen: number): BytesCoderLen<
|
|
102
112
|
}
|
103
113
|
|
104
114
|
// cleanBytes(new Uint8Array(), [new Uint16Array(), new Uint32Array()])
|
105
|
-
export function cleanBytes(...list: (TypedArray | TypedArray[])[]) {
|
115
|
+
export function cleanBytes(...list: (TypedArray | TypedArray[])[]): void {
|
106
116
|
for (const t of list) {
|
107
117
|
if (Array.isArray(t)) for (const b of t) b.fill(0);
|
108
118
|
else t.fill(0);
|
109
119
|
}
|
110
120
|
}
|
111
121
|
|
112
|
-
export function getMask(bits: number) {
|
122
|
+
export function getMask(bits: number): number {
|
113
123
|
return (1 << bits) - 1; // 4 -> 0b1111
|
114
124
|
}
|
package/utils.d.ts
CHANGED
@@ -1,10 +1,15 @@
|
|
1
|
+
/**
|
2
|
+
* Utilities for hex, bytearray and number handling.
|
3
|
+
* @module
|
4
|
+
*/
|
1
5
|
/*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */
|
2
|
-
import {
|
3
|
-
import { TypedArray, randomBytes as randb,
|
6
|
+
import { abytes } from '@noble/hashes/_assert';
|
7
|
+
import { type TypedArray, concatBytes, randomBytes as randb, utf8ToBytes } from '@noble/hashes/utils';
|
4
8
|
export declare const ensureBytes: typeof abytes;
|
5
9
|
export declare const randomBytes: typeof randb;
|
6
|
-
export { concatBytes };
|
10
|
+
export { concatBytes, utf8ToBytes };
|
7
11
|
export declare function equalBytes(a: Uint8Array, b: Uint8Array): boolean;
|
12
|
+
/** Generic interface for signatures. Has keygen, sign and verify. */
|
8
13
|
export type Signer = {
|
9
14
|
signRandBytes: number;
|
10
15
|
keygen: (seed: Uint8Array) => {
|
package/utils.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,EAAE,
|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AM,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,CAAC,CAAC;CAClC;AAED,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAGpE,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC5D,KAAK,QAAQ,CAAC,CAAC,SAAS,CAAC,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI;KACxD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACjE,CAAC;AACF,wBAAgB,UAAU,CAAC,CAAC,SAAS,CAAC,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,EAClE,GAAG,OAAO,EAAE,CAAC,GACZ,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CA8BhD;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,EAAE,CAAC,CAwBnF;AAGD,wBAAgB,UAAU,CAAC,GAAG,IAAI,EAAE,CAAC,UAAU,GAAG,UAAU,EAAE,CAAC,EAAE,GAAG,IAAI,CAKvE;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C"}
|
package/utils.js
CHANGED
@@ -1,16 +1,21 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.concatBytes = exports.randomBytes = exports.ensureBytes = void 0;
|
3
|
+
exports.utf8ToBytes = exports.concatBytes = exports.randomBytes = exports.ensureBytes = void 0;
|
4
4
|
exports.equalBytes = equalBytes;
|
5
5
|
exports.splitCoder = splitCoder;
|
6
6
|
exports.vecCoder = vecCoder;
|
7
7
|
exports.cleanBytes = cleanBytes;
|
8
8
|
exports.getMask = getMask;
|
9
|
+
/**
|
10
|
+
* Utilities for hex, bytearray and number handling.
|
11
|
+
* @module
|
12
|
+
*/
|
9
13
|
/*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */
|
10
14
|
const _assert_1 = require("@noble/hashes/_assert");
|
11
15
|
const utils_1 = require("@noble/hashes/utils");
|
12
16
|
Object.defineProperty(exports, "concatBytes", { enumerable: true, get: function () { return utils_1.concatBytes; } });
|
13
|
-
exports
|
17
|
+
Object.defineProperty(exports, "utf8ToBytes", { enumerable: true, get: function () { return utils_1.utf8ToBytes; } });
|
18
|
+
exports.ensureBytes = _assert_1.abytes;
|
14
19
|
exports.randomBytes = utils_1.randomBytes;
|
15
20
|
// Compares 2 u8a-s in kinda constant time
|
16
21
|
function equalBytes(a, b) {
|
package/utils.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":";;;AAkBA,gCAKC;AA8BD,gCAgCC;AAED,4BAwBC;AAGD,gCAKC;AAED,0BAEC;AA3HD;;;GAGG;AACH,4EAA4E;AAC5E,mDAA+C;AAC/C,+CAK6B;AAIpB,4FAPP,mBAAW,OAOO;AAAE,4FALpB,mBAAW,OAKoB;AAFpB,QAAA,WAAW,GAAkB,gBAAM,CAAC;AACpC,QAAA,WAAW,GAAiB,mBAAK,CAAC;AAG/C,0CAA0C;AAC1C,SAAgB,UAAU,CAAC,CAAa,EAAE,CAAa;IACrD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,K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