NIST FIPS 204 Ipd
NIST FIPS 204 Ipd
4 Module-Lattice-Based Digital
5 Signature Standard
6 Category: Computer Security Subcategory: Cryptography
13
26 Abstract
27 Digital signatures are used to detect unauthorized modifcations to data and to authenticate the identity
28 of the signatory. In addition, the recipient of signed data can use a digital signature as evidence in
29 demonstrating to a third party that the signature was, in fact, generated by the claimed signatory. This is
30 known as non-repudiation since the signatory cannot easily repudiate the signature at a later time.
31 This standard specifes ML-DSA, a set of algorithms that can be used to generate and verify digital
32 signatures. ML-DSA is believed to be secure even against adversaries in possession of a large-scale
33 quantum computer.
34 Keywords: cryptography; digital signatures; Federal Information Processing Standards; lattice; post-
35 quantum; public-key cryptography
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
38 Announcing the
39 Module-Lattice-Based Digital Signature Standard
40 Federal Information Processing Standards Publications (FIPS PUBS) are developed by the National
41 Institute of Standards and Technology (NIST) under 15 U.S.C. 278g-3, and issued by the Secretary of
42 Commerce under 40 U.S.C. 11331.
45 3. Explanation. This standard specifes a lattice-based digital signature algorithm, ML-DSA, for appli-
46 cations that require a digital signature rather than a written signature. (Additional digital signature
47 schemes are specifed and approved in other NIST Special Publications and FIPS publications, e.g.,
48 FIPS 186-5 [1].) A digital signature is represented in a computer as a string of bits and computed using
49 a set of rules and parameters that allow the identity of the signatory and the integrity of the data to be
50 verifed. Digital signatures may be generated on both stored and transmitted data.
51 Signature generation uses a private key to generate a digital signature. Signature verifcation uses
52 a public key that corresponds to but is not the same as the private key. Each signatory possesses a
53 key-pair composed of a private key and a corresponding public key. Public keys may be known by
54 the public, but private keys must be kept secret. Anyone can verify the signature by employing the
55 signatory’s public key. Only the user who possesses the private key can perform the generation of a
56 signature that can be verifed by the corresponding public key.
57 The digital signature is provided to the intended verifer along with the signed data. The verifying
58 entity verifes the signature by using the claimed signatory’s public key. Similar procedures may be
59 used to generate and verify signatures for both stored and transmitted data.
60 This standard specifes several parameter sets for ML-DSA that are approved for use. Additional
61 parameter sets may be specifed and approved in future NIST Special Publications.
65 6. Applicability. This standard is applicable to all federal departments and agencies for the protection
66 of sensitive unclassifed information that is not subject to section 2315 of Title 10, United States
67 Code, or section 3502 (2) of Title 44, United States Code. Either this standard or Federal Information
68 Processing Standard (FIPS) 205 or NIST Special Publication 800-208 shall be used in designing and
69 implementing public-key-based signature systems that federal departments and agencies operate or
70 that are operated for them under contract. In the future, additional digital signature schemes may be
71 specifed and approved in FIPS publications or in NIST Special Publications.
72 The adoption and use of this standard are available to private and commercial organizations.
i
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
73 7. Applications. A digital signature algorithm allows an entity to authenticate the integrity of signed
74 data and the identity of the signatory. The recipient of a signed message can use a digital signature
75 as evidence in demonstrating to a third party that the signature was, in fact, generated by the claimed
76 signatory. This is known as non-repudiation since the signatory cannot easily repudiate the signature
77 at a later time. A digital signature algorithm is intended for use in electronic mail, electronic funds
78 transfer, electronic data interchange, software distribution, data storage, and other applications that
79 require data integrity assurance and data origin authentication.
89 9. Other Approved Security Functions. Digital signature implementations that comply with this
90 standard shall employ cryptographic algorithms that have been approved for protecting Federal
91 Government-sensitive information. Approved cryptographic algorithms and techniques include those
92 that are either:
93 a. Specifed in a Federal Information Processing Standards (FIPS) publication,
94 b. Adopted in a FIPS or NIST recommendation, or
95 c. Specifed in the list of approved security functions for FIPS 140-3.
96 10. Export Control. Certain cryptographic devices and technical data regarding them are subject to federal
97 export controls. Exports of cryptographic modules that implement this standard and technical data
98 regarding them must comply with these federal regulations and be licensed by the Bureau of Industry
99 and Security of the U.S. Department of Commerce. Information about export regulations is available at
100 https://www.bis.doc.gov.
101 11. Patents. The algorithm in this standard may be covered by U.S. or foreign patents.
102 12. Implementation Schedule. This standard becomes effective immediately upon fnal publication.
103 13. Specifcations. Federal Information Processing Standards (FIPS) 204, Module-Lattice-Based Digital
104 Signature Standard (affxed).
105 14. Qualifcations. The security of a digital signature system is dependent on maintaining the secrecy of
106 the signatory’s private keys. Signatories shall, therefore, guard against the disclosure of their private
107 keys. While it is the intent of this standard to specify general security requirements for generating
108 digital signatures, conformance to this standard does not ensure that a particular implementation is
109 secure. It is the responsibility of an implementer to ensure that any module that implements a digital
110 signature capability is designed and built in a secure manner.
111 Similarly, the use of a product containing an implementation that conforms to this standard does not
112 guarantee the security of the overall system in which the product is used. The responsible authority in
113 each agency or department shall ensure that an overall implementation provides an acceptable level of
114 security.
ii
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
115 Since a standard of this nature must be fexible enough to adapt to advancements and innovations in
116 science and technology, this standard will be reviewed every fve years in order to assess its adequacy.
117 15. Waiver Procedure. The Federal Information Security Management Act (FISMA) does not allow for
118 waivers to Federal Information Processing Standards (FIPS) that are made mandatory by the Secretary
119 of Commerce.
120 16. Where to Obtain Copies of the Standard. This publication is available by accessing https://csrc.nist.
121 gov/publications. Other computer security publications are available at the same website.
122 17. How to Cite this Publication. NIST has assigned NIST FIPS 204 ipd as the publication identifer for
123 this FIPS, per the NIST Technical Series Publication Identifer Syntax. NIST recommends that it be
124 cited as follows:
125 National Institute of Standards and Technology (2023) Module-Lattice-Based Digital
126 Signature Standard. (Department of Commerce, Washington, D.C.), Federal Information
127 Processing Standards Publication (FIPS) NIST FIPS 204 ipd. https://doi.org/10.6028/NIST
128 .FIPS.204.ipd
129 18. Inquiries and Comments. Inquiries and comments about this FIPS may be submitted to fps-204-
130 [email protected].
iii
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
140 a) assurance in the form of a general disclaimer to the effect that such party does not hold and does not
141 currently intend holding any essential patent claim(s); or
142 b) assurance that a license to such essential patent claim(s) will be made available to applicants desiring
143 to utilize the license for the purpose of complying with the guidance or requirements in this ITL
144 draft publication either:
145 (i) under reasonable terms and conditions that are demonstrably free of any unfair discrimination;
146 or
147 (ii) without compensation and under reasonable terms and conditions that are demonstrably free
148 of any unfair discrimination.
149 Such assurance shall indicate that the patent holder (or third party authorized to make assurances on its
150 behalf) will include in any documents transferring ownership of patents subject to the assurance, provisions
151 suffcient to ensure that the commitments in the assurance are binding on the transferee, and that the
152 transferee will similarly include appropriate provisions in the event of future transfers with the goal of
153 binding each successor-in-interest.
154 The assurance shall also indicate that it is intended to be binding on successors-in-interest regardless of
155 whether such provisions are included in the relevant transfer documents.
156 Such statements should be addressed to: [email protected]
iv
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
186 6 Signing 15
187 7 Verifcation 18
v
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
195 References 38
vi
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
vii
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
viii
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
242 1. Introduction
243 1.1 Purpose and Scope
244 This standard defnes a digital signature scheme, which includes a method for digital signature generation
245 that can be used for the protection of binary data (commonly called a message), and a method for the
246 verifcation and validation of those digital signatures. (NIST SP 800-175B [2], Guideline for Using
247 Cryptographic Standards in the Federal Government: Cryptographic Mechanisms, includes a general
248 discussion of digital signatures.)
249 This standard specifes the mathematical steps that need to be performed for key generation, signature
250 generation, and signature verifcation. In order for digital signatures to be valid, additional assurances are
251 required, such as assurance of identity and of private key possession. NIST SP 800-89, Recommendation
252 for Obtaining Assurances for Digital Signature Applications [3], specifes the required assurances and
253 methods for obtaining these assurances.
254 The digital signature scheme approved in this standard is ML-DSA (Module Lattice Digital Signature
255 Algorithm). It is based on the Module Learning With Errors problem. ML-DSA is believed to be secure
256 even against adversaries in possession of a large-scale quantum computer. In particular, ML-DSA is
257 believed to be strongly-unforgeable, which implies that the scheme can be used to detect unauthorized
258 modifcations to data, and to authenticate the identity of the signatory (one bound to the possession of the
259 private-key). In addition, a signature generated by this scheme can be used as evidence in demonstrating
260 to a third party that the signature was, in fact, generated by the claimed signatory. The latter property is
261 known as non-repudiation, since the signatory cannot easily repudiate the signature at a later time.
262 This standard gives algorithms for ML-DSA key generation (Section 5), signature (Section 6), and
263 verifcation, (Section 7) and for supporting algorithms used by them (Section 8). ML-DSA is standardized
264 with three possible parameter sets, each corresponding to a different security strength. Section 4 describes
265 the global parameters used by these algorithms and enumerates the parameter sets for ML-DSA that are
266 approved by this standard. ML-DSA can be used in place of other digital signature schemes specifed in
267 NIST FIPS and Special Publications (e.g., FIPS 186-5 Digital Signature Standard (DSS) [1]).
1
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
287 1.3.1 Differences Between Version 3.1 and the Round 3 Version of CRYSTALS-
288 D ILITHIUM
289 The lengths of the variables ρ ′ (private random seed) and µ (message representative) in the signing
290 algorithm were increased from 384 to 512 bits. The increase in the length of µ corrects a security faw that
291 appeared in the third-round submission, where a collision attack against SHAKE256 with a 384-bit output
292 would make it so that parameters targeting NIST security strength category 5 could only meet category 4.
293 Additionally, the length of the variable tr (the hash of the public key) was reduced from 384 to 256 bits. In
294 key generation, the variable ς was relabeled as ρ ′ and increased in size from 256 bits to 512 bits.
295 1.3.2 Differences Between the ML-DSA Standard and Version 3.1 of CRYSTALS-
296 D ILITHIUM
297 In order to ensure the properties noted in [6], ML-DSA increases the length of tr to 512 bits, and increases
298 the length of c̃ to 384 and 512 bits, respectively, for the parameter sets ML-DSA-65 and ML-DSA-87.
299 In Version 3.1 of the CRYSTALS-D ILITHIUM submission, the default version of the signing algorithm
300 is deterministic with ρ ′ being generated pseudorandomly from the signer’s private key and the message,
301 and an optional version of the signing algorithm has ρ ′ sampled instead as a 512-bit random string. In
302 ML-DSA, ρ ′ is generated by a “hedged” procedure, where ρ ′ is pseudorandomly derived from the signer’s
303 private key, the message, and a 256-bit string, rnd, which by default should be generated by an Approved
304 RBG. The ML-DSAstandard also allows for an optional deterministic version, where rnd is instead a
305 256-bit constant string.
2
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
312 assurance of Confdence that an entity possesses a private key and any associated keying
313 possession material.
317 certifcate A set of data that uniquely identifes a public key (which has a corresponding
318 private key) and an owner that is authorized to use the key pair. The certifcate
319 contains the owner’s public key and possibly other information and is digitally
320 signed by a Certifcation Authority (i.e., a trusted party), thereby binding the
321 public key to the owner.
322 certifcation authority The entity in a public key infrastructure (PKI) that is responsible for issuing
323 (CA) certifcates and exacting compliance with a PKI policy.
324 claimed signatory From the verifer’s perspective, the claimed signatory is the entity that purport-
325 edly generated a digital signature.
326 destroy An action applied to a key or a piece of secret data. After a key or a piece of
327 secret data is destroyed, no information about its value can be recovered.
328 digital signature The result of a cryptographic transformation of data that, when properly im-
329 plemented, provides a mechanism for verifying origin authenticity and data
330 integrity, and enforcing signatory non-repudiation.
333 extendable-output A function on bit strings in which the output can be extended to any desired
334 function (XOF) length. Approved XOFs (such as those specifed in FIPS 202 [7]) are designed
335 to satisfy the following properties as long as the specifed output length is
336 suffciently long to prevent trivial attacks:
337 1. (One-way) It is computationally infeasible to fnd any input that maps to
338 any new pre-specifed output.
339 2. (Collision-resistant) It is computationally infeasible to fnd any two
340 distinct inputs that map to the same output.
341 hash function A function on bit strings in which the length of the output is fxed. Approved
342 hash functions (such as those specifed in FIPS 180 [8] and FIPS 202 [7]) are
343 designed to satisfy the following properties:
3
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
384 security strength A number associated with the amount of work (i.e., the number of operations)
385 that is required to break a cryptographic algorithm or system.
386 seed A bit string used as input to a pseudorandom process.
387 shall Used to indicate a requirement of this standard.
388 should Used to indicate a strong recommendation but not a requirement of this stan-
389 dard. Ignoring the recommendation could lead to undesirable results.
390 signatory The entity that generates a digital signature on data, using a private key.
391 signature generation The process of using a digital signature algorithm and a private key to generate
392 a digital signature on data.
393 signature validation The (mathematical) verifcation of the digital signature along with obtaining
394 the appropriate assurances (e.g., public-key validity, private-key possession,
395 etc.).
396 signature verifcation The process of using a digital signature algorithm and a public key to verify a
397 digital signature on data.
398 signed data The data or message upon which a digital signature has been computed. Also
399 see “message.”
400 trusted third party An entity (other than the key pair owner and the verifer) that is trusted by the
401 (TTP) owner, the verifer, or both. Sometimes shortened to “trusted party.”
402 verifer The entity that verifes the authenticity of a digital signature, using the public
403 key of the signatory.
423 [a, b] For two integers a ≤ b, [a, b] denotes the set of integers {a, a + 1, . . . , b}.
425 R The ring of single-variable polynomials over Z modulo X 256 + 1, also denoted by
426 Z[X ]/(X 256 + 1).
427 Rm The ring of single-variable polynomials over Zm modulo X 256 + 1, also denoted by
428 Zm [X ]/(X 256 + 1).
433 Π Used to denote a direct product of two or more rings, where addition and multiplica-
434 tion are performed componentwise.
438 bitlen a For a positive integer a, the minimum number of binary digits required to represent
439 a. For example, bitlen 32 = 6 and bitlen 31 = 5.
440 ⌊x⌋ The largest integer less than or equal to the real number x, called the foor of x.
441 ⌈x⌉ The least integer greater than or equal to the real number x, called the ceiling of x.
442 mod If α is a positive integer and m ∈ Z or m ∈ Zα , then m mod α denotes the unique
443 element m′ ∈ Z in the range 0 ≤ m′ < α such that m and m′ are congruent modulo α.
444 mod± If α is a positive integer and m ∈ Z or m ∈ Zα , then m mod± α denotes the unique
445 element m′ ∈ Z in the range −α/2 < m′ ≤ α/2 such that m and m′ are congruent
446 modulo α.
449 brv(r) Bit reversal. If r = r0 + 2r1 + 4r2 + . . . + 128r7 is a byte, with ri ∈ {0, 1}, then
450 brv(r) = r7 + 2r6 + 4r5 + . . . + 128r0 .
6
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
456 x∈S←y Type casting. An element x in a set S is constructed from an element y of a different
457 set T . The set T , and the mapping from T to S, are not explicitly specifed, but they
458 should be obvious from the context in which this statement appears.
459 wJiK For a bit string w, wJiK denotes the ith byte of w,
460 where w[ j] is the jth bit of w. That is, when encoding a byte into a bit string,
461 “little-endian” order is used.
462 ∥·∥∞ The infnity norm. For an element w ∈ Z, ∥w∥∞ = |w|, the absolute value of w.
463 For an element w ∈ Zq ,∥w∥∞ = w mod± q . For an element w of R or Rq , ∥w∥∞ =
464 max0≤i<256 ∥wi ∥∞ . For a length-m vector w with entries from R or Rq , ∥w∥∞ =
465 max0≤i<m ∥w[i]∥∞ .
466 [[a < b]] A Boolean predicate. A comparison operator inside double square brackets [[a < b]]
467 denotes that the expression should be evaluated as a Boolean. Booleans can also be
468 interpreted as elements of Z2 with 1 denoting true and 0 denoting false.
469 ⟨⟨ f (x)⟩⟩ A temporary variable that stores the output of a computation f (x), so that this output
470 can be used many times, without needing to recompute it. This is equivalent to
471 defning a temporary variable y ← f (x). Naming the variable ⟨⟨ f (x)⟩⟩ makes the
472 pseudocode less cluttered.
477 a/b Division of integers. When this notation is used, a and b are always integers. If b
478 cannot be assumed to divide a, then either ⌊a/b⌋ or ⌈a/b⌉ is used.
480 ⊥ Blank symbol. (This symbol indicates failure or lack of an output from an algorithm.)
7
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
487 When a product a · b or a sum a + b is written and either a or b is a congruence class modulo m (i.e., if
488 either is an element of Zm or Rm ), then the product is also understood to be a congruence class modulo m.
489 Likewise when an element of R or Z may be used as the input of a function specifed to act on an element
490 of Rm or Zm , respectively. In both cases, the element itself or its coeffcients are mapped from Z to Zm by
491 taking the unique congruence class containing the integer.
492 The coeffcients of an element w of R or Rm are denoted by wi so that w = w0 + w1 X + . . . + w255 X 255 .
493 If w is in R (respectively, Rm ) and t is in Z (respectively, Zd ), then w(t) denotes the polynomial w =
494 w0 + w1 X + . . . + w255 X 255 evaluated at X = t.
495 Vectors with elements in R or Rm are denoted by bold lowercase letters, such as, v. Matrices with elements
496 in R or Rm are denoted by bold uppercase letters, such as, A.
497 If S is a ring and v is a length-L vector over S, then the entries in the vector v are expressed as
498 The entries of a K × L matrix A over S are denoted as A[i, j], where 0 ≤ i < K and 0 ≤ j < L. The set of
499 all length-L vectors over S is denoted by SL . The set of all K × L matrices over S is denoted by SK×L . A
500 length-L vector can also be treated as an L × 1 matrix.
504 where ζi = ζ brv(128+i) . See section 8.5 for a discussion of the implementation of NTT and NTT−1 .
505 The motivation for using NTT is that multiplication is considerably faster in the ring Tq . Since NTT is an
506 isomorphism, for any a, b ∈ Rq ,
NTT(ab) = NTT(a) ◦ NTT(b). (2.2)
507 If A is a matrix with entries from Rq , then NTT(A) denotes the matrix computed via the entry-wise
508 application of NTT to A. The symbol ◦ is also used to denote matrix multiplication of matrices with entries
509 in Tq . Thus, NTT(AB) = NTT(A) ◦ NTT(B).
8
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
538 1. Commitment: The prover generates a random positive integer r less than the order of g and commits
539 to its value by sending gr to the verifer
540 2. Challenge: The verifer sends a random positive integer c less than the order of g to the prover.
541 3. Response: The prover returns s = r − cx, and the verifer checks whether gs · yc = gr .
542 This protocol is made noninteractive and turned into a signature scheme by replacing the verifer’s random
543 choice of c in step 2 with a deterministic process that pseudorandomly derives c from a hash of the
544 commitment, gr , concatenated with the message to be signed. For this signature scheme, y is the public
545 key and x is the private key.
9
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
546 The basic idea of ML-DSA and similar lattice signature schemes is to build a signature scheme from an
analogous interactive protocol, where a prover who knows matrices A ∈ ZK×L , S1 ∈ ZL×n K ×n
547 q q , and S2 ∈ Zq
548 with short coeffcients, demonstrates knowledge of these matrices to a verifer who knows A and T ∈
549 ZK×n
q = AS1 + S2 . Such an interactive protocol would proceed as follows:
550 1. Commitment: The prover generates y ∈ ZLq with short coeffcients and commits to its value by
551 sending Ay to the verifer.
552 2. Challenge: The verifer sends a vector c ∈ Znq with short coeffcients to the prover.
553 3. Response: The prover returns z = y + S1 c, and the verifer checks that z has small coeffcients and
554 that Az − Tc ≈ Ay.
555 As written the above protocol has a security faw: The response z will be biased in a direction related to
556 the private value S1 . However, this faw can be corrected when converting the interactive protocol into
557 a signature scheme: As with Schnorr signatures, the signer derives the challenge by a pseudorandom
558 process from a hash of the commitment concatenated with the message. However, to correct the bias, the
559 signer applies rejection sampling to z: if coeffcients of z fall outside a specifed range, the signing process
560 is aborted, and the signer starts over from a new value of y. In the resulting “Fiat-Shamir with Aborts”
561 signature, the public key is (A, T) and the private key is (S1 , S2 )
562 In the ML-DSA standard, a number of tweaks and modifcations are added to this basic framework for
563 security or effciency reasons:
564 • To reduce key and signature size and to use fast NTT-based polynomial multiplication, ML-DSA
565 uses module-structured matrices. That is to say, relative to the basic scheme described above, it
566 replaces dimension-n × n blocks of matrices and dimension-n blocks of vectors with polynomials in
567 the ring Rq . Thus, instead of A ∈ ZK×L
q , T ∈ ZqK×n , S1 ∈ ZqL×n , S2 ∈ ZqK×n , y ∈ ZLq , c ∈ Zqn , ML-DSA
has A ∈ Rk×ℓ k ℓ k ℓ
568 q , t ∈ Rq , s1 ∈ Rq , s2 ∈ Rq , y ∈ Rq , c ∈ Rq .
569 • To further reduce the size of the public key, the matrix A is pseudorandomly derived from a 256-bit
570 public seed, ρ which is included in the ML-DSA public key in place of A.
571 • For a still further reduction in public key size, the ML-DSA public key substitutes for t a compressed
572 value t0 , which drops the d low order bits of each coeffcient.
573 • To obtain beyond unforgeability (BUFF) properties noted in [6], ML-DSA does not sign the message
574 M directly, but rather signs a message representative µ obtained by hashing the concatenation of a
575 hash tr of the public key and M.
576 • To reduce signature size, rather than including the commitment w = Ay in the signature, the ML-
577 DSA signature uses a rounded version w1 as a commitment, and includes only the hash, c̃, of w1
578 concatenated with µ.
579 To ensure that w1 can be reconstructed by the verifer from z and the compressed value t0 , the
580 signature must also include a hint h ∈ Rk2 computed by the signer using the signer’s private key.
581 In this document, we use the abbreviations ML-DSA-44, ML-DSA-65, and ML-DSA-87 to refer to
582 ML-DSA with the parameter choices given in Table 1. (In these abbreviations, the numerical suffx refers
583 to the dimension of the matrix A. For example, in ML-DSA-65, the matrix A is a 6 × 5 matrix over Rq .)
10
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
1 In
addition, when signing is deterministic, there is leakage through timing side-channels of information about the
message (but not the private key). In cases where the signer does not want to reveal the message being signed,
hedged signatures should be used; see section 3.2 in [5].
11
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
620 secrets) or the verifcation of signatures on plaintext messages that are intended to be confdential, data
621 used internally by verifcation algorithms is similarly sensitive. (Intermediate values of the verifcation
622 algorithm may reveal information about its inputs, i.e., the message, signature, and public key, and in some
623 applications security or privacy requires one or more of these inputs to be confdential.) Implementations
624 of ML-DSA shall, therefore, ensure that any potentially sensitive intermediate data is destroyed as soon as
625 it is no longer needed.
626 In certain situations, such as deterministic signing (described above), and the verifcation of confdential
627 messages and signatures (described above), additional care must be taken to protect implementations
628 against side-channel attacks or fault attacks. A cryptographic device may leak critical information through
629 side-channels that allows internal data or keying material to be extracted without breaking the cryptographic
630 primitives.
12
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
632 Three ML-DSA parameter sets are included in Table 1. Each parameter set assigns values for all of the
633 parameters used in the ML-DSA algorithms for key generation, signing, and verifcation. For informational
634 purposes, some parameters used in the analysis of these algorithms are also included in the table. In
635 particular, “repetitions” refers to the expected number of repetitions of the main loop in the signing
636 algorithm, from eq. 5 in [4]. The names of the parameter sets are of the form “ML-DSA-kℓ,” where (k, ℓ)
637 are the dimensions of the matrix A.
638 These parameter sets were designed to meet certain security strength categories defned by NIST in its
639 original Call for Proposals [25]. These security strength categories are explained further in Appendix A.
640 Using this approach, security strength is not described by a single number, such as “128 bits of security.”
641 Instead, each ML-DSA parameter set is claimed to be at least as secure as a generic block cipher with a
642 prescribed key size or a generic hash function with a prescribed output length. More precisely, it is claimed
643 that the computational resources needed to break ML-DSA are greater than or equal to the computational
644 resources needed to break the block cipher or hash function when these computational resources are
645 estimated using any realistic model of computation. Different models of computation can be more or less
646 realistic and, accordingly, lead to more or less accurate estimates of security strength. Some commonly
647 studied models are discussed in [26].
648 Concretely, the parameter set ML-DSA-44 is claimed to be in security strength category 2, ML-DSA-65 is
649 claimed to be in category 3, and ML-DSA-87 is claimed to be in category 5 [5]. For additional discussion
650 of the security strength of MLWE-based cryptosystems, see [27].
651 The sizes of keys and signatures corresponding to each parameter set are given in Table 2. Note that certain
652 optimizations are possible, when storing ML-DSA public and private keys. If additional space is available,
653 one can pre-compute and store Â, to speed up signing and verifying. Alternatively, if one wants to reduce
654 the space needed for the private key, one can only store the 32-byte seed ξ , which is suffcient to generate
655 the other parts of the private key. For additional details, see Section 3.1 in [5].
13
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
661 • A public random seed ρ. Using this seed, a polynomial matrix, A ∈ Rqk×ℓ is pseudorandomly
662 sampled2 from Rk×ℓ
q .
663 • A private random seed ρ ′ . Using this seed, the polynomial vectors s1 ∈ Rℓq and s2 ∈ Rkq are
664 pseudorandomly sampled from the subset of polynomial vectors whose coeffcients are short, (i.e.
665 in the range [−η, η]).
t = As1 + s2 .
668 The vector t together with the matrix A may be thought of as an expanded form of the public key. The
669 vector t is compressed in the actual public key by dropping the d least signifcant bits from each coeffcient,
670 thus producing the polynomial vector t1 . This compression is an optimization for performance, not security.
671 The low order bits of t can be reconstructed from a small number of signatures and, therefore, need not be
672 regarded as secret.
673 The ML-DSA public key pk is a byte encoding of the public random seed ρ and the compressed polynomial
674 vector t1 .
675 The ML-DSA private key sk is a byte encoding of the public random seed ρ; a 256-bit private random seed
676 K for use during signing; a 512-bit hash of the public key, tr, for use during signing; the secret polynomial
677 vectors s1 and s2 ; and a polynomial vector t0 encoding the d least signifcant bits of each coeffcient of the
678 uncompressed public-key polynomial t.
2 More precisely, since only the NTT form of A, Â ∈ Tqk×ℓ = NTT(A) is needed in subsequent calculations, the code
actually computes  as a pseudorandom sample over Tqk×ℓ , and the sampling of A = NTT−1 (Â) is only implicit (it
could be computed but is not).
14
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Algorithm 1 ML-DSA.KeyGen()
Generates a public-private key pair.
Output: Public key, pk ∈ B32+32k(bitlen (q−1)−d) ,
and private key, sk ∈ B32+32+64+32·((ℓ+k)·bitlen (2η)+dk) .
1: ξ ← {0, 1}256 ▷ Choose random seed
′
2: (ρ, ρ , K ) ∈ {0, 1} 256 512 256
× {0, 1} × {0, 1} ← H(ξ , 1024) ▷ Expand seed
3: Â ← ExpandA(ρ) ▷ A is generated and stored in NTT representation as Â
4: (s1 , s2 ) ← ExpandS(ρ ′ )
5: t ← NTT−1 (Â ◦ NTT(s1 )) + s2 ▷ Compute t = As1 + s2
6: (t1 , t0 ) ← Power2Round(t, d) ▷ Compress t
7: pk ← pkEncode(ρ, t1 )
8: tr ← H(BytesToBits(pk), 512)
9: sk ← skEncode(ρ, K,tr, s1 , s2 , t0 ) ▷ K and tr are for use in signing
10: return (pk, sk)
679 6. Signing
680 ML-DSA.Sign (Algorithm 2) takes as input a private key sk, encoded as a byte string, and a message,
681 M, encoded as a bit string, and it outputs a signature encoded as a byte string. There are two versions
682 of the algorithm: “hedged” and “deterministic.” The default “hedged” version of ML-DSA.Sign uses
683 fresh randomness. In addition, for platforms where a random number generator is unavailable, an optional
684 deterministic variant is specifed. However, the lack of randomness in the deterministic variant makes
685 the risk of side-channel attacks more diffcult to mitigate. Therefore, this variant should not be used on
686 platforms where side-channel attacks are a concern and where they cannot be otherwise mitigated. (See
687 the discussion in Section 3 for more details.)
688 Note that implementing the hedged variant only (without the deterministic variant) is suffcient to guarantee
689 interoperability. The same verifcation algorithm will work to verify signatures produced by either
690 variant, so implementing the deterministic variant in addition to the hedged variant does not enhance
691 interoperability.
692 In both variants, the signer frst extracts the following from the private key: the public random seed ρ;
693 the 256-bit private random seed K; the 512-bit hash of the public key, tr; the secret polynomial vectors
694 s1 and s2 ; and the polynomial vector t0 encoding the d least signifcant bits of each coeffcient of the
695 uncompressed public key polynomial t. ρ is then expanded to the same matrix A as in key generation.
696 Before the message, M, is signed, it is concatenated with the public-key hash tr and hashed down to a
697 512-bit message representative, µ, using the hash function H (see section 8.3).
698 The signer produces an additional 512-bit seed ρ ′ , for private randomness during each signing operation.
699 ρ ′ is computed as ρ ′ ← H(K||rnd||µ, 512). In the default “hedged” variant, rnd is the output of an RBG,
700 while in the deterministic variant rnd is a 256-bit string consisting entirely of zeroes. This is the only
701 difference between the deterministic and hedged variant of ML-DSA.Sign.
702 The main part of the signing algorithm consists of a rejection sampling loop, where each iteration of the
703 loop either produces a valid signature or an invalid signature whose release would leak information about
704 the private key. The loop is repeated until a valid signature is produced, which can then be encoded as a
705 byte string and output. The rejection sampling loop follows the Fiat-Shamir with aborts paradigm [9] and
15
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
706 (aside from the rejection step) is similar in structure to Schnorr signatures [28] (e.g., EdDSA [29]). The
707 signer frst produces a “commitment” w1 . Then the signer pseudorandomly derives a “challenge” c from
708 w1 and the message representative µ. Finally, the signer computes a response z.
709 In more detail, the main computations involved in the rejection sampling loop are as follows:
710 • Using the ExpandMask function (Algorithm 28), the seed ρ ′ and a counter κ, a polynomial vector
711 y ∈ Rℓq is pseudorandomly sampled from the subset of polynomial vectors whose coeffcients are
712 moderately short (i.e. in the range [−γ1 + 1, γ1 ]).
713 • From y, the signer computes the commitment w1 by computing w = Ay and then rounding to a
714 nearby multiple of 2γ2 , using HighBits (Algorithm 31).
715 • w1 and µ are concatenated and hashed to produce the commitment hash c̃. This uses the function
716 w1Encode (Algorithm 22). Let c̃1 denote the frst 256 bits of c̃. The bit string c̃1 is used to
717 pseudorandomly sample a polynomial c ∈ Rq that has coeffcients in {−1, 0, 1} and Hamming
718 weight τ. The sampling is done with the function SampleInBall (Algorithm 23). 3
719 • The signer computes the response z = y + cs1 and performs various validity checks. If any of the
720 checks fail, the signer will continue the rejection sampling loop.
721 • If the checks pass, the signer can compute a hint polynomial, h, which will allow the verifer to
722 reconstruct w1 using the compressed public key (along with the other components of the signature).
723 This uses the function MakeHint (Algorithm 33). The signer will then output the fnal signature,
724 which is a byte encoding of the commitment hash c̃, the response z, and the hint h.
725 In addition, there is an alternative way of implementing the validity checks on z, and the computation of h,
726 which is described in section 5.1 of [5]. This method may also be used in implementations of ML-DSA.
727 In Algorithm 2, variables are sometimes used to store products to avoid recomputing them later in the
728 signing algorithm. These precomputed products are denoted in the pseudocode by a pair of double angle
729 brackets enclosing the variables being multiplied (e.g., ⟨⟨cs1 ⟩⟩).
3 The length of c̃1 is determined by the targeted security strength against signature forgery attacks, and the required
length is only 256 bits for 256 bits of classical security. The length of c̃ is determined by the desired security with
respect to the “message-bound signatures” property described in [6]. Here, a length of 2λ bits is required for λ bits
of classical security.
16
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Algorithm 2 ML-DSA.Sign(sk, M)
Generates a signature for a message M.
Input: Private key, sk ∈ B32+32+64+32·((ℓ+k)·bitlen (2η)+dk) and the message M ∈ {0, 1}∗ .
Output: Signature, σ ∈ B32+ℓ·32·(1+bitlen (γ1 −1))+ω +k .
1: (ρ, K,tr, s1 , s2 , t0 ) ← skDecode(sk)
2: ŝ1 ← NTT(s1 )
3: ŝ2 ← NTT(s2 )
4: t̂0 ← NTT(t0 )
5: Â ← ExpandA(ρ) ▷ A is generated and stored in NTT representation as Â
6: µ ← H(tr||M, 512) ▷ Compute message representative µ
7: rnd ← {0, 1}256 ▷ For the optional deterministic variant, substitute rnd ← {0}256
8: ρ ′ ← H(K||rnd||µ, 512) ▷ Compute private random seed
9: κ ← 0 ▷ Initialize counter κ
10: (z, h) ← ⊥
11: while (z, h) = ⊥ do ▷ Rejection sampling loop
12: y ← ExpandMask(ρ , κ) ′
17
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
730 7. Verifcation
731 The algorithm ML-DSA.Verify (Algorithm 3) takes as input a public key pk encoded as a byte string, a
732 message M encoded as a bit string, and a signature σ encoded as a byte string. ML-DSA.Verify requires
733 no randomness. It produces as output a Boolean value (i.e., a value that is true if the signature is valid
734 with respect to the message and public key, and false if the signature is invalid). Algorithm 3 specifes the
735 length of the signature σ and the public key pk in terms of the parameters described in section 1. If an
736 implementation of ML-DSA.Verify can accept inputs for σ or pk of any other length, it shall return false
737 whenever the length of either of these inputs differs from its specifed length.
738 The verifer frst extracts the public random seed ρ and the compressed polynomial vector t1 from the
739 public key pk; and extracts the signer’s commitment hash c̃, response z, and hint h from the signature σ .
740 The verifer may fnd that the hint was not properly byte encoded, denoted by the symbol “⊥,” in which
741 case the verifcation algorithm will immediately return false, indicating that the signature is invalid.
742 Assuming that the signature is successfully extracted from its byte encoding, the verifer pseudorandomly
743 derives A from ρ, as is done in key generation and signing, and creates a message representative µ, by
744 hashing the concatenation of tr (the hash of the public key pk) and the message M.
745 The verifer then attempts to reconstruct the signer’s commitment (the polynomial vector w1 ) from
746 the public key pk and the signature σ . In ML-DSA.Sign, w1 is computed by rounding w = Ay. In
747 ML-DSA.Verify, the reconstructed value of w1 is called w1′ , since it may have been computed in a different
748 way, in the case where the signature is invalid. This w′1 is computed through the following process:
749 • Derive the challenge polynomial c from the signer’s commitment hash c̃, as done in ML-DSA.Sign.
w′Approx = Az − ct1 · 2d .
751 Note that assuming the signature was computed correctly, as in ML-DSA.Sign, it follows that
754 Finally, the verifer checks that the signer’s response z and the signer’s hint h are valid, and that the
755 reconstructed w′1 is consistent with the signer’s commitment hash c̃. More precisely, the verifer checks
756 that all of the coeffcients of z are suffciently small (i.e., in the range [−(γ1 − β ), γ1 − β ]); that h contains
757 no more than ω nonzero coeffcients; and that c̃ matches the hash c̃′ of the message representative µ
758 concatenated with w′1 (represented as a bit string). If all of these checks succeed, then ML-DSA.Verify
759 returns true. Otherwise it returns false.
18
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Algorithm 3 ML-DSA.Verify(pk, M, σ )
Verifes a signature σ for a message M.
Input: Public key, pk ∈ B32+32k(bitlen (q−1)−d) and message M ∈ {0, 1}∗ .
Input: Signature, σ ∈ B32+ℓ·32·(1+bitlen (γ1 −1))+ω +k .
Output: Boolean
1: (ρ, t1 ) ← pkDecode(pk)
2: (c̃, z, h) ← sigDecode(σ ) ▷ Signer’s commitment hash c̃, response z and hint h
3: if h = ⊥ then return false ▷ Hint was not properly encoded
4: end if
5: Â ← ExpandA(ρ) ▷ A is generated and stored in NTT representation as Â
6: tr ← H(BytesToBits(pk), 512)
7: µ ← H(tr||M, 512) ▷ Compute message representative µ
8: (c̃1 , c̃2 ) ∈ {0, 1}256 × {0, 1}2λ −256 ← c̃
9: c ← SampleInBall(c̃1 ) ▷ Compute verifer’s challenge from c̃
′
10: wApprox ← NTT−1 (A ˆ ◦ NTT(z) − NTT(c) ◦ NTT(t1 · 2d )) ▷ w′Approx = Az − ct1 · 2d
11: w′1 ← UseHint(h, w′Approx ) ▷ Reconstruction of signer’s commitment
′
12: c̃ ← H(µ||w1Encode(w1 ), 2λ ) ′ ▷ Hash it; this should match c̃
13: return [[ ||z||∞ < γ1 − β ]] and [[c̃ = c̃′ ]] and [[number of 1’s in h is ≤ ω]]
4 Obtaining at least λ bits of classical security strength against collision attacks requires that the digest to be signed
be at least 2λ bits in length.
19
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Algorithm 4 IntegerToBits(x, α)
Computes the base-2 representation of x mod 2α (using in little-endian order).
Input: A nonnegative integer x and a positive integer α.
Output: A bit string y of length α.
1: for i from 0 to α − 1 do
2: y[i] ← x mod 2
3: x ← ⌊x/2⌋
4: end for
5: return y
Algorithm 5 BitsToInteger(y)
Computes the integer value expressed by a bit string (using little-endian order).
Input: A bit string y of length α.
Output: A nonnegative integer x.
1: x ← 0
2: for i from 1 to α do
3: x ← 2x + y[α − i]
4: end for
5: return x
20
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Algorithm 6 BitsToBytes(y)
Converts a string of bits of length c into a string of bytes of length ⌈c/8⌉.
Input: A bit string y of length c.
Output: A byte string z.
1: z ← 0⌈c/8⌉
2: for i from 0 to c − 1 do
3: z [⌊i/8⌋] ← z [⌊i/8⌋] + y[i] · 2i mod 8
4: end for
5: return z
Algorithm 7 BytesToBits(z)
Converts a byte string into a bit string.
Input: A byte string z of length d.
Output: A bit string y.
1: for i from 0 to d − 1 do
2: for j from 0 to 7 do
3: y[8i + j] ← z[i] mod 2
4: z[i] ← ⌊z[i]/2⌋
5: end for
6: end for
7: return y
780 Algorithms 8–9 translate byte strings into coeffcients of polynomials in Rq . CoeffFromThreeBytes
781 uses a three-byte string to either generate an element of {0, 1, . . . , q − 1} or return the blank symbol ⊥.
782 CoefFromHalfByte uses an element of {0, 1, . . . , 15} to either generate an element of {−η, −η +1, . . . , η}
783 or return ⊥. These two procedures will be used in the uniform sampling algorithms, RejNTTPoly and
784 RejBoundedPoly, discussed in subsection 8.3.
Algorithm 8 CoefFromThreeBytes(b0 , b1 , b2 )
Generates an element of {0, 1, 2, . . . , q − 1} ∪ {⊥}.
Input: Bytes b0 , b1 , b2 .
Output: An integer modulo q or ⊥.
1: if b2 > 127 then
2: b2 ← b2 − 128 ▷ Set the top bit of b2 to zero
3: end if
4: z ← 216 · b2 + 28 · b1 + b0
5: if z < q then return z
6: else return ⊥
7: end if
21
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Algorithm 9 CoefFromHalfByte(b)
Generates an element of {−η, −η + 1, . . . , η} ∪ {⊥}.
Input: Integer b ∈ {0, 1, . . . , 15}.
Output: An integer between −η and η, or ⊥.
1: if η = 2 and b < 15 then return 2 − (b mod 5)
2: else
3: if η = 4 and b < 9 then return 4 − b
4: else return ⊥
5: end if
6: end if
785 Algorithms 10–13 effciently translate an element w ∈ R into a byte string and vice versa under the
786 assumption that the coeffcients of w are in a restricted range. SimpleBitPack assumes that wi ∈ [0, b]
787 for some positive integer b and packs w into a byte string of length 32 · bitlen b. BitPack allows for the
788 more general restriction wi ∈ [−a, b]. The BitPack algorithm works by merely subtracting w from the
789 polynomial ∑255 i
i=0 bX and then applying SimpleBitPack.
Algorithm 10 SimpleBitPack(w, b)
Encodes a polynomial w into a byte string.
Input: b ∈ N and w ∈ R such that the coeffcients of w are all in [0, b].
Output: A byte string of length 32 · bitlen b.
1: z ← () ▷ set z to the empty string
2: for i from 0 to 255 do
3: z ← z||IntegerToBits(wi , bitlen b)
4: end for
5: return BitsToBytes(z)
Algorithm 11 BitPack(w, a, b)
Encodes a polynomial w into a byte string.
Input: a, b ∈ N and w ∈ R such that the coeffcients of w are all in [−a, b].
Output: A byte string of length 32 · bitlen (a + b).
1: z ← () ▷ set z to the empty string
2: for i from 0 to 255 do
3: z ← z||IntegerToBits(b − wi , bitlen (a + b))
4: end for
5: return BitsToBytes(z)
790 SimpleBitUnpack and BitUnpack are used to decode the byte strings produced by the above functions.
791 Note that for some choices of a and b, there exist malformed byte strings that will cause SimpleBitUnpack
792 and BitUnpack to output polynomials whose coeffcients do not lie in the ranges [0, b] and [−a, b],
793 respectively. This can be a concern, when running SimpleBitUnpack and BitUnpack on inputs that may
794 come from an untrusted source.
22
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Algorithm 12 SimpleBitUnpack(v, b)
Reverses the procedure SimpleBitPack.
Input: b ∈ N and a byte string v of length 32 · bitlen b.
Output: A polynomial w ∈ R, with coeffcients in [0, 2c − 1], where c = bitlen b.
When b + 1 is a power of 2, the coeffcients are in [0, b].
1: c ← bitlen b
2: z ← BytesToBits(v)
3: for i from 0 to 255 do
4: wi ← BitsToInteger((z[ic], z[ic + 1], . . . z[ic + c − 1]), c)
5: end for
6: return w
Algorithm 13 BitUnpack(v, a, b)
Reverses the procedure BitPack.
Input: a, b ∈ N and a byte string v of length 32 · bitlen (a + b).
Output: A polynomial w ∈ R, with coeffcients in [b − 2c + 1, b], where c = bitlen (a + b).
When a + b + 1 is a power of 2, the coeffcients are in [−a, b].
1: c ← bitlen (a + b)
2: z ← BytesToBits(v)
3: for i from 0 to 255 do
4: wi ← b − BitsToInteger((z[ic], z[ic + 1], . . . z[ic + c − 1]), c)
5: end for
6: return w
795 Algorithms 14–15 carry out byte-string-to-polynomial conversions for polynomials with sparse binary
796 coeffcients. In particular, the signing and verifcation algorithms (sections 6 and 7) make use of a “hint,”
797 which is a vector of polynomials h ∈ Rk2 such that the total number of coeffcients in h[0], h[1], . . . , h[k − 1]
798 that are equal to 1 is no more than ω. This constraint enables encoding and decoding procedures that are
799 more effcient (although more complex) than BitPack and BitUnpack.
800 HintBitPack (h) outputs a byte string y of length ω + k. The last k bytes of y contain information about
801 how many nonzero coeffcients are present in each of the polynomials h[0], h[1], . . . , h[k − 1], and the frst
802 ω bytes of y contain information about exactly where those nonzero terms occur. HintBitUnpack reverses
803 the procedure performed by HintBitPack and recovers the vector h.
23
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Algorithm 14 HintBitPack(h)
Encodes a polynomial vector h with binary coeffcients into a byte string.
Input: A polynomial vector h ∈ Rk2 such that at most ω of the coeffcients in h are equal to 1.
Output: A byte string y of length ω + k.
1: y ∈ Bω+k ← 0ω+k
2: Index ← 0
3: for i from 0 to k − 1 do
4: for j from 0 to 255 do
5: if h[i] j ̸= 0 then
6: y[Index] ← j ▷ Store the locations of the nonzero coeffcients in h[i]
7: Index ← Index + 1
8: end if
9: end for
10: y[ω + i] ← Index ▷ Store the value of Index after processing h[i]
11: end for
12: return y
Algorithm 15 HintBitUnpack(y)
Reverses the procedure HintBitPack.
Input: A byte string y of length ω + k.
Output: A polynomial vector h ∈ Rk2 or ⊥.
1: h ∈ Rk2 ← 0k
2: Index ← 0
3: for i from 0 to k − 1 do
4: if y[ω + i] < Index or y[ω + i] > ω then return ⊥
5: end if
6: while Index < y[ω + i] do
7: h[i]y[Index] ← 1
8: Index ← Index + 1
9: end while
10: end for
11: while Index < ω do
12: if y[Index] ̸= 0 then return ⊥
13: end if
14: Index ← Index + 1
15: end while
16: return h
24
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
808 First, pkEncode and pkDecode translate ML-DSA public keys into byte strings, and vice versa. Note that,
809 when verifying a signature, pkDecode might be run on an input that comes from an untrusted source. Thus,
810 care is required when using SimpleBitUnpack. As used here, SimpleBitUnpack always returns values in
811 the correct range.
Algorithm 16 pkEncode(ρ, t1 )
Encodes a public key for ML-DSA into a byte string.
Input:ρ ∈ {0, 1}256 , t1 ∈ Rk with coeffcients in [0, 2bitlen (q−1)−d − 1]).
Output: Public key pk ∈ B32+32k(bitlen (q−1)−d) .
1: pk ← BitsToBytes(ρ)
2: for i from 0 to k − 1 do
3: pk ← pk || SimpleBitPack (t1 [i], 2bitlen (q−1)−d − 1)
4: end for
5: return pk
Algorithm 17 pkDecode(pk)
Reverses the procedure pkEncode.
Input: Public key pk ∈ B32+32k(bitlen (q−1)−d) .
Output: ρ ∈ {0, 1}256 , t1 ∈ Rk with coeffcients in [0, 2bitlen (q−1)−d − 1]).
k
1: (y, z0 , . . . , zk−1 ) ∈ B32 × B32(bitlen (q−1)−d) ← pk
2: ρ ← BytesToBits(y)
3: for i from 0 to k − 1 do
4: t1 [i] ← SimpleBitUnpack(zi , 2bitlen (q−1)−d − 1)) ▷ This is always in the correct range
5: end for
6: return (ρ, t1 )
25
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
812 Next, skEncode and skDecode translate ML-DSA secret keys into byte strings, and vice versa. Note that
813 there exist malformed inputs that can cause skDecode to return values that are not in the correct range.
814 Hence skDecode should only be run on input that comes from trusted sources.
26
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Algorithm 19 skDecode(sk)
Reverses the procedure skEncode.
Input: Private key, sk ∈ B32+32+64+32·((ℓ+k)·bitlen (2η)+dk) .
Output: ρ ∈ {0, 1}256 , K ∈ {0, 1}256 , tr ∈ {0, 1}512 ,
s1 ∈ Rℓ , s2 ∈ Rk , t0 ∈ Rk with coeffcients in [−2d−1 + 1, 2d−1 ].
ℓ
1: ( f , g, h, y0 , . . . , yℓ−1 , z0 , . . . , zk−1 , w0 , . . . , wk−1 ) ∈ B32 × B32 × B64 × B32·bitlen (2η ) ×
k � k
B 32·bitlen (2η) × B32d ← sk
2: ρ ← BytesToBits( f )
3: K ← BytesToBits(g)
4: tr ← BytesToBits(h)
5: for i from 0 to ℓ − 1 do
6: s1 [i] ← BitUnpack(yi , η, η) ▷ This may lie outside [−η, η], if input is malformed
7: end for
8: for i from 0 to k − 1 do
9: s2 [i] ← BitUnpack(zi , η, η) ▷ This may lie outside [−η, η], if input is malformed
10: end for
11: for i from 0 to k − 1 do
12: t0 [i] ← BitUnpack(wi , 2d −1 − 1, 2d−1 ) ▷ This is always in the correct range
13: end for
14: return (ρ, K,tr, s1 , s2 , t0 )
27
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
815 Next, sigEncode and sigDecode translate ML-DSA signatures into byte strings, and vice versa. Note that,
816 when verifying a signature, sigDecode might be run on input that comes from an untrusted source. Thus
817 care is required when using BitUnpack. As used here, BitUnpack always returns values in the correct
818 range.
Algorithm 20 sigEncode(c̃, z, h)
Encodes a signature into a byte string.
Input: c̃ ∈ {0, 1}2λ , z ∈ Rℓ with coeffcients in [−γ1 + 1, γ1 ], h ∈ Rk2 .
Output: Signature, σ ∈ Bλ /4+ℓ·32·(1+bitlen (γ1 −1))+ω+k .
1: σ ← BitsToBytes(c̃)
2: for i from 0 to ℓ − 1 do
3: σ ← σ || BitPack (z[i], γ1 − 1, γ1 )
4: end for
5: σ ← σ || HintBitPack (h)
6: return σ
Algorithm 21 sigDecode(σ )
Reverses the procedure sigEncode.
Input: Signature, σ ∈ Bλ /4+ℓ·32·(1+bitlen (γ1 −1))+ω +k .
Output: c̃ ∈ {0, 1}2λ , z ∈ Rℓq with coeffcients in [−γ1 + 1, γ1 ], h ∈ Rk2 or ⊥.
1: (w, x0 , . . . , xℓ−1 , y) ∈ Bλ /4 × Bℓ·32·(1+bitlen (γ1 −1)) × Bω+k ← σ
2: c̃ ← BytesToBits(w)
3: for i from 0 to ℓ − 1 do
4: z[i] ← BitUnpack(xi , γ1 − 1, γ1 ) ▷ This is always in the correct range, as γ1 is a power of 2
5: end for
6: h ← HintBitUnpack(y)
7: return (c̃, z, h)
819 Lastly, w1Encode (Algorithm 22) is a specifc subroutine that is used in ML-DSA.Sign (Algorithm 2).
820 Algorithm 22 encodes a polynomial vector w1 into a string of bits, so that it can be processed by the hash
821 function, H.
Algorithm 22 w1Encode(w1 )
Encodes a polynomial vector w1 into a bit string.
Input: w1 ∈ Rk with coeffcients in [0, (q − 1)/(2γ2 ) − 1].
Output: A bit string representation, w̃1 ∈ {0, 1}32k·bitlen ((q−1)/(2γ2 )−1) .
1: w̃1 ← ()
2: for i from 0 to k − 1 do
3: w̃1 ← w̃1 || BytesToBits (SimpleBitPack (w1 [i], (q − 1)/(2γ2 ) − 1))
4: end for
5: return w̃1
28
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
826 The algorithm SHAKE256 is such that if c < d are positive integers and ρ ∈ {0, 1}∗ , then H(ρ, c) is exactly
827 equal to the frst c bits of H(ρ, d). The same is true of SHAKE128. For convenience, the expression
828 H(ρ)[k] may be used to denote the bit H(ρ, k + 1)[k] for any nonnegative integer k. Similarly, H(ρ)J jK
829 denotes the byte expressed by the bit string
830 (in little endian-order). The expressions H128 (ρ)[k] and H128 (ρ)J jK are similarly defned.
831 The notation H(ρ)[k] is used in loops where an unknown number of bits of the form H(ρ)[k] will be needed
832 to compute a pseudorandom value (for the same ρ and consecutive, increasing values of k). It is expected
833 that implementations will avoid recomputation by keeping track of the internal state of the SHAKE256
834 computation throughout the loop, and will only completely destroy that information once the the loop ends.
835 Similar implementation considerations apply when the XOF is H128 and when the output is parsed in bytes.
836 When H is used with a fxed length output, this standard sometimes refers to H as a hash function. Note
837 that, while H used with a fxed output length is a hash function, it is not an approved hash function for
838 general use. This standard only approves the use of H as a hash function where it is explicitly specifed as
839 part of the algorithms herein, or as part of a mathematically equivalent set of steps being performed in
840 place of the steps of these algorithms. In other contexts, the fact that H(ρ, c) is a prefx of H(ρ, d) for any
841 d > c, may interfere with desired security properties, but it is believed that when H is used as described in
842 this standard, it is overwhelmingly unlikely that H will be used with the same input string but a different
843 output length.
844 In addition, this subsection specifes various algorithms for generating algebraic objects pseudorandomly
845 from a seed ρ. The length of the bit string ρ varies depending on the algorithm.
846 The frst procedure to be defned is SampleInBall in Algorithm 23. Let Bτ denote the set of all polynomials
847 c ∈ Rq such that
850 SampleInBall generates an element of Bτ pseudorandomly using the XOF of a seed ρ. The procedure is
851 based on the Fisher-Yates shuffe. The frst 8 bytes of H(ρ) are used to choose the signs of the nonzero
852 entries of c,5 and subsequent bytes of H(ρ) are used to choose the positions of those nonzero entries.
5 Theparameter τ is always less than or equal to 64, and thus 8 bytes are suffcient to choose the signs for all τ
nonzero entries of c.
29
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Algorithm 23 SampleInBall(ρ)
Samples a polynomial c ∈ Rq with coeffcients from {−1, 0, 1} and Hamming weight τ.
Input: A seed ρ ∈ {0, 1}256
Output: A polynomial c in Rq .
1: c ← 0
2: k ← 8
3: for i from 256 − τ to 255 do
4: while H(ρ)JkK > i do
5: k ← k+1
6: end while
7: j ← H(ρ)JkK ▷ j is a pseudorandom byte that is ≤ i
8: ci ← c j
9: c j ← (−1)H(ρ)[i+τ −256]
10: k ← k+1
11: end for
12: return c
853 Algorithms 24–28 are the pseudorandom procedures RejNTTPoly, RejBoundedPoly, ExpandA, ExpandS,
854 and ExpandMask. Each generates elements of Rq or Tq under different input and output conditions.
855 RejNTTPoly and ExpandA make use of the more effcient XOF H128 , whereas the other three procedures
856 use the XOF H.
857 The procedure ExpandMask (Algorithm 28) generates a polynomial vector s in Rkq that disguises the secret
858 key in the Sign procedure (Algorithm 2). In addition to the seed ρ, ExpandMask also accepts an integer
859 input µ that is incorporated into the pseudorandom procedure that generates s.
Algorithm 24 RejNTTPoly(ρ)
Samples a polynomial ∈ Tq .
Input: A seed ρ ∈ {0, 1}272 .
Output: An element â ∈ Tq .
1: j ← 0
2: c ← 0
3: while j < 256 do
4: â[ j] ← CoefFromThreeBytes(H128 (ρ)JcK, H128 (ρ)Jc + 1K, H128 (ρ)Jc + 2K)
5: c ← c+3
6: ̸ ⊥ then
if â[ j] =
7: j ← j+1
8: end if
9: end while
10: return â
30
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Algorithm 25 RejBoundedPoly(ρ)
Samples an element a ∈ Rq with coeffcients in [−η, η] computed via rejection sampling from ρ.
Input: A seed ρ ∈ {0, 1}528 .
Output: A polynomial a ∈ Rq .
1: j ← 0
2: c ← 0
3: while j < 256 do
4: z ← H(ρ)JcK
5: z0 ← CoefFromHalfByte(z mod 16, η)
6: z1 ← CoefFromHalfByte(⌊z/16⌋, η)
7: if z0 ̸= ⊥ then
8: a j ← z0
9: j ← j+1
10: end if
11: if z1 ̸= ⊥ and j < 256 then
12: a j ← z1
13: j ← j+1
14: end if
15: c ← c+1
16: end while
17: return a
Algorithm 26 ExpandA(ρ)
Samples a k × ℓ matrix  of elements of Tq .
Input: ρ ∈ {0, 1}256 .
Output: Matrix Â.
1: for r from 0 to k − 1 do
2: for s from 0 to ℓ − 1 do
3: Â[r, s] ← RejNTTPoly(ρ||IntegerToBits(s, 8)||IntegerToBits(r, 8))
4: end for
5: end for
6: return Â
31
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Algorithm 27 ExpandS(ρ)
Samples vectors s1 ∈ Rℓq and s2 ∈ Rkq , each with coeffcients in the interval [−η, η].
Input: ρ ∈ {0, 1}512
Output: Vectors s1 , s2 of polynomials in Rq .
1: for r from 0 to ℓ − 1 do
2: s1 [r] ← RejBoundedPoly(ρ||IntegerToBits(r, 16))
3: end for
4: for r from 0 to k − 1 do
5: s2 [r] ← RejBoundedPoly(ρ||IntegerToBits(r + ℓ, 16))
6: end for
7: return (s1 , s2 )
Algorithm 28 ExpandMask(ρ, µ)
Samples a vector s ∈ Rℓq such that each polynomial s j has coeffcients between −γ1 + 1 and γ1 .
Input: A bit string ρ ∈ {0, 1}512 and a nonnegative integer µ.
Output: Vector s ∈ Rℓq .
1: c ← 1 + bitlen (γ1 − 1) ▷ γ1 is always a power of 2
2: for r from 0 to ℓ − 1 do
3: n ← IntegerToBits(µ + r, 16)
4: v ← (H(ρ||n)J32rcK, H(ρ||n)J32rc + 1K, . . . , H(ρ||n)J32rc + 32c − 1K)
5: s[r] ← BitUnpack(v, γ1 − 1, γ1 )
6: end for
7: return s
32
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
866 • For r ∈ Rkq and d ∈ Z, defne (r1 , r0 ) ∈ (Rk )2 = Power2Round(r, d), so that:
872 These algorithms are used to support the key compression optimization of ML-DSA. The basic idea is
873 to drop the d low-order bits of each coeffcient of the polynomial vector t from the public key using the
874 function Power2Round. However, in order to make this optimization work, additional information, called
875 a “hint”, needs to be provided in the signature to allow the verifer to reconstruct enough of the information
876 in the dropped public key bits to verify the signature. Hints are created during signing and used during
877 verifcation by the functions MakeHint and UseHint, respectively. In the verifcation of a valid signature,
878 the hint allows the verifer to recover w1 ∈ Rk , which represents w ∈ Rkq rounded to a nearby multiple
879 of α = 2γ2 . The signer obtains w1 directly using the function HighBits, and the part rounded off, r0 , is
880 obtained by LowBits. r0 is used by the signer in the rejection sampling procedure.
881 Power2Round decomposes an input r ∈ Zq into integers that represent the high- and low-order bits of
882 r mod q in the straightforward bitwise way, r mod q = r1 · 2d + r0 , where r0 = (r mod q) mod± 2d and
883 r1 = (r mod q − r0 )/2d .
884 However, for the purpose of computations related to hints, this method of decomposing r has the undesirable
885 property that when r is close to q − 1 or 0, a small rounding error in r can cause r1 to change by more than
886 1 (even accounting for wrap-around). This is because unlike for other unequal pairs of values of r1 · 2d and
887 r1′ · 2d , the distance between ⌊q/2d ⌋ · 2d and 0 may be very small.
33
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
888 To avoid this problem, this specifcation defnes Decompose, which is similar to Power2Round except:
890 • If the straightforward rounding procedure would return (r1 = (q − 1)/α, r0 ∈ [−(α/2) + 1, α/2]),
891 Decompose instead returns (r1 = 0, r0 − 1).
892 The functions HighBits and LowBits– which only return r1 and r0 , respectively – and MakeHint and
893 UseHint use Decompose. For additional discussion of the mathematical properties of these functions that
894 are relevant to the correctness and security of ML-DSA, see Section 2.4 in [5].
Algorithm 29 Power2Round(r)
Decomposes r into (r1 , r0 ) such that r ≡ r1 2d + r0 mod q.
Input: r ∈ Zq .
Output: Integers (r1 , r0 ).
1: r+ ← r mod q
2: r0 ← r+�mod± 2d
3: return (r+ − r0 )/2d , r0
Algorithm 30 Decompose(r)
Decomposes r into (r1 , r0 ) such that r ≡ r1 (2γ2 ) + r0 mod q.
Input: r ∈ Zq
Output: Integers (r1 , r0 ).
1: r+ ← r mod q
2: r0 ← r+ mod± (2γ2 )
3: if r+ − r0 = q − 1 then
4: r1 ← 0
5: r0 ← r 0 − 1
6: else r1 ← (r+ − r0 )/(2γ2 )
7: end if
8: return (r1 , r0 )
Algorithm 31 HighBits(r)
Returns r1 from the output of Decompose (r)
Input: r ∈ Zq
Output: Integer r1 .
1: (r1 , r0 ) ← Decompose(r)
2: return r1
34
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Algorithm 32 LowBits(r)
Returns r0 from the output of Decompose (r)
Input: r ∈ Zq
Output: Integer r0 .
1: (r1 , r0 ) ← Decompose(r)
2: return r0
Algorithm 33 MakeHint(z, r)
Compute hint bit indicating whether adding z to r alters the high bits of r.
Input: z, r ∈ Zq
Output: Boolean
1: r1 ← HighBits(r)
2: v1 ← HighBits(r + z)
3: return [[r1 ̸= v1 ]]
Algorithm 34 UseHint(h, r)
Returns the high bits of r adjusted according to hint h
Input:boolean h, r ∈ Zq
q−1
Output:r1 ∈ Z with 0 ≤ r1 ≤ 2γ2
1: m ← (q − 1)/(2γ2 )
2: (r1 , r0 ) ← Decompose(r)
3: if h = 1 and r0 > 0 return (r1 + 1) mod m
4: if h = 1 and r0 ≤ 0 return (r1 − 1) mod m
5: return r1
35
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Algorithm 35 NTT(w)
Computes the Number-Theoretic Transform.
Input: polynomial w(X) = ∑255 j
j=0 w j X ∈ Rq .
Output: ŵ = (ŵ[0], . . . , ŵ[255]) ∈ Tq .
1: for j from 0 to 255 do
2: ŵ[ j] ← w j
3: end for
4: k ← 0
5: len ← 128
6: while len ≥ 1 do
7: start ← 0
8: while start < 256 do
9: k ← k+1
10: zeta ← ζ brv(k) mod q
11: for j from start to start + len − 1 do
12: t ← zeta · ŵ[ j + len]
13: ŵ[ j + len] ← ŵ[ j] − t
14: ŵ[ j] ← ŵ[ j] + t
15: end for
16: start ← start + 2 · len
17: end while
18: len ← ⌊len/2⌋
19: end while
20: return ŵ
36
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
37
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
911 References
912 [1] National Institute of Standards and Technology. Digital signature standard (DSS). (U.S. Department
913 of Commerce, Washington, DC), Federal Information Processing Standards Publication (FIPS) 186-5,
914 February 2023. https://doi.org/10.6028/NIST.FIPS.186-5.
915 [2] Elaine Barker. Guideline for using cryptographic standards in the federal government: Cryptographic
916 mechanisms. (National Institute of Standards and Technology, Gaithersburg, MD), NIST Special
917 Publication (SP) 800-175B, Rev. 1, March 2020. https://doi.org/10.6028/NIST.SP.800-175Br1.
918 [3] Elaine B. Barker. Recommendation for obtaining assurances for digital signature applications.
919 National Institute of Standards and Technology, Gaithersburg, MD. NIST Special Publication (SP)
920 800-89, November 2006. https://doi.org/10.6028/NIST.SP.800-89.
921 [4] Shi Bai, Léo Ducas, Eike Kiltz, Tancrède Lepoint, Vadim Lyubashevsky, Peter Schwabe, Gregor
922 Seiler, and Damien Stehlé. CRYSTALS-Dilithium: Algorithm specifcations and supporting doc-
923 umentation. Submission to the NIST’s post-quantum cryptography standardization process, 2020.
924 https://csrc.nist.gov/projects/post-quantum-cryptography/round-3-submissions.
925 [5] Shi Bai, Léo Ducas, Eike Kiltz, Tancrède Lepoint, Vadim Lyubashevsky, Peter Schwabe, Gregor
926 Seiler, and Damien Stehlé. CRYSTALS-Dilithium: Algorithm specifcations and supporting docu-
927 mentation (Version 3.1), 2021. https://pq-crystals.org/dilithium/data/dilithium-specifcation-round3
928 -20210208.pdf.
929 [6] C. Cremers, S. Düzlü, R. Fiedler, C. Janson, and M. Fischlin. BUFFing signature schemes beyond
930 unforgeability and the case of post-quantum signatures. In 2021 IEEE Symposium on Security and
931 Privacy (SP), pages 1696–1714, Los Alamitos, CA, USA, may 2021. IEEE Computer Society.
932 [7] National Institute of Standards and Technology. SHA-3 standard: Permutation-based hash and
933 extendable-output functions. (U.S. Department of Commerce, Washington, DC), Federal Information
934 Processing Standards Publication (FIPS) 202, August 2015. https://doi.org/10.6028/NIST.FIPS.202.
935 [8] National Institute of Standards and Technology. Secure hash standard (SHS). (U.S. Department of
936 Commerce, Washington, DC), Federal Information Processing Standards Publication (FIPS) 180-4,
937 August 2015. https://doi.org/10.6028/NIST.FIPS.180-4.
938 [9] Vadim Lyubashevsky. Fiat-Shamir with aborts: Applications to lattice and factoring-based signatures.
939 In Mitsuru Matsui, editor, Advances in Cryptology – ASIACRYPT 2009, pages 598–616, Berlin,
940 Heidelberg, 2009. Springer Berlin Heidelberg.
941 [10] Vadim Lyubashevsky. Lattice signatures without trapdoors. In EUROCRYPT, volume 7237 of Lecture
942 Notes in Computer Science, pages 738–755. Springer, 2012.
943 [11] Tim Güneysu, Vadim Lyubashevsky, and Thomas Pöppelmann. Practical lattice-based cryptography:
944 A signature scheme for embedded systems. In CHES, volume 7428, pages 530–547. Springer, 2012.
945 [12] Shi Bai and Steven D. Galbraith. An improved compression technique for signatures based on
946 learning with errors. In Josh Benaloh, editor, Topics in Cryptology – CT-RSA 2014, pages 28–47,
947 Cham, 2014. Springer International Publishing.
948 [13] Oded Regev. On lattices, learning with errors, random linear codes, and cryptography. In Proceedings
949 of the Thirty-Seventh Annual ACM Symposium on Theory of Computing, STOC ’05, page 84–93,
950 New York, NY, USA, 2005. Association for Computing Machinery.
38
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
951 [14] Adeline Langlois and Damien Stehlé. Worst-case to average-case reductions for module lattices.
952 Designs, Codes and Cryptography, 75(3):565–599, 2015.
953 [15] Eike Kiltz, Vadim Lyubashevsky, and Christian Schaffner. A concrete treatment of Fiat-Shamir
954 signatures in the quantum random-oracle model. In Jesper Buus Nielsen and Vincent Rijmen, editors,
955 Advances in Cryptology – EUROCRYPT 2018, pages 552–586, Cham, 2018. Springer International
956 Publishing.
957 [16] Elaine B. Barker. Recommendation for key management:part 1 - general. National Institute of
958 Standards and Technology, Gaithersburg, MD. NIST Special Publication (SP) 800-57 Part 1 Revision
959 5, May 2020. https://doi.org/10.6028/NIST.SP.800-57pt1r5.
960 [17] Elaine B. Barker and William C. Barker. Recommendation for key management: Part 2 - best
961 practices for key management organizations. National Institute of Standards and Technology,
962 Gaithersburg, MD. NIST Special Publication (SP) 800-57 Part 2 Revision 1, May 2019. https:
963 //doi.org/10.6028/NIST.SP.800-57pt2r1.
964 [18] Elaine B. Barker and Quynh Dang. Recommendation for key management: Part 3 - application-
965 specifc key management guidance. National Institute of Standards and Technology, Gaithersburg,
966 MD. NIST Special Publication (SP) 800-57 Part 3 Revision 1, May 2019. http://dx.doi.org/10.6028
967 /NIST.SP.800-57pt3r1.
968 [19] Elaine B. Barker and John M. Kelsey. Recommendation for random number generation using
969 deterministic random bit generators. (National Institute of Standards and Technology, Gaithersburg,
970 MD), NIST Special Publication (SP) 800-90A, Rev. 1, June 2015. https://doi.org/10.6028/NIST.SP.
971 800-90Ar1.
972 [20] Meltem Sönmez Turan, Elaine B. Barker, John M. Kelsey, Kerry A. McKay, Mary L. Baish, and
973 Mike Boyle. Recommendation for the entropy sources used for random bit generation. (National
974 Institute of Standards and Technology, Gaithersburg, MD), NIST Special Publication (SP) 800-90B,
975 January 2018. https://doi.org/10.6028/NIST.SP.800-90B.
976 [21] Elaine B. Barker, John M. Kelsey, Kerry McKay, Allen Roginsky, and Meltem Sönmez Turan.
977 Recommendation for random bit generator (RBG) constructions. (National Institute of Standards
978 and Technology, Gaithersburg, MD), NIST Special Publication (SP) 800-90C (Third Public Draft),
979 September 2022. https://csrc.nist.gov/publications/detail/sp/800-90c/draft.
980 [22] Leon Groot Bruinderink and Peter Pessl. Differential fault attacks on deterministic lattice signatures.
981 IACR Transactions on Cryptographic Hardware and Embedded Systems, pages 21–43, 2018.
982 [23] Damian Poddebniak, Juraj Somorovsky, Sebastian Schinzel, Manfred Lochter, and Paul Rösler.
983 Attacking deterministic signature schemes using fault attacks. In 2018 IEEE European Symposium
984 on Security and Privacy (EuroS&P), pages 338–352. IEEE, 2018.
985 [24] Niels Samwel, Lejla Batina, Guido Bertoni, Joan Daemen, and Ruggero Susella. Breaking ed25519
986 in wolfssl. In Topics in Cryptology–CT-RSA 2018: The Cryptographers’ Track at the RSA Conference
987 2018, San Francisco, CA, USA, April 16-20, 2018, Proceedings, pages 1–20. Springer, 2018.
988 [25] National Institute of Standards and Technology. Submission requirements and evaluation criteria for
989 the post-quantum cryptography standardization process, 2016. https://csrc.nist.gov/CSRC/media/Pro
990 jects/Post-Quantum-Cryptography/documents/call-for-proposals-final-dec-2016.pdf.
39
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
991 [26] Gorjan Alagic, Daniel Apon, David Cooper, Quynh Dang, Thinh Dang, John Kelsey, Jacob Lichtinger,
992 Yi-Kai Liu, Carl Miller, Dustin Moody, Rene Peralta, Ray Perlner, Angela Robinson, and Daniel
993 Smith-Tone. Status report on the third round of the NIST post-quantum cryptography standardization
994 process. Technical Report NIST Interagency or Internal Report (IR) 8413, National Institute of
995 Standards and Technology, Gaithersburg, MD, July 2022. https://doi.org/10.6028/NIST.IR.8413-upd
996 1.
997 [27] Robert Avanzi, Joppe Bos, Léo Ducas, Eike Kiltz, Tancrède Lepoint, Vadim Lyubashevsky, John M.
998 Schanck, Peter Schwabe, Gregor Seiler, and Damien Stehlé. CRYSTALS-Kyber algorithm specifca-
999 tions and supporting documentation. 3rd Round submission to the NIST’s post-quantum cryptography
1000 standardization process, 2020. https://csrc.nist.gov/projects/post-quantum-cryptography/round-3-sub
1001 missions.
1002 [28] C. P. Schnorr. Effcient identifcation and signatures for smart cards. In Gilles Brassard, editor,
1003 Advances in Cryptology — CRYPTO’ 89 Proceedings, pages 239–252, New York, NY, 1990. Springer
1004 New York.
1005 [29] Simon Josefsson and Ilari Liusvaara. Edwards-Curve Digital Signature Algorithm (EdDSA). RFC
1006 8032, January 2017.
1007 [30] Samuel Jaques, Michael Naehrig, Martin Roetteler, and Fernando Virdia. Implementing Grover
1008 oracles for quantum key search on AES and LowMC. In Anne Canteaut and Yuval Ishai, editors,
1009 Advances in Cryptology – EUROCRYPT 2020, pages 280–310, Cham, 2020. Springer International
1010 Publishing.
1011 [31] Lov K. Grover. A fast quantum mechanical algorithm for database search. In Proceedings of the
1012 Twenty-Eighth Annual ACM Symposium on Theory of Computing, STOC ’96, page 212–219, New
1013 York, NY, USA, 1996. Association for Computing Machinery.
40
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
1029 • To allow NIST to make prudent future decisions regarding when to transition to longer keys
1030 • To help submitters make consistent and sensible choices regarding what symmetric primitives to use
1031 in padding mechanisms or other components of their schemes that require symmetric cryptography
1032 • To better understand the security/performance trade-offs involved in a given design approach
1033 In accordance with the second and third goals above, NIST based its classifcation on the range of security
1034 strengths offered by the existing NIST standards in symmetric cryptography, which NIST expects to offer
1035 signifcant resistance to quantum cryptanalysis. In particular, NIST defned a separate category for each of
1036 the following security requirements (listed in order of increasing strength):
1037 1. Any attack that breaks the relevant security defnition must require computational resources com-
1038 parable to or greater than those required for key search on a block cipher with a 128-bit key (e.g.,
1039 AES-128).
1040 2. Any attack that breaks the relevant security defnition must require computational resources compa-
1041 rable to or greater than those required for collision search on a 256-bit hash function (e.g., SHA-256/
1042 SHA3-256).
1043 3. Any attack that breaks the relevant security defnition must require computational resources com-
1044 parable to or greater than those required for key search on a block cipher with a 192-bit key (e.g.,
1045 AES-192).
1046 4. Any attack that breaks the relevant security defnition must require computational resources compa-
1047 rable to or greater than those required for collision search on a 384-bit hash function (e.g., SHA-384/
1048 SHA3-384).
1049 5. Any attack that breaks the relevant security defnition must require computational resources com-
1050 parable to or greater than those required for key search on a block cipher with a 256-bit key (e.g.,
1051 AES-256).
41
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
1052 When considering the fve categories, computational resources may be measured using a variety of
1053 different metrics (e.g., number of classical elementary operations, quantum circuit size). In order for a
1054 cryptosystem to satisfy one of the above security requirements, any attack must require computational
1055 resources comparable to or greater than the stated threshold with respect to all metrics that NIST deems to
1056 be potentially relevant to practical security.
1057 NIST intends to consider a variety of possible metrics that refect different predictions about the future
1058 development of quantum and classical computing technology and the cost of different computing resources
1059 (such as the cost of accessing extremely large amounts of memory).6 NIST will also consider input from
1060 the cryptographic community regarding this question.
1061 In an example metric provided to submitters, NIST suggested an approach where quantum attacks are
1062 restricted to a fxed running time or circuit depth. Call this parameter MAXDEPTH. This restriction is mo-
1063 tivated by the diffculty of running extremely long serial computations. Plausible values for MAXDEPTH
1064 range from 240 logical gates (the approximate number of gates that presently envisioned quantum comput-
1065 ing architectures are expected to serially perform in a year) through 264 logical gates (the approximate
1066 number of gates that current classical computing architectures can perform serially in a decade), to no
1067 more than 296 logical gates (the approximate number of gates that atomic scale qubits with speed-of-light
1068 propagation times could perform in a millennium). The most basic version of this cost metric ignores
1069 costs associated with physically moving bits or qubits so that they are physically close enough to per-
1070 form gate operations. This simplifcation may result in an underestimate of the cost of implementing
1071 memory-intensive computations on real hardware.
1072 The complexity of quantum attacks can then be measured in terms of circuit size. These numbers can be
1073 compared to the resources required to break AES and SHA-3. During the post-quantum standardization
1074 process, NIST gave the following estimates for the classical and quantum gate counts7 for the optimal
1075 key recovery and collision attacks on AES and SHA-3, respectively, where circuit depth is limited to
1076 MAXDEPTH.8
security analysis, but the above estimates may understate the security of SHA for very small values of MAXDEPTH
and may understate the quantum security of AES for very large values of MAXDEPTH.
42
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Table 4. Estimated gate counts for the optimal key recovery and collision attacks on AES
and SHA-3
1077 It is worth noting that the security categories based on these reference primitives provide substantially
1078 more quantum security than a naïve analysis might suggest. For example, categories 1, 3, and 5 are defned
1079 in terms of block ciphers, which can be broken using Grover’s algorithm [31] with a quadratic quantum
1080 speedup. However, Grover’s algorithm requires a long-running serial computation, which is diffcult to
1081 implement in practice. In a realistic attack, one has to run many smaller instances of the algorithm in
1082 parallel, which makes the quantum speedup less dramatic.
1083 Finally, for attacks that use a combination of classical and quantum computation, one may use a cost metric
1084 that rates logical quantum gates as being several orders of magnitude more expensive than classical gates.
1085 Presently envisioned quantum computing architectures typically indicate that the cost per quantum gate
1086 could be billions or trillions of times the cost per classical gate. However, especially when considering
1087 algorithms that claim a high security strength (e.g., equivalent to AES-256 or SHA-384), it is likely prudent
1088 to consider the possibility that this disparity will narrow signifcantly or even be eliminated.
43
FIPS 204 (D RAFT ) M ODULE -L ATTICE -B ASED D IGITAL S IGNATURE S TANDARD
Algorithm 37 Montgomery_Reduce(a)
Converts from Montgomery form to regular form.
Input: integer a with −231 q ≤ a ≤ 231 q.
Output: r ≡ a · 2−32 mod q such that −q < r < q.
1: QINV ← 58728449 ▷ the inverse of q modulo 232
2: t ← ((a mod 232 ) · QINV ) mod 232
3: r ← (a − t · q)/232
4: return r
1103 With this algorithm, the modular product of a and b is Montgomery_Reduce(a · b).
1104 Converting an integer modulo q to Montgomery form by multiplying by 232 modulo q is an expensive
1105 operation. When a sequence of modular operations is to be performed, as in Algorithms 35 and 36, the
1106 operands are converted once to Montgomery form, the operations are performed, and the factor 232 is
1107 extracted from the fnal results.
44