@noble/post-quantum 0.4.1 → 0.5.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 +53 -33
- package/_crystals.d.ts +1 -1
- package/_crystals.d.ts.map +1 -1
- package/_crystals.js +31 -46
- package/_crystals.js.map +1 -1
- package/hybrid.d.ts +102 -0
- package/hybrid.d.ts.map +1 -0
- package/hybrid.js +283 -0
- package/hybrid.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +4 -4
- package/index.js.map +1 -1
- package/ml-dsa.d.ts +16 -8
- package/ml-dsa.d.ts.map +1 -1
- package/ml-dsa.js +126 -68
- package/ml-dsa.js.map +1 -1
- package/ml-kem.d.ts +1 -14
- package/ml-kem.d.ts.map +1 -1
- package/ml-kem.js +70 -54
- package/ml-kem.js.map +1 -1
- package/package.json +38 -85
- package/slh-dsa.d.ts +4 -3
- package/slh-dsa.d.ts.map +1 -1
- package/slh-dsa.js +113 -86
- package/slh-dsa.js.map +1 -1
- package/src/_crystals.ts +30 -41
- package/src/hybrid.ts +373 -0
- package/src/index.ts +3 -3
- package/src/ml-dsa.ts +129 -42
- package/src/ml-kem.ts +52 -49
- package/src/slh-dsa.ts +97 -56
- package/src/utils.ts +86 -50
- package/utils.d.ts +53 -11
- package/utils.d.ts.map +1 -1
- package/utils.js +54 -60
- package/utils.js.map +1 -1
- package/esm/_crystals.d.ts +0 -34
- package/esm/_crystals.d.ts.map +0 -1
- package/esm/_crystals.js +0 -141
- package/esm/_crystals.js.map +0 -1
- package/esm/index.d.ts +0 -2
- package/esm/index.d.ts.map +0 -1
- package/esm/index.js +0 -21
- package/esm/index.js.map +0 -1
- package/esm/ml-dsa.d.ts +0 -25
- package/esm/ml-dsa.d.ts.map +0 -1
- package/esm/ml-dsa.js +0 -525
- package/esm/ml-dsa.js.map +0 -1
- package/esm/ml-kem.d.ts +0 -34
- package/esm/ml-kem.d.ts.map +0 -1
- package/esm/ml-kem.js +0 -306
- package/esm/ml-kem.js.map +0 -1
- package/esm/package.json +0 -10
- package/esm/slh-dsa.d.ts +0 -62
- package/esm/slh-dsa.d.ts.map +0 -1
- package/esm/slh-dsa.js +0 -596
- package/esm/slh-dsa.js.map +0 -1
- package/esm/utils.d.ts +0 -40
- package/esm/utils.d.ts.map +0 -1
- package/esm/utils.js +0 -133
- package/esm/utils.js.map +0 -1
- package/src/package.json +0 -3
package/hybrid.js
ADDED
@@ -0,0 +1,283 @@
|
|
1
|
+
/**
|
2
|
+
* Post-Quantum Hybrid Cryptography
|
3
|
+
*
|
4
|
+
* The current implementation is flawed and likely redundant. We should offer
|
5
|
+
* a small, generic API to compose hybrid schemes instead of reimplementing
|
6
|
+
* protocol-specific logic (SSH, GPG, etc.) with ad hoc encodings.
|
7
|
+
*
|
8
|
+
* 1. Core Issues
|
9
|
+
* - sign/verify: implemented as two separate operations with different keys.
|
10
|
+
* - EC getSharedSecret: could be refactored into a proper KEM.
|
11
|
+
* - Multiple calls: keys, signatures, and shared secrets could be
|
12
|
+
* concatenated to reduce the number of API invocations.
|
13
|
+
* - Reinvention: most libraries add strange domain separations and
|
14
|
+
* encodings instead of simple byte concatenation.
|
15
|
+
*
|
16
|
+
* 2. API Goals
|
17
|
+
* - Provide primitives to build hybrids generically.
|
18
|
+
* - Avoid embedding SSH- or GPG-specific formats in the core API.
|
19
|
+
*
|
20
|
+
* 3. Edge Cases
|
21
|
+
* • Variable-length signatures:
|
22
|
+
* - DER-encoded (Weierstrass curves).
|
23
|
+
* - Falcon (unpadded).
|
24
|
+
* - Concatenation works only if length is fixed; otherwise a length
|
25
|
+
* prefix is required (but that breaks compatibility).
|
26
|
+
*
|
27
|
+
* • getSharedSecret:
|
28
|
+
* - Default: non-KEM (authenticated ECDH).
|
29
|
+
* - KEM conversion: generate a random SK to remove implicit auth.
|
30
|
+
*
|
31
|
+
* 4. Common Pitfalls
|
32
|
+
* - Seed expansion:
|
33
|
+
* • Expanding a small seed into multiple keys reduces entropy.
|
34
|
+
* • API should allow identity mapping (no expansion).
|
35
|
+
*
|
36
|
+
* - Skipping full point encoding:
|
37
|
+
* • Some omit the compression byte (parity) for WebCrypto compatibility.
|
38
|
+
* • Better: hash the raw secret; coordinate output is already non-uniform.
|
39
|
+
* • Some curves (e.g., X448) produce secrets that must be re-hashed to match
|
40
|
+
* symmetric-key lengths.
|
41
|
+
*
|
42
|
+
* - Combiner inconsistencies:
|
43
|
+
* • Different domain separations and encodings across libraries.
|
44
|
+
* • Should live at the application layer, since key lengths vary.
|
45
|
+
*
|
46
|
+
* 5. Protocol Examples
|
47
|
+
* - SSH:
|
48
|
+
* • Concatenate keys.
|
49
|
+
* • Combiner: SHA-512.
|
50
|
+
*
|
51
|
+
* - GPG:
|
52
|
+
* • Concatenate keys.
|
53
|
+
* • Combiner: SHA3-256(kemShare || ecdhShare || ciphertext || pubKey || algId || domSep || len(domSep))
|
54
|
+
*
|
55
|
+
* - TLS:
|
56
|
+
* • Transcript-based derivation (HKDF).
|
57
|
+
*
|
58
|
+
* 6. Relevant Specs & Implementations
|
59
|
+
* - IETF Hybrid KEM drafts:
|
60
|
+
* • draft-irtf-cfrg-hybrid-kems
|
61
|
+
* • draft-connolly-cfrg-xwing-kem
|
62
|
+
* • draft-westerbaan-tls-xyber768d00
|
63
|
+
*
|
64
|
+
* - PQC Libraries:
|
65
|
+
* • superdilithium (cyph/pqcrypto.js) – low adoption.
|
66
|
+
* • hybrid-pqc (DogeProtocol, quantumcoinproject) – complex encodings.
|
67
|
+
*
|
68
|
+
* 7. Signatures
|
69
|
+
* - Ed25519: fixed-size, easy to support.
|
70
|
+
* - Variable-size: introduces custom format requirements; best left to
|
71
|
+
* higher-level code.
|
72
|
+
*
|
73
|
+
* @module
|
74
|
+
*/
|
75
|
+
/*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */
|
76
|
+
import {} from '@noble/curves/abstract/edwards.js';
|
77
|
+
import {} from '@noble/curves/abstract/montgomery.js';
|
78
|
+
import {} from '@noble/curves/abstract/weierstrass.js';
|
79
|
+
import { x25519 } from '@noble/curves/ed25519.js';
|
80
|
+
import { p256, p384 } from '@noble/curves/nist.js';
|
81
|
+
import { asciiToBytes, bytesToNumberBE, bytesToNumberLE, concatBytes, numberToBytesBE, } from '@noble/curves/utils.js';
|
82
|
+
import { expand, extract } from '@noble/hashes/hkdf.js';
|
83
|
+
import { sha256 } from '@noble/hashes/sha2.js';
|
84
|
+
import { sha3_256, shake256 } from '@noble/hashes/sha3.js';
|
85
|
+
import { abytes, ahash, anumber } from '@noble/hashes/utils.js';
|
86
|
+
import { ml_kem1024, ml_kem768 } from "./ml-kem.js";
|
87
|
+
import { cleanBytes, randomBytes, splitCoder, } from "./utils.js";
|
88
|
+
// Can re-use if decide to signatures support, on other hand getSecretKey is specific and ugly
|
89
|
+
function ecKeygen(curve, allowZeroKey = false) {
|
90
|
+
const lengths = curve.lengths;
|
91
|
+
let keygen = curve.keygen;
|
92
|
+
if (allowZeroKey) {
|
93
|
+
// This is ugly, but we need to return exact results here.
|
94
|
+
const wCurve = curve;
|
95
|
+
const Fn = wCurve.Point.Fn;
|
96
|
+
if (!Fn)
|
97
|
+
throw new Error('No Point.Fn');
|
98
|
+
keygen = (seed = randomBytes(lengths.seed)) => {
|
99
|
+
abytes(seed, lengths.seed, 'seed');
|
100
|
+
const seedScalar = Fn.isLE ? bytesToNumberLE(seed) : bytesToNumberBE(seed);
|
101
|
+
const secretKey = Fn.toBytes(Fn.create(seedScalar)); // Fixes modulo bias, but not zero
|
102
|
+
return { secretKey, publicKey: curve.getPublicKey(secretKey) };
|
103
|
+
};
|
104
|
+
}
|
105
|
+
return {
|
106
|
+
lengths: { secretKey: lengths.secretKey, publicKey: lengths.publicKey, seed: lengths.seed },
|
107
|
+
keygen,
|
108
|
+
getPublicKey: (secretKey) => curve.getPublicKey(secretKey),
|
109
|
+
};
|
110
|
+
}
|
111
|
+
export const ecdhKem = (curve, allowZeroKey = false) => {
|
112
|
+
const kg = ecKeygen(curve, allowZeroKey);
|
113
|
+
if (!curve.getSharedSecret)
|
114
|
+
throw new Error('wrong curve'); // ed25519 doesn't have one!
|
115
|
+
return {
|
116
|
+
lengths: { ...kg.lengths, msg: kg.lengths.seed, cipherText: kg.lengths.publicKey },
|
117
|
+
keygen: kg.keygen,
|
118
|
+
getPublicKey: kg.getPublicKey,
|
119
|
+
encapsulate(publicKey, rand = randomBytes(curve.lengths.secretKey)) {
|
120
|
+
const ek = this.keygen(rand).secretKey;
|
121
|
+
const sharedSecret = this.decapsulate(publicKey, ek);
|
122
|
+
const cipherText = curve.getPublicKey(ek);
|
123
|
+
cleanBytes(ek);
|
124
|
+
return { sharedSecret, cipherText };
|
125
|
+
},
|
126
|
+
decapsulate(cipherText, secretKey) {
|
127
|
+
const res = curve.getSharedSecret(secretKey, cipherText);
|
128
|
+
return curve.lengths.publicKeyHasPrefix ? res.subarray(1) : res;
|
129
|
+
},
|
130
|
+
};
|
131
|
+
};
|
132
|
+
export const ecSigner = (curve, allowZeroKey = false) => {
|
133
|
+
const kg = ecKeygen(curve, allowZeroKey);
|
134
|
+
if (!curve.sign || !curve.verify)
|
135
|
+
throw new Error('wrong curve'); // ed25519 doesn't have one!
|
136
|
+
return {
|
137
|
+
lengths: { ...kg.lengths, signature: curve.lengths.signature, signRand: 0 },
|
138
|
+
keygen: kg.keygen,
|
139
|
+
getPublicKey: kg.getPublicKey,
|
140
|
+
sign: (message, secretKey) => curve.sign(message, secretKey),
|
141
|
+
verify: (signature, message, publicKey) => curve.verify(signature, message, publicKey),
|
142
|
+
};
|
143
|
+
};
|
144
|
+
function splitLengths(lst, name) {
|
145
|
+
return splitCoder(name, ...lst.map((i) => {
|
146
|
+
if (typeof i.lengths[name] !== 'number')
|
147
|
+
throw new Error('wrong length: ' + name);
|
148
|
+
return i.lengths[name];
|
149
|
+
}));
|
150
|
+
}
|
151
|
+
// It is XOF for most cases, but can be more complex!
|
152
|
+
export function expandSeedXof(xof) {
|
153
|
+
return (seed, seedLen) => xof(seed, { dkLen: seedLen });
|
154
|
+
}
|
155
|
+
function combineKeys(realSeedLen, // how much bytes expandSeed expects
|
156
|
+
expandSeed, ...ck) {
|
157
|
+
const seedCoder = splitLengths(ck, 'seed');
|
158
|
+
const pkCoder = splitLengths(ck, 'publicKey');
|
159
|
+
// Allows to use identity functions for combiner/expandSeed
|
160
|
+
if (realSeedLen === undefined)
|
161
|
+
realSeedLen = seedCoder.bytesLen;
|
162
|
+
anumber(realSeedLen);
|
163
|
+
function expandDecapsulationKey(seed) {
|
164
|
+
abytes(seed, realSeedLen);
|
165
|
+
const expanded = seedCoder.decode(expandSeed(seed, seedCoder.bytesLen));
|
166
|
+
const keys = ck.map((i, j) => i.keygen(expanded[j]));
|
167
|
+
const secretKey = keys.map((i) => i.secretKey);
|
168
|
+
const publicKey = keys.map((i) => i.publicKey);
|
169
|
+
return { secretKey, publicKey };
|
170
|
+
}
|
171
|
+
return {
|
172
|
+
info: { lengths: { seed: realSeedLen, publicKey: pkCoder.bytesLen, secretKey: realSeedLen } },
|
173
|
+
getPublicKey(secretKey) {
|
174
|
+
return this.keygen(secretKey).publicKey;
|
175
|
+
},
|
176
|
+
keygen(seed = randomBytes(realSeedLen)) {
|
177
|
+
const { publicKey: pk, secretKey } = expandDecapsulationKey(seed);
|
178
|
+
const publicKey = pkCoder.encode(pk);
|
179
|
+
cleanBytes(pk);
|
180
|
+
cleanBytes(secretKey);
|
181
|
+
return { secretKey: seed, publicKey };
|
182
|
+
},
|
183
|
+
expandDecapsulationKey,
|
184
|
+
realSeedLen,
|
185
|
+
};
|
186
|
+
}
|
187
|
+
// This generic function that combines multiple KEMs into single one
|
188
|
+
export function combineKEMS(realSeedLen, // how much bytes expandSeed expects
|
189
|
+
realMsgLen, // how much bytes combiner returns
|
190
|
+
expandSeed, combiner, ...kems) {
|
191
|
+
const keys = combineKeys(realSeedLen, expandSeed, ...kems);
|
192
|
+
const ctCoder = splitLengths(kems, 'cipherText');
|
193
|
+
const pkCoder = splitLengths(kems, 'publicKey');
|
194
|
+
const msgCoder = splitLengths(kems, 'msg');
|
195
|
+
if (realMsgLen === undefined)
|
196
|
+
realMsgLen = msgCoder.bytesLen;
|
197
|
+
anumber(realMsgLen);
|
198
|
+
return {
|
199
|
+
lengths: {
|
200
|
+
...keys.info.lengths,
|
201
|
+
msg: realMsgLen,
|
202
|
+
msgRand: msgCoder.bytesLen,
|
203
|
+
cipherText: ctCoder.bytesLen,
|
204
|
+
},
|
205
|
+
getPublicKey: keys.getPublicKey,
|
206
|
+
keygen: keys.keygen,
|
207
|
+
encapsulate(pk, randomness = randomBytes(msgCoder.bytesLen)) {
|
208
|
+
const pks = pkCoder.decode(pk);
|
209
|
+
const rand = msgCoder.decode(randomness);
|
210
|
+
const enc = kems.map((i, j) => i.encapsulate(pks[j], rand[j]));
|
211
|
+
const sharedSecret = enc.map((i) => i.sharedSecret);
|
212
|
+
const cipherText = enc.map((i) => i.cipherText);
|
213
|
+
const res = {
|
214
|
+
sharedSecret: combiner(pks, cipherText, sharedSecret),
|
215
|
+
cipherText: ctCoder.encode(cipherText),
|
216
|
+
};
|
217
|
+
cleanBytes(sharedSecret, cipherText, pks);
|
218
|
+
return res;
|
219
|
+
},
|
220
|
+
decapsulate(ct, seed) {
|
221
|
+
const cts = ctCoder.decode(ct);
|
222
|
+
const { publicKey, secretKey } = keys.expandDecapsulationKey(seed);
|
223
|
+
const sharedSecret = kems.map((i, j) => i.decapsulate(cts[j], secretKey[j]));
|
224
|
+
return combiner(publicKey, cts, sharedSecret);
|
225
|
+
},
|
226
|
+
};
|
227
|
+
}
|
228
|
+
// There is no specs for this, but can be useful
|
229
|
+
// realSeedLen: how much bytes expandSeed expects.
|
230
|
+
export function combineSigners(realSeedLen, expandSeed, ...signers) {
|
231
|
+
const keys = combineKeys(realSeedLen, expandSeed, ...signers);
|
232
|
+
const sigCoder = splitLengths(signers, 'signature');
|
233
|
+
const pkCoder = splitLengths(signers, 'publicKey');
|
234
|
+
return {
|
235
|
+
lengths: { ...keys.info.lengths, signature: sigCoder.bytesLen, signRand: 0 },
|
236
|
+
getPublicKey: keys.getPublicKey,
|
237
|
+
keygen: keys.keygen,
|
238
|
+
sign(message, seed) {
|
239
|
+
const { secretKey } = keys.expandDecapsulationKey(seed);
|
240
|
+
// NOTE: we probably can make different hashes for different algorithms
|
241
|
+
// same way as we do for kem, but not sure if this a good idea.
|
242
|
+
const sigs = signers.map((i, j) => i.sign(message, secretKey[j]));
|
243
|
+
return sigCoder.encode(sigs);
|
244
|
+
},
|
245
|
+
verify: (signature, message, publicKey) => {
|
246
|
+
const pks = pkCoder.decode(publicKey);
|
247
|
+
const sigs = sigCoder.decode(signature);
|
248
|
+
for (let i = 0; i < signers.length; i++) {
|
249
|
+
if (!signers[i].verify(sigs[i], message, pks[i]))
|
250
|
+
return false;
|
251
|
+
}
|
252
|
+
return true;
|
253
|
+
},
|
254
|
+
};
|
255
|
+
}
|
256
|
+
export function QSF(label, pqc, curveKEM, xof, kdf) {
|
257
|
+
ahash(xof);
|
258
|
+
ahash(kdf);
|
259
|
+
return combineKEMS(32, 32, expandSeedXof(xof), (pk, ct, ss) => kdf(concatBytes(ss[0], ss[1], ct[1], pk[1], asciiToBytes(label))), pqc, curveKEM);
|
260
|
+
}
|
261
|
+
export const QSFMLKEM768P256 = QSF('QSF-KEM(ML-KEM-768,P-256)-XOF(SHAKE256)-KDF(SHA3-256)', ml_kem768, ecdhKem(p256, true), shake256, sha3_256);
|
262
|
+
export const QSFMLKEM1024P384 = QSF('QSF-KEM(ML-KEM-1024,P-384)-XOF(SHAKE256)-KDF(SHA3-256)', ml_kem1024, ecdhKem(p384, true), shake256, sha3_256);
|
263
|
+
export function KitchenSink(label, pqc, curveKEM, xof, hash) {
|
264
|
+
ahash(xof);
|
265
|
+
ahash(hash);
|
266
|
+
return combineKEMS(32, 32, expandSeedXof(xof), (pk, ct, ss) => {
|
267
|
+
const preimage = concatBytes(ss[0], ss[1], ct[0], pk[0], ct[1], pk[1], asciiToBytes(label));
|
268
|
+
const len = 32;
|
269
|
+
const ikm = concatBytes(asciiToBytes('hybrid_prk'), preimage);
|
270
|
+
const prk = extract(hash, ikm);
|
271
|
+
const info = concatBytes(numberToBytesBE(len, 2), asciiToBytes('shared_secret'), asciiToBytes(''));
|
272
|
+
const res = expand(hash, prk, info, len);
|
273
|
+
cleanBytes(prk, info, ikm, preimage);
|
274
|
+
return res;
|
275
|
+
}, pqc, curveKEM);
|
276
|
+
}
|
277
|
+
const x25519kem = ecdhKem(x25519);
|
278
|
+
export const KitchenSinkMLKEM768X25519 = KitchenSink('KitchenSink-KEM(ML-KEM-768,X25519)-XOF(SHAKE256)-KDF(HKDF-SHA-256)', ml_kem768, x25519kem, shake256, sha256);
|
279
|
+
// Always X25519 and ML-KEM - 768, no point to export
|
280
|
+
export const XWing = combineKEMS(32, 32, expandSeedXof(shake256),
|
281
|
+
// Awesome label, so much escaping hell in a single line.
|
282
|
+
(pk, ct, ss) => sha3_256(concatBytes(ss[0], ss[1], ct[1], pk[1], asciiToBytes('\\.//^\\'))), ml_kem768, x25519kem);
|
283
|
+
//# sourceMappingURL=hybrid.js.map
|
package/hybrid.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hybrid.js","sourceRoot":"","sources":["src/hybrid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,4EAA4E;AAC5E,OAAO,EAAc,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAuB,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAc,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,EACf,WAAW,EACX,eAAe,GAChB,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C,CAAC;QACrC,OAAO,GAAG,CAAC;IACb,CAAC,EACD,GAAG,EACH,QAAQ,CACT,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,yBAAyB,GAAQ,WAAW,CACvD,oEAAoE,EACpE,SAAS,EACT,SAAS,EACT,QAAQ,EACR,MAAM,CACP,CAAC;AAEF,qDAAqD;AACrD,MAAM,CAAC,MAAM,KAAK,GAAQ,WAAW,CACnC,EAAE,EACF,EAAE,EACF,aAAa,CAAC,QAAQ,CAAC;AACvB,yDAAyD;AACzD,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,EAC3F,SAAS,EACT,SAAS,CACV,CAAC"}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
@@ -1,12 +1,11 @@
|
|
1
|
-
"use strict";
|
2
1
|
/**
|
3
2
|
* Auditable & minimal JS implementation of post-quantum public-key cryptography.
|
4
3
|
* Check out individual modules.
|
5
4
|
* @module
|
6
5
|
* @example
|
7
6
|
```js
|
8
|
-
import { ml_kem512, ml_kem768, ml_kem1024 } from '@noble/post-quantum/ml-kem';
|
9
|
-
import { ml_dsa44, ml_dsa65, ml_dsa87 } from '@noble/post-quantum/ml-dsa';
|
7
|
+
import { ml_kem512, ml_kem768, ml_kem1024 } from '@noble/post-quantum/ml-kem.js';
|
8
|
+
import { ml_dsa44, ml_dsa65, ml_dsa87 } from '@noble/post-quantum/ml-dsa.js';
|
10
9
|
import {
|
11
10
|
slh_dsa_sha2_128f, slh_dsa_sha2_128s,
|
12
11
|
slh_dsa_sha2_192f, slh_dsa_sha2_192s,
|
@@ -14,8 +13,9 @@ import {
|
|
14
13
|
slh_dsa_shake_128f, slh_dsa_shake_128s,
|
15
14
|
slh_dsa_shake_192f, slh_dsa_shake_192s,
|
16
15
|
slh_dsa_shake_256f, slh_dsa_shake_256s,
|
17
|
-
} from '@noble/post-quantum/slh-dsa';
|
16
|
+
} from '@noble/post-quantum/slh-dsa.js';
|
18
17
|
```
|
19
18
|
*/
|
20
19
|
throw new Error('root module cannot be imported: import submodules instead. Check out README');
|
20
|
+
export {};
|
21
21
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC"}
|
package/ml-dsa.d.ts
CHANGED
@@ -1,4 +1,16 @@
|
|
1
|
-
import { type Signer } from './utils.ts';
|
1
|
+
import { type CryptoKeys, type Signer, type SigOpts, type VerOpts } from './utils.ts';
|
2
|
+
export type DSAInternalOpts = {
|
3
|
+
externalMu?: boolean;
|
4
|
+
};
|
5
|
+
/** Signer API, containing internal methods */
|
6
|
+
export type DSAInternal = CryptoKeys & {
|
7
|
+
lengths: Signer['lengths'];
|
8
|
+
sign: (msg: Uint8Array, secretKey: Uint8Array, opts?: SigOpts & DSAInternalOpts) => Uint8Array;
|
9
|
+
verify: (sig: Uint8Array, msg: Uint8Array, pubKey: Uint8Array, opts?: VerOpts & DSAInternalOpts) => boolean;
|
10
|
+
};
|
11
|
+
export type DSA = Signer & {
|
12
|
+
internal: DSAInternal;
|
13
|
+
};
|
2
14
|
/** Various lattice params. */
|
3
15
|
export type DSAParam = {
|
4
16
|
K: number;
|
@@ -12,14 +24,10 @@ export type DSAParam = {
|
|
12
24
|
};
|
13
25
|
/** Internal params for different versions of ML-DSA */
|
14
26
|
export declare const PARAMS: Record<string, DSAParam>;
|
15
|
-
/** Signer API, containing internal methods */
|
16
|
-
export type SignerWithInternal = Signer & {
|
17
|
-
internal: Signer;
|
18
|
-
};
|
19
27
|
/** ML-DSA-44 for 128-bit security level. Not recommended after 2030, as per ASD. */
|
20
|
-
export declare const ml_dsa44:
|
28
|
+
export declare const ml_dsa44: DSA;
|
21
29
|
/** ML-DSA-65 for 192-bit security level. Not recommended after 2030, as per ASD. */
|
22
|
-
export declare const ml_dsa65:
|
30
|
+
export declare const ml_dsa65: DSA;
|
23
31
|
/** ML-DSA-87 for 256-bit security level. OK after 2030, as per ASD. */
|
24
|
-
export declare const ml_dsa87:
|
32
|
+
export declare const ml_dsa87: DSA;
|
25
33
|
//# sourceMappingURL=ml-dsa.d.ts.map
|
package/ml-dsa.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ml-dsa.d.ts","sourceRoot":"","sources":["src/ml-dsa.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"ml-dsa.d.ts","sourceRoot":"","sources":["src/ml-dsa.ts"],"names":[],"mappings":"AAcA,OAAO,EAKL,KAAK,UAAU,EAKf,KAAK,MAAM,EACX,KAAK,OAAO,EAMZ,KAAK,OAAO,EACb,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,eAAe,GAAG;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAMvD,8CAA8C;AAC9C,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG;IACrC,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IAC3B,IAAI,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,eAAe,KAAK,UAAU,CAAC;IAC/F,MAAM,EAAE,CACN,GAAG,EAAE,UAAU,EACf,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,UAAU,EAClB,IAAI,CAAC,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