@noble/post-quantum 0.1.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/README.md +158 -180
  2. package/_crystals.d.ts +0 -1
  3. package/_crystals.d.ts.map +1 -1
  4. package/_crystals.js +1 -31
  5. package/_crystals.js.map +1 -1
  6. package/esm/_crystals.d.ts +33 -0
  7. package/esm/_crystals.d.ts.map +1 -0
  8. package/esm/_crystals.js +0 -30
  9. package/esm/_crystals.js.map +1 -1
  10. package/esm/index.d.ts +2 -0
  11. package/esm/index.d.ts.map +1 -0
  12. package/esm/ml-dsa.d.ts +44 -0
  13. package/esm/ml-dsa.d.ts.map +1 -0
  14. package/esm/ml-dsa.js +67 -88
  15. package/esm/ml-dsa.js.map +1 -1
  16. package/esm/ml-kem.d.ts +55 -0
  17. package/esm/ml-kem.d.ts.map +1 -0
  18. package/esm/ml-kem.js +26 -83
  19. package/esm/ml-kem.js.map +1 -1
  20. package/esm/slh-dsa.d.ts +46 -0
  21. package/esm/slh-dsa.d.ts.map +1 -0
  22. package/esm/slh-dsa.js +27 -111
  23. package/esm/slh-dsa.js.map +1 -1
  24. package/esm/utils.d.ts +38 -0
  25. package/esm/utils.d.ts.map +1 -0
  26. package/esm/utils.js +2 -1
  27. package/esm/utils.js.map +1 -1
  28. package/ml-dsa.d.ts +27 -20
  29. package/ml-dsa.d.ts.map +1 -1
  30. package/ml-dsa.js +66 -87
  31. package/ml-dsa.js.map +1 -1
  32. package/ml-kem.d.ts +1 -80
  33. package/ml-kem.d.ts.map +1 -1
  34. package/ml-kem.js +26 -83
  35. package/ml-kem.js.map +1 -1
  36. package/package.json +14 -22
  37. package/slh-dsa.d.ts +0 -24
  38. package/slh-dsa.d.ts.map +1 -1
  39. package/slh-dsa.js +27 -111
  40. package/slh-dsa.js.map +1 -1
  41. package/src/_crystals.ts +0 -33
  42. package/src/ml-dsa.ts +75 -92
  43. package/src/ml-kem.ts +28 -87
  44. package/src/slh-dsa.ts +27 -121
  45. package/src/utils.ts +2 -1
  46. package/utils.d.ts +2 -2
  47. package/utils.d.ts.map +1 -1
  48. package/utils.js +7 -6
  49. package/utils.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"slh-dsa.js","sourceRoot":"","sources":["../src/slh-dsa.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAEL,UAAU,EACV,WAAW,EACX,UAAU,EACV,OAAO,EACP,WAAW,EACX,UAAU,EACV,QAAQ,GACT,MAAM,YAAY,CAAC;AAuDpB,MAAM,CAAC,MAAM,MAAM,GAAgC;IACjD,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE;IACnD,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE;IACnD,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE;IACnD,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE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CAAC;AACF,MAAM,aAAa,GAAG;IACpB,YAAY,EAAE,IAAI;IAClB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF,8BAA8B;AAC9B,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC;AACpF,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC;AACpF,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC;AACpF,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC;AACpF,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC;AACpF,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC"}
package/esm/utils.d.ts ADDED
@@ -0,0 +1,38 @@
1
+ /*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */
2
+ import { bytes as abytes } from '@noble/hashes/_assert';
3
+ import { TypedArray, randomBytes as randb, concatBytes } from '@noble/hashes/utils';
4
+ export declare const ensureBytes: typeof abytes;
5
+ export declare const randomBytes: typeof randb;
6
+ export { concatBytes };
7
+ export declare function equalBytes(a: Uint8Array, b: Uint8Array): boolean;
8
+ export type Signer = {
9
+ signRandBytes: number;
10
+ keygen: (seed: Uint8Array) => {
11
+ secretKey: Uint8Array;
12
+ publicKey: Uint8Array;
13
+ };
14
+ sign: (secretKey: Uint8Array, msg: Uint8Array, random?: Uint8Array) => Uint8Array;
15
+ verify: (publicKey: Uint8Array, msg: Uint8Array, sig: Uint8Array) => boolean;
16
+ };
17
+ export interface Coder<F, T> {
18
+ encode(from: F): T;
19
+ decode(to: T): F;
20
+ }
21
+ export interface BytesCoder<T> extends Coder<T, Uint8Array> {
22
+ encode: (data: T) => Uint8Array;
23
+ decode: (bytes: Uint8Array) => T;
24
+ }
25
+ export type BytesCoderLen<T> = BytesCoder<T> & {
26
+ bytesLen: number;
27
+ };
28
+ type UnCoder<T> = T extends BytesCoder<infer U> ? U : never;
29
+ type SplitOut<T extends (number | BytesCoderLen<any>)[]> = {
30
+ [K in keyof T]: T[K] extends number ? Uint8Array : UnCoder<T[K]>;
31
+ };
32
+ export declare function splitCoder<T extends (number | BytesCoderLen<any>)[]>(...lengths: T): BytesCoder<SplitOut<T>> & {
33
+ bytesLen: number;
34
+ };
35
+ export declare function vecCoder<T>(c: BytesCoderLen<T>, vecLen: number): BytesCoderLen<T[]>;
36
+ export declare function cleanBytes(...list: (TypedArray | TypedArray[])[]): void;
37
+ export declare function getMask(bits: number): number;
38
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,WAAW,IAAI,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEpF,eAAO,MAAM,WAAW,eAAS,CAAC;AAClC,eAAO,MAAM,WAAW,cAAQ,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,CAAC;AAGvB,wBAAgB,UAAU,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,WAKtD;AAED,MAAM,MAAM,MAAM,GAAG;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,CAAC,IA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AAC,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,QAKhE;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,UAEnC"}
package/esm/utils.js CHANGED
@@ -1,8 +1,9 @@
1
1
  /*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */
2
2
  import { bytes as abytes } from '@noble/hashes/_assert';
3
- import { randomBytes as randb } from '@noble/hashes/utils';
3
+ import { randomBytes as randb, concatBytes } from '@noble/hashes/utils';
4
4
  export const ensureBytes = abytes;
5
5
  export const randomBytes = randb;
6
+ export { concatBytes };
6
7
  // Compares 2 u8a-s in kinda constant time
7
8
  export function equalBytes(a, b) {
8
9
  if (a.length !== b.length)
package/esm/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAc,WAAW,IAAI,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEvE,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC;AAClC,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC;AAEjC,0CAA0C;AAC1C,MAAM,UAAU,UAAU,CAAC,CAAa,EAAE,CAAa;IACrD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAA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C,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YAClD,OAAO,CAAC,CAAC;QACX,CAAC;KACF,CAAC;AACJ,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,UAAU,CAAC,GAAG,IAAmC;IAC/D,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YAAE,KAAK,MAAM,CAAC,IAAI,CAAC;gBAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;YAC9C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,cAAc;AACxC,CAAC"}
package/ml-dsa.d.ts CHANGED
@@ -10,28 +10,35 @@ type Param = {
10
10
  OMEGA: number;
11
11
  };
12
12
  export declare const PARAMS: Record<string, Param>;
13
- export declare const dilithium_v30: {
14
- dilithium2: Signer;
15
- dilithium3: Signer;
16
- dilithium5: Signer;
13
+ export declare const ml_dsa44: {
14
+ internal: Signer;
15
+ keygen: (seed: Uint8Array) => {
16
+ secretKey: Uint8Array;
17
+ publicKey: Uint8Array;
18
+ };
19
+ signRandBytes: number;
20
+ sign: (secretKey: Uint8Array, msg: Uint8Array, ctx?: Uint8Array, random?: Uint8Array) => Uint8Array;
21
+ verify: (publicKey: Uint8Array, msg: Uint8Array, sig: Uint8Array, ctx?: Uint8Array) => boolean;
17
22
  };
18
- export declare const dilithium_v31: {
19
- dilithium2: Signer;
20
- dilithium3: Signer;
21
- dilithium5: Signer;
23
+ export declare const ml_dsa65: {
24
+ internal: Signer;
25
+ keygen: (seed: Uint8Array) => {
26
+ secretKey: Uint8Array;
27
+ publicKey: Uint8Array;
28
+ };
29
+ signRandBytes: number;
30
+ sign: (secretKey: Uint8Array, msg: Uint8Array, ctx?: Uint8Array, random?: Uint8Array) => Uint8Array;
31
+ verify: (publicKey: Uint8Array, msg: Uint8Array, sig: Uint8Array, ctx?: Uint8Array) => boolean;
22
32
  };
23
- export declare const dilithium_v30_aes: {
24
- dilithium2: Signer;
25
- dilithium3: Signer;
26
- dilithium5: Signer;
33
+ export declare const ml_dsa87: {
34
+ internal: Signer;
35
+ keygen: (seed: Uint8Array) => {
36
+ secretKey: Uint8Array;
37
+ publicKey: Uint8Array;
38
+ };
39
+ signRandBytes: number;
40
+ sign: (secretKey: Uint8Array, msg: Uint8Array, ctx?: Uint8Array, random?: Uint8Array) => Uint8Array;
41
+ verify: (publicKey: Uint8Array, msg: Uint8Array, sig: Uint8Array, ctx?: Uint8Array) => boolean;
27
42
  };
28
- export declare const dilithium_v31_aes: {
29
- dilithium2: Signer;
30
- dilithium3: Signer;
31
- dilithium5: Signer;
32
- };
33
- export declare const ml_dsa44: Signer;
34
- export declare const ml_dsa65: Signer;
35
- export declare const ml_dsa87: Signer;
36
43
  export {};
37
44
  //# 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":"AAGA,OAAO,EAEL,MAAM,EAOP,MAAM,YAAY,CAAC;AA6BpB,KAAK,KAAK,GAAG;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAI/B,CAAC;AA8bX,eAAO,MAAM,aAAa;;;;CAMxB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;CAOxB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;CAM5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;CAO5B,CAAC;AAGH,eAAO,MAAM,QAAQ,QASnB,CAAC;AAEH,eAAO,MAAM,QAAQ,QASnB,CAAC;AAEH,eAAO,MAAM,QAAQ,QASnB,CAAC"}
1
+ {"version":3,"file":"ml-dsa.d.ts","sourceRoot":"","sources":["src/ml-dsa.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,MAAM,EAQP,MAAM,YAAY,CAAC;AAwBpB,KAAK,KAAK,GAAG;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAI/B,CAAC;AA0dX,eAAO,MAAM,QAAQ;;;;;;;sBAbC,UAAU,OAAO,UAAU,6BAAwB,UAAU;wBAM3D,UAAU,OAAO,UAAU,OAAO,UAAU;CAclE,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;sBAtBC,UAAU,OAAO,UAAU,6BAAwB,UAAU;wBAM3D,UAAU,OAAO,UAAU,OAAO,UAAU;CAuBlE,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;sBA/BC,UAAU,OAAO,UAAU,6BAAwB,UAAU;wBAM3D,UAAU,OAAO,UAAU,OAAO,UAAU;CAgClE,CAAC"}
package/ml-dsa.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ml_dsa87 = exports.ml_dsa65 = exports.ml_dsa44 = exports.dilithium_v31_aes = exports.dilithium_v30_aes = exports.dilithium_v31 = exports.dilithium_v30 = exports.PARAMS = void 0;
3
+ exports.ml_dsa87 = exports.ml_dsa65 = exports.ml_dsa44 = exports.PARAMS = void 0;
4
4
  /*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */
5
5
  const sha3_1 = require("@noble/hashes/sha3");
6
6
  const _crystals_js_1 = require("./_crystals.js");
@@ -11,11 +11,6 @@ Lattice-based digital signature algorithm. See
11
11
  [repo](https://github.com/pq-crystals/dilithium).
12
12
  Dilithium has similar internals to Kyber, but their keys and params are different.
13
13
 
14
- Three versions are provided:
15
-
16
- 1. Dilithium v3.0, v3.0 AES
17
- 2. Dilithium v3.1, v3.1 AES
18
- 3. ML-DSA aka [FIPS-204](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.204.ipd.pdf)
19
14
  */
20
15
  // Constants
21
16
  const N = 256;
@@ -44,9 +39,10 @@ const { mod, smod, NTT, bitsCoder } = (0, _crystals_js_1.genCrystals)({
44
39
  isKyber: false,
45
40
  brvBits: 8,
46
41
  });
47
- const polyCoder = (d, compress) => bitsCoder(d, {
48
- encode: (i) => (compress ? compress(i) : i),
49
- decode: (i) => (compress ? compress(i) : i),
42
+ const id = (n) => n;
43
+ const polyCoder = (d, compress = id, verify = id) => bitsCoder(d, {
44
+ encode: (i) => compress(verify(i)),
45
+ decode: (i) => verify(compress(i)),
50
46
  });
51
47
  const polyAdd = (a, b) => {
52
48
  for (let i = 0; i < a.length; i++)
@@ -97,9 +93,10 @@ function RejNTTPoly(xof) {
97
93
  }
98
94
  return r;
99
95
  }
96
+ const EMPTY = new Uint8Array(0);
100
97
  function getDilithium(opts) {
101
98
  const { K, L, GAMMA1, GAMMA2, TAU, ETA, OMEGA } = opts;
102
- const { FIPS204, V31, CRH_BYTES, TR_BYTES, C_TILDE_BYTES, XOF128, XOF256 } = opts;
99
+ const { CRH_BYTES, TR_BYTES, C_TILDE_BYTES, XOF128, XOF256 } = opts;
103
100
  if (![2, 4].includes(ETA))
104
101
  throw new Error('Wrong ETA');
105
102
  if (![1 << 17, 1 << 19].includes(GAMMA1))
@@ -129,6 +126,8 @@ function getDilithium(opts) {
129
126
  // But they return different results! However, decompose is same.
130
127
  // So, either there is a bug in Dilithium ref implementation or in FIPS204.
131
128
  // For now, lets use dilithium one, so test vectors can be passed.
129
+ // See
130
+ // https://github.com/GiacomoPope/dilithium-py?tab=readme-ov-file#optimising-decomposition-and-making-hints
132
131
  return res0;
133
132
  };
134
133
  const UseHint = (h, r) => {
@@ -182,7 +181,11 @@ function getDilithium(opts) {
182
181
  return h;
183
182
  },
184
183
  };
185
- const ETACoder = polyCoder(ETA === 2 ? 3 : 4, (i) => ETA - i);
184
+ const ETACoder = polyCoder(ETA === 2 ? 3 : 4, (i) => ETA - i, (i) => {
185
+ if (!(-ETA <= i && i <= ETA))
186
+ throw new Error(`malformed key s1/s3 ${i} outside of ETA range [${-ETA}, ${ETA}]`);
187
+ return i;
188
+ });
186
189
  const T0Coder = polyCoder(13, (i) => (1 << (D - 1)) - i);
187
190
  const T1Coder = polyCoder(10);
188
191
  // Requires smod. Need to fix!
@@ -217,7 +220,7 @@ function getDilithium(opts) {
217
220
  const SampleInBall = (seed) => {
218
221
  // Samples a polynomial c ∈ Rq with coeffcients from {−1, 0, 1} and Hamming weight τ
219
222
  const pre = newPoly(N);
220
- const s = sha3_1.shake256.create({}).update(seed.slice(0, 32));
223
+ const s = sha3_1.shake256.create({}).update(seed);
221
224
  const buf = new Uint8Array(sha3_1.shake256.blockLen);
222
225
  s.xofInto(buf);
223
226
  const masks = buf.slice(0, 8);
@@ -264,15 +267,19 @@ function getDilithium(opts) {
264
267
  }
265
268
  return { v, cnt };
266
269
  };
267
- const signRandBytes = FIPS204 ? 32 : CRH_BYTES;
268
- const seedCoder = (0, utils_js_1.splitCoder)(32, V31 ? 64 : 32, 32);
269
- const seedXOF = V31 ? XOF256 : XOF128;
270
+ const signRandBytes = 32;
271
+ const seedCoder = (0, utils_js_1.splitCoder)(32, 64, 32);
270
272
  // API & argument positions are exactly as in FIPS204.
271
- return {
273
+ const internal = {
272
274
  signRandBytes,
273
275
  keygen: (seed = (0, utils_js_1.randomBytes)(32)) => {
274
- const [rho, rhoPrime, K_] = seedCoder.decode((0, sha3_1.shake256)(seed, { dkLen: seedCoder.bytesLen }));
275
- const xofPrime = seedXOF(rhoPrime);
276
+ // H(𝜉||IntegerToBytes(𝑘, 1)||IntegerToBytes(ℓ, 1), 128) 2: expand seed
277
+ const seedDst = new Uint8Array(32 + 2);
278
+ seedDst.set(seed);
279
+ seedDst[32] = K;
280
+ seedDst[33] = L;
281
+ const [rho, rhoPrime, K_] = seedCoder.decode((0, sha3_1.shake256)(seedDst, { dkLen: seedCoder.bytesLen }));
282
+ const xofPrime = XOF256(rhoPrime);
276
283
  const s1 = [];
277
284
  for (let i = 0; i < L; i++)
278
285
  s1.push(RejBoundedPoly(xofPrime.get(i & 0xff, (i >> 8) & 0xff)));
@@ -304,7 +311,7 @@ function getDilithium(opts) {
304
311
  // STATS
305
312
  // Kyber512: { calls: 4, xofs: 12 }, Kyber768: { calls: 9, xofs: 27 }, Kyber1024: { calls: 16, xofs: 48 }
306
313
  // DSA44: { calls: 24, xofs: 24 }, DSA65: { calls: 41, xofs: 41 }, DSA87: { calls: 71, xofs: 71 }
307
- (0, utils_js_1.cleanBytes)(rho, rhoPrime, K_, s1, s2, s1Hat, t, t0, t1, tr);
314
+ (0, utils_js_1.cleanBytes)(rho, rhoPrime, K_, s1, s2, s1Hat, t, t0, t1, tr, seedDst);
308
315
  return { publicKey, secretKey };
309
316
  },
310
317
  // NOTE: random is optional.
@@ -330,17 +337,15 @@ function getDilithium(opts) {
330
337
  }
331
338
  // This part is per msg
332
339
  const mu = sha3_1.shake256.create({ dkLen: CRH_BYTES }).update(tr).update(msg).digest(); // 6: µ ← H(tr||M, 512) ▷ Compute message representative µ
333
- let rhoprime; // Compute private random seed
334
- if (FIPS204) {
335
- const rnd = random ? random : new Uint8Array(32);
336
- (0, utils_js_1.ensureBytes)(rnd);
337
- rhoprime = sha3_1.shake256.create({ dkLen: CRH_BYTES }).update(_K).update(rnd).update(mu).digest(); // ρ′← H(K||rnd||µ, 512)
338
- }
339
- else {
340
- rhoprime = random
341
- ? random
342
- : sha3_1.shake256.create({ dkLen: CRH_BYTES }).update(_K).update(mu).digest();
343
- }
340
+ // Compute private random seed
341
+ const rnd = random ? random : new Uint8Array(32);
342
+ (0, utils_js_1.ensureBytes)(rnd);
343
+ const rhoprime = sha3_1.shake256
344
+ .create({ dkLen: CRH_BYTES })
345
+ .update(_K)
346
+ .update(rnd)
347
+ .update(mu)
348
+ .digest(); // ρ′← H(K||rnd||µ, 512)
344
349
  (0, utils_js_1.ensureBytes)(rhoprime, CRH_BYTES);
345
350
  const x256 = XOF256(rhoprime, ZCoder.bytesLen);
346
351
  // Rejection sampling loop
@@ -367,7 +372,7 @@ function getDilithium(opts) {
367
372
  .update(W1Vec.encode(w1))
368
373
  .digest();
369
374
  // Verifer’s challenge
370
- const cHat = NTT.encode(SampleInBall(cTilde.subarray(0, 32))); // c ← SampleInBall(c˜1); cˆ ← NTT(c)
375
+ const cHat = NTT.encode(SampleInBall(cTilde)); // c ← SampleInBall(c˜1); cˆ ← NTT(c)
371
376
  // ⟨⟨cs1⟩⟩ ← NTT−1(cˆ◦ sˆ1)
372
377
  const cs1 = s1.map((i) => MultiplyNTTs(i, cHat));
373
378
  for (let i = 0; i < L; i++) {
@@ -417,7 +422,7 @@ function getDilithium(opts) {
417
422
  return false;
418
423
  const mu = sha3_1.shake256.create({ dkLen: CRH_BYTES }).update(tr).update(msg).digest(); // 7: µ ← H(tr||M, 512)
419
424
  // Compute verifer’s challenge from c˜
420
- const c = NTT.encode(SampleInBall(cTilde.subarray(0, 32))); // c ← SampleInBall(c˜1)
425
+ const c = NTT.encode(SampleInBall(cTilde)); // c ← SampleInBall(c˜1)
421
426
  const zNtt = z.map((i) => i.slice()); // zNtt = NTT(z)
422
427
  for (let i = 0; i < L; i++)
423
428
  NTT.encode(zNtt[i]);
@@ -442,62 +447,42 @@ function getDilithium(opts) {
442
447
  .update(mu)
443
448
  .update(W1Vec.encode(wTick1))
444
449
  .digest();
445
- if (FIPS204) {
446
- // Additional checks in FIPS-204:
447
- // [[ ||z||∞ < γ1 − β ]] and [[c ˜ = c˜′]] and [[number of 1’s in h is ≤ ω]]
448
- for (const t of h) {
449
- const sum = t.reduce((acc, i) => acc + i, 0);
450
- if (!(sum <= OMEGA))
451
- return false;
452
- }
453
- for (const t of z)
454
- if (polyChknorm(t, GAMMA1 - BETA))
455
- return false;
450
+ // Additional checks in FIPS-204:
451
+ // [[ ||z||∞ < γ1 − β ]] and [[c ˜ = c˜′]] and [[number of 1’s in h is ≤ ω]]
452
+ for (const t of h) {
453
+ const sum = t.reduce((acc, i) => acc + i, 0);
454
+ if (!(sum <= OMEGA))
455
+ return false;
456
456
  }
457
+ for (const t of z)
458
+ if (polyChknorm(t, GAMMA1 - BETA))
459
+ return false;
457
460
  return (0, utils_js_1.equalBytes)(cTilde, c2);
458
461
  },
459
462
  };
460
- }
461
- function getDilithiumVersions(cfg) {
463
+ const getMessage = (msg, ctx = EMPTY) => {
464
+ (0, utils_js_1.ensureBytes)(msg);
465
+ (0, utils_js_1.ensureBytes)(ctx);
466
+ if (ctx.length > 255)
467
+ throw new Error('context should be less than 255 bytes');
468
+ return (0, utils_js_1.concatBytes)(new Uint8Array([0, ctx.length]), ctx, msg);
469
+ };
470
+ // TODO: no hash-dsa vectors for now, so we don't implement it yet
462
471
  return {
463
- dilithium2: getDilithium({ ...exports.PARAMS[2], ...cfg }),
464
- dilithium3: getDilithium({ ...exports.PARAMS[3], ...cfg }),
465
- dilithium5: getDilithium({ ...exports.PARAMS[5], ...cfg }),
472
+ internal,
473
+ keygen: internal.keygen,
474
+ signRandBytes: internal.signRandBytes,
475
+ sign: (secretKey, msg, ctx = EMPTY, random) => {
476
+ const M = getMessage(msg, ctx);
477
+ const res = internal.sign(secretKey, M, random);
478
+ M.fill(0);
479
+ return res;
480
+ },
481
+ verify: (publicKey, msg, sig, ctx = EMPTY) => {
482
+ return internal.verify(publicKey, getMessage(msg, ctx), sig);
483
+ },
466
484
  };
467
485
  }
468
- // v30 is NIST round 3 submission, for original vectors and benchmarking.
469
- // v31 is kyber: more secure than v30.
470
- // ml-dsa is NIST FIPS 204, but it is still a draft and may change.
471
- exports.dilithium_v30 = getDilithiumVersions({
472
- CRH_BYTES: 48,
473
- TR_BYTES: 48,
474
- C_TILDE_BYTES: 32,
475
- XOF128: _crystals_js_1.XOF128,
476
- XOF256: _crystals_js_1.XOF256,
477
- });
478
- exports.dilithium_v31 = getDilithiumVersions({
479
- CRH_BYTES: 64,
480
- TR_BYTES: 32,
481
- C_TILDE_BYTES: 32,
482
- XOF128: _crystals_js_1.XOF128,
483
- XOF256: _crystals_js_1.XOF256,
484
- V31: true,
485
- });
486
- exports.dilithium_v30_aes = getDilithiumVersions({
487
- CRH_BYTES: 48,
488
- TR_BYTES: 48,
489
- C_TILDE_BYTES: 32,
490
- XOF128: _crystals_js_1.XOF_AES,
491
- XOF256: _crystals_js_1.XOF_AES,
492
- });
493
- exports.dilithium_v31_aes = getDilithiumVersions({
494
- CRH_BYTES: 64,
495
- TR_BYTES: 32,
496
- C_TILDE_BYTES: 32,
497
- XOF128: _crystals_js_1.XOF_AES,
498
- XOF256: _crystals_js_1.XOF_AES,
499
- V31: true,
500
- });
501
486
  // ML-DSA
502
487
  exports.ml_dsa44 = getDilithium({
503
488
  ...exports.PARAMS[2],
@@ -506,8 +491,6 @@ exports.ml_dsa44 = getDilithium({
506
491
  C_TILDE_BYTES: 32,
507
492
  XOF128: _crystals_js_1.XOF128,
508
493
  XOF256: _crystals_js_1.XOF256,
509
- V31: true,
510
- FIPS204: true,
511
494
  });
512
495
  exports.ml_dsa65 = getDilithium({
513
496
  ...exports.PARAMS[3],
@@ -516,8 +499,6 @@ exports.ml_dsa65 = getDilithium({
516
499
  C_TILDE_BYTES: 48,
517
500
  XOF128: _crystals_js_1.XOF128,
518
501
  XOF256: _crystals_js_1.XOF256,
519
- V31: true,
520
- FIPS204: true,
521
502
  });
522
503
  exports.ml_dsa87 = getDilithium({
523
504
  ...exports.PARAMS[5],
@@ -526,7 +507,5 @@ exports.ml_dsa87 = getDilithium({
526
507
  C_TILDE_BYTES: 64,
527
508
  XOF128: _crystals_js_1.XOF128,
528
509
  XOF256: _crystals_js_1.XOF256,
529
- V31: true,
530
- FIPS204: true,
531
510
  });
532
511
  //# sourceMappingURL=ml-dsa.js.map