idnits 2.17.1 draft-ietf-lamps-cms-shakes-17.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The draft header indicates that this document updates RFC3370, but the abstract doesn't seem to directly say this. It does mention RFC3370 though, so this could be OK. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year (Using the creation date from RFC3370, updated by this document, for RFC5378 checks: 2001-04-25) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (August 8, 2019) is 1724 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Informational RFC: RFC 8017 -- Possible downref: Non-RFC (?) normative reference: ref. 'SHA3' -- Possible downref: Non-RFC (?) normative reference: ref. 'SP800-185' == Outdated reference: A later version (-02) exists of draft-housley-lamps-cms-sha3-hash-00 Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 LAMPS WG P. Kampanakis 3 Internet-Draft Cisco Systems 4 Updates: 3370 (if approved) Q. Dang 5 Intended status: Standards Track NIST 6 Expires: February 9, 2020 August 8, 2019 8 Use of the SHAKE One-way Hash Functions in the Cryptographic Message 9 Syntax (CMS) 10 draft-ietf-lamps-cms-shakes-17 12 Abstract 14 This document updates the "Cryptographic Message Syntax Algorithms" 15 (RFC3370) and describes the conventions for using the SHAKE family of 16 hash functions in the Cryptographic Message Syntax as one-way hash 17 functions with the RSA Probabilistic signature and ECDSA signature 18 algorithms. The conventions for the associated signer public keys in 19 CMS are also described. 21 Status of This Memo 23 This Internet-Draft is submitted in full conformance with the 24 provisions of BCP 78 and BCP 79. 26 Internet-Drafts are working documents of the Internet Engineering 27 Task Force (IETF). Note that other groups may also distribute 28 working documents as Internet-Drafts. The list of current Internet- 29 Drafts is at https://datatracker.ietf.org/drafts/current/. 31 Internet-Drafts are draft documents valid for a maximum of six months 32 and may be updated, replaced, or obsoleted by other documents at any 33 time. It is inappropriate to use Internet-Drafts as reference 34 material or to cite them other than as "work in progress." 36 This Internet-Draft will expire on February 9, 2020. 38 Copyright Notice 40 Copyright (c) 2019 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents 45 (https://trustee.ietf.org/license-info) in effect on the date of 46 publication of this document. Please review these documents 47 carefully, as they describe your rights and restrictions with respect 48 to this document. Code Components extracted from this document must 49 include Simplified BSD License text as described in Section 4.e of 50 the Trust Legal Provisions and are provided without warranty as 51 described in the Simplified BSD License. 53 Table of Contents 55 1. Change Log . . . . . . . . . . . . . . . . . . . . . . . . . 2 56 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5 57 2.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5 58 3. Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . 6 59 4. Use in CMS . . . . . . . . . . . . . . . . . . . . . . . . . 7 60 4.1. Message Digests . . . . . . . . . . . . . . . . . . . . . 7 61 4.2. Signatures . . . . . . . . . . . . . . . . . . . . . . . 8 62 4.2.1. RSASSA-PSS Signatures . . . . . . . . . . . . . . . . 8 63 4.2.2. ECDSA Signatures . . . . . . . . . . . . . . . . . . 9 64 4.3. Public Keys . . . . . . . . . . . . . . . . . . . . . . . 9 65 4.4. Message Authentication Codes . . . . . . . . . . . . . . 10 66 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 67 6. Security Considerations . . . . . . . . . . . . . . . . . . . 11 68 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 11 69 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 12 70 8.1. Normative References . . . . . . . . . . . . . . . . . . 12 71 8.2. Informative References . . . . . . . . . . . . . . . . . 13 72 Appendix A. ASN.1 Module . . . . . . . . . . . . . . . . . . . . 14 73 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 18 75 1. Change Log 77 [ EDNOTE: Remove this section before publication. ] 79 o draft-ietf-lamps-cms-shake-17: 81 * Minor updates for EDNOTE accuracy. 83 o draft-ietf-lamps-cms-shake-16: 85 * Minor nits. 87 * Using bytes instead of bits for consistency. 89 o draft-ietf-lamps-cms-shake-15: 91 * Minor editorial nits. 93 o draft-ietf-lamps-cms-shake-14: 95 * Fixing error with incorrect preimage resistance bits for SHA128 96 and SHA256. 98 o draft-ietf-lamps-cms-shake-13: 100 * Addressing comments from Dan M.'s secdir review. 102 * Addressing comment from Scott B.'s opsdir review about 103 references in the abstract. 105 o draft-ietf-lamps-cms-shake-12: 107 * Nits identified by Roman, Barry L. in ballot position review. 109 o draft-ietf-lamps-cms-shake-11: 111 * Minor nits. 113 * Nits identified by Roman in AD Review. 115 o draft-ietf-lamps-cms-shake-10: 117 * Updated IANA considerations section to request for OID 118 assignments. 120 o draft-ietf-lamps-cms-shake-09: 122 * Fixed minor text nit. 124 * Updates in Sec Considerations section. 126 o draft-ietf-lamps-cms-shake-08: 128 * id-shake128-len and id-shake256-len were replaced with id- 129 sha128 with 32 bytes output length and id-shake256 with 64 130 bytes output length. 132 * Fixed a discrepancy between section 3 and 4.4 about the KMAC 133 OIDs that have parameters as optional. 135 o draft-ietf-lamps-cms-shake-07: 137 * Small nit from Russ while in WGLC. 139 o draft-ietf-lamps-cms-shake-06: 141 * Incorporated Eric's suggestion from WGLC. 143 o draft-ietf-lamps-cms-shake-05: 145 * Added informative references. 147 * Updated ASN.1 so it compiles. 149 * Updated IANA considerations. 151 o draft-ietf-lamps-cms-shake-04: 153 * Added RFC8174 reference and text. 155 * Explicitly explained why RSASSA-PSS-params are omitted in 156 section 4.2.1. 158 * Simplified Public Keys section by removing redundant info from 159 RFCs. 161 o draft-ietf-lamps-cms-shake-03: 163 * Removed paragraph suggesting KMAC to be used in generating k in 164 Deterministic ECDSA. That should be RFC6979-bis. 166 * Removed paragraph from Security Considerations that talks about 167 randomness of k because we are using deterministic ECDSA. 169 * Completed ASN.1 module and fixed KMAC ASN.1 based on Jim's 170 feedback. 172 * Text fixes. 174 o draft-ietf-lamps-cms-shake-02: 176 * Updates based on suggestions and clarifications by Jim. 178 * Started ASN.1 module. 180 o draft-ietf-lamps-cms-shake-01: 182 * Significant reorganization of the sections to simplify the 183 introduction, the new OIDs and their use in CMS. 185 * Added new OIDs for RSASSA-PSS that hardcodes hash, salt and 186 MGF, according the WG consensus. 188 * Updated Public Key section to use the new RSASSA-PSS OIDs and 189 clarify the algorithm identifier usage. 191 * Removed the no longer used SHAKE OIDs from section 3.1. 193 o draft-ietf-lamps-cms-shake-00: 195 * Various updates to title and section names. 197 * Content changes filling in text and references. 199 o draft-dang-lamps-cms-shakes-hash-00: 201 * Initial version 203 2. Introduction 205 The "Cryptographic Message Syntax (CMS)" [RFC5652] is used to 206 digitally sign, digest, authenticate, or encrypt arbitrary message 207 contents. "Cryptographic Message Syntax (CMS) Algorithms" [RFC3370] 208 defines the use of common cryptographic algorithms with CMS. This 209 specification updates RFC3370 and describes the use of the SHAKE128 210 and SHAKE256 specified in [SHA3] as new hash functions in CMS. In 211 addition, it describes the use of these functions with the RSASSA-PSS 212 signature algorithm [RFC8017] and the Elliptic Curve Digital 213 Signature Algorithm (ECDSA) [X9.62] with the CMS signed-data content 214 type. 216 In the SHA-3 family, two extendable-output functions (SHAKEs), 217 SHAKE128 and SHAKE256, are defined. Four other hash function 218 instances, SHA3-224, SHA3-256, SHA3-384, and SHA3-512, are also 219 defined but are out of scope for this document. A SHAKE is a 220 variable length hash function defined as SHAKE(M, d) where the output 221 is a d-bits-long digest of message M. The corresponding collision 222 and second-preimage-resistance strengths for SHAKE128 are 223 min(d/2,128) and min(d,128) bits, respectively (Appendix A.1 [SHA3]). 224 And the corresponding collision and second-preimage-resistance 225 strengths for SHAKE256 are min(d/2,256) and min(d,256) bits, 226 respectively. In this specification we use d=256 (for SHAKE128) and 227 d=512 (for SHAKE256). 229 A SHAKE can be used in CMS as the message digest function (to hash 230 the message to be signed) in RSASSA-PSS and ECDSA, message 231 authentication code and as the mask generation function (MGF) in 232 RSASSA-PSS. This specification describes the identifiers for SHAKEs 233 to be used in CMS and their meaning. 235 2.1. Terminology 237 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 238 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 239 "OPTIONAL" in this document are to be interpreted as described in BCP 240 14 [RFC2119] [RFC8174] when, and only when, they appear in all 241 capitals, as shown here. 243 3. Identifiers 245 This section identifies eight new object identifiers (OIDs) for using 246 SHAKE128 and SHAKE256 in CMS. 248 Two object identifiers for SHAKE128 and SHAKE256 hash functions are 249 defined in [shake-nist-oids] and we include them here for 250 convenience. 252 id-shake128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 253 country(16) us(840) organization(1) gov(101) csor(3) 254 nistAlgorithm(4) 2 11 } 256 id-shake256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 257 country(16) us(840) organization(1) gov(101) csor(3) 258 nistAlgorithm(4) 2 12 } 260 In this specification, when using the id-shake128 or id-shake256 261 algorithm identifiers, the parameters MUST be absent. That is, the 262 identifier SHALL be a SEQUENCE of one component, the OID. 264 [I-D.ietf-lamps-pkix-shake] [ EDNOTE: Update reference with the RFC 265 when it is published. ] defines two identifiers for RSASSA-PSS 266 signatures using SHAKEs which we include here for convenience. [ 267 EDNOTE: Update the TBD1-2 reference when the RFC (ietf-lamps-pkix- 268 shake) is published. ] 270 id-RSASSA-PSS-SHAKE128 OBJECT IDENTIFIER ::= { iso(1) 271 identified-organization(3) dod(6) internet(1) 272 security(5) mechanisms(5) pkix(7) algorithms(6) 273 TBD1 } 275 id-RSASSA-PSS-SHAKE256 OBJECT IDENTIFIER ::= { iso(1) 276 identified-organization(3) dod(6) internet(1) 277 security(5) mechanisms(5) pkix(7) algorithms(6) 278 TBD2 } 280 The same RSASSA-PSS algorithm identifiers can be used for identifying 281 public keys and signatures. 283 [I-D.ietf-lamps-pkix-shake] [ EDNOTE: Update reference with the RFC 284 when it is published. ] also defines two algorithm identifiers of 285 ECDSA signatures using SHAKEs which we include here for convenience. 286 [ EDNOTE: Update the TBD3-4 reference when the RFC (ietf-lamps-pkix- 287 shake) is published. ] 288 id-ecdsa-with-shake128 OBJECT IDENTIFIER ::= { iso(1) 289 identified-organization(3) dod(6) internet(1) 290 security(5) mechanisms(5) pkix(7) algorithms(6) 291 TBD3 } 293 id-ecdsa-with-shake256 OBJECT IDENTIFIER ::= { iso(1) 294 identified-organization(3) dod(6) internet(1) 295 security(5) mechanisms(5) pkix(7) algorithms(6) 296 TBD4 } 298 The parameters for the four RSASSA-PSS and ECDSA identifiers MUST be 299 absent. That is, each identifier SHALL be a SEQUENCE of one 300 component, the OID. 302 Two object identifiers for KMACs using SHAKE128 and SHAKE256 as 303 defined in by the National Institute of Standards and Technology 304 (NIST) in [shake-nist-oids] and we include them here for convenience. 306 id-KmacWithSHAKE128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 307 country(16) us(840) organization(1) gov(101) csor(3) 308 nistAlgorithm(4) 2 19 } 310 id-KmacWithSHAKE256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 311 country(16) us(840) organization(1) gov(101) csor(3) 312 nistAlgorithm(4) 2 20 } 314 The parameters for id-KmacWithSHAKE128 and id-KmacWithSHAKE256 are 315 OPTIONAL. 317 Section 4.1, Section 4.2.1, Section 4.2.2 and Section 4.4 specify the 318 required output length for each use of SHAKE128 or SHAKE256 in 319 message digests, RSASSA-PSS, ECDSA and KMAC. 321 4. Use in CMS 323 4.1. Message Digests 325 The id-shake128 and id-shake256 OIDs (Section 3) can be used as the 326 digest algorithm identifiers located in the SignedData, SignerInfo, 327 DigestedData, and the AuthenticatedData digestAlgorithm fields in CMS 328 [RFC5652]. The OID encoding MUST omit the parameters field and the 329 output length of SHAKE128 or SHAKE256 as the message digest MUST be 330 32 or 64 bytes, respectively. 332 The digest values are located in the DigestedData field and the 333 Message Digest authenticated attribute included in the 334 signedAttributes of the SignedData signerInfo. In addition, digest 335 values are input to signature algorithms. The digest algorithm MUST 336 be the same as the message hash algorithms used in signatures. 338 4.2. Signatures 340 In CMS, signature algorithm identifiers are located in the SignerInfo 341 signatureAlgorithm field of SignedData content type and 342 countersignature attribute. Signature values are located in the 343 SignerInfo signature field of SignedData content type and 344 countersignature attribute. 346 Conforming implementations that process RSASSA-PSS and ECDSA with 347 SHAKE signatures when processing CMS data MUST recognize the 348 corresponding OIDs specified in Section 3. 350 When using RSASSA-PSS or ECDSA with SHAKEs, the RSA modulus or ECDSA 351 curve order SHOULD be chosen in line with the SHAKE output length. 352 Refer to Section 6 for more details. 354 4.2.1. RSASSA-PSS Signatures 356 The RSASSA-PSS algorithm is defined in [RFC8017]. When id-RSASSA- 357 PSS-SHAKE128 or id-RSASSA-PSS-SHAKE256 specified in Section 3 is 358 used, the encoding MUST omit the parameters field. That is, the 359 AlgorithmIdentifier SHALL be a SEQUENCE of one component, id-RSASSA- 360 PSS-SHAKE128 or id-RSASSA-PSS-SHAKE256. [RFC4055] defines RSASSA- 361 PSS-params that are used to define the algorithms and inputs to the 362 algorithm. This specification does not use parameters because the 363 hash, mask generation algorithm, trailer and salt are embedded in the 364 OID definition. 366 The hash algorithm to hash a message being signed and the hash 367 algorithm as the mask generation function used in RSASSA-PSS MUST be 368 the same: both SHAKE128 or both SHAKE256. The output length of the 369 hash algorithm which hashes the message SHALL be 32 (for SHAKE128) or 370 64 bytes (for SHAKE256). 372 The mask generation function takes an octet string of variable length 373 and a desired output length as input, and outputs an octet string of 374 the desired length. In RSASSA-PSS with SHAKEs, the SHAKEs MUST be 375 used natively as the MGF function, instead of the MGF1 algorithm that 376 uses the hash function in multiple iterations as specified in 377 Section B.2.1 of [RFC8017]. In other words, the MGF is defined as 378 the SHAKE128 or SHAKE256 with input being the mgfSeed for id-RSASSA- 379 PSS- SHAKE128 and id-RSASSA-PSS-SHAKE256, respectively. The mgfSeed 380 is the seed from which mask is generated, an octet string [RFC8017]. 381 As explained in Step 9 of section 9.1.1 of [RFC8017], the output 382 length of the MGF is emLen - hLen - 1 bytes. emLen is the maximum 383 message length ceil((n-1)/8), where n is the RSA modulus in bits. 384 hLen is 32 and 64-bytes for id-RSASSA-PSS-SHAKE128 and id-RSASSA-PSS- 385 SHAKE256, respectively. Thus when SHAKE is used as the MGF, the 386 SHAKE output length maskLen is (8*emLen - 264) or (8*emLen - 520) 387 bits, respectively. For example, when RSA modulus n is 2048, the 388 output length of SHAKE128 or SHAKE256 as the MGF will be 1784 or 389 1528-bits when id-RSASSA-PSS-SHAKE128 or id-RSASSA-PSS-SHAKE256 is 390 used, respectively. 392 The RSASSA-PSS saltLength MUST be 32 bytes for id-RSASSA-PSS-SHAKE128 393 or 64 bytes for id-RSASSA-PSS-SHAKE256. Finally, the trailerField 394 MUST be 1, which represents the trailer field with hexadecimal value 395 0xBC [RFC8017]. 397 4.2.2. ECDSA Signatures 399 The Elliptic Curve Digital Signature Algorithm (ECDSA) is defined in 400 [X9.62]. When the id-ecdsa-with-shake128 or id-ecdsa-with-shake256 401 (specified in Section 3) algorithm identifier appears, the respective 402 SHAKE function is used as the hash. The encoding MUST omit the 403 parameters field. That is, the AlgorithmIdentifier SHALL be a 404 SEQUENCE of one component, the OID id-ecdsa-with-shake128 or id- 405 ecdsa-with-shake256. 407 For simplicity and compliance with the ECDSA standard specification, 408 the output length of the hash function must be explicitly determined. 409 The output length for SHAKE128 or SHAKE256 used in ECDSA MUST be 32 410 or 64 bytes, respectively. 412 Conforming CA implementations that generate ECDSA with SHAKE 413 signatures in certificates or CRLs SHOULD generate such signatures 414 with a deterministically generated, non-random k in accordance with 415 all the requirements specified in [RFC6979]. They MAY also generate 416 such signatures in accordance with all other recommendations in 417 [X9.62] or [SEC1] if they have a stated policy that requires 418 conformance to those standards. Those standards have not specified 419 SHAKE128 and SHAKE256 as hash algorithm options. However, SHAKE128 420 and SHAKE256 with output length being 32 and 64 octets, respectively 421 can be used instead of 256 and 512-bit output hash algorithms such as 422 SHA256 and SHA512. 424 4.3. Public Keys 426 In CMS, the signer's public key algorithm identifiers are located in 427 the OriginatorPublicKey's algorithm attribute. The conventions and 428 encoding for RSASSA-PSS and ECDSA public keys algorithm identifiers 429 are as specified in Section 2.3 of [RFC3279], Section 3.1 of 430 [RFC4055] and Section 2.1 of [RFC5480]. 432 Traditionally, the rsaEncryption object identifier is used to 433 identify RSA public keys. The rsaEncryption object identifier 434 continues to identify the public key when the RSA private key owner 435 does not wish to limit the use of the public key exclusively to 436 RSASSA-PSS with SHAKEs. When the RSA private key owner wishes to 437 limit the use of the public key exclusively to RSASSA-PSS, the 438 AlgorithmIdentifier for RSASSA-PSS defined in Section 3 SHOULD be 439 used as the algorithm attribute in the OriginatorPublicKey sequence. 440 Conforming client implementations that process RSASSA-PSS with SHAKE 441 public keys in CMS message MUST recognize the corresponding OIDs in 442 Section 3. 444 Conforming implementations MUST specify and process the algorithms 445 explicitly by using the OIDs specified in Section 3 when encoding 446 ECDSA with SHAKE public keys in CMS messages. 448 The identifier parameters, as explained in Section 3, MUST be absent. 450 4.4. Message Authentication Codes 452 KMAC message authentication code (KMAC) is specified in [SP800-185]. 453 In CMS, KMAC algorithm identifiers are located in the 454 AuthenticatedData macAlgorithm field. The KMAC values are located in 455 the AuthenticatedData mac field. 457 When the id-KmacWithSHAKE128 or id-KmacWithSHAKE256 OID is used as 458 the MAC algorithm identifier, the parameters field is optional 459 (absent or present). If absent, the SHAKE256 output length used in 460 KMAC is 32 or 64 bytes, respectively, and the customization string is 461 an empty string by default. 463 Conforming implementations that process KMACs with the SHAKEs when 464 processing CMS data MUST recognize these identifiers. 466 When calculating the KMAC output, the variable N is 0xD2B282C2, S is 467 an empty string, and L, the integer representing the requested output 468 length in bits, is 256 or 512 for KmacWithSHAKE128 or 469 KmacWithSHAKE256, respectively, in this specification. 471 5. IANA Considerations 473 One object identifier for the ASN.1 module in Appendix A was 474 requested for the SMI Security for S/MIME Module Identifiers 475 (1.2.840.113549.1.9.16.0) registry: 477 +---------+----------------------+--------------------+ 478 | Decimal | Description | References | 479 +---------+----------------------+--------------------+ 480 | TBD | CMSAlgsForSHAKE-2019 | [EDNOTE: THIS RFC] | 481 +---------+----------------------+--------------------+ 483 6. Security Considerations 485 This document updates [RFC3370]. The security considerations section 486 of that document applies to this specification as well. 488 NIST has defined appropriate use of the hash functions in terms of 489 the algorithm strengths and expected time frames for secure use in 490 Special Publications (SPs) [SP800-78-4] and [SP800-107]. These 491 documents can be used as guides to choose appropriate key sizes for 492 various security scenarios. 494 SHAKE128 with output length of 32 bytes offers 128-bits of collision 495 and preimage resistance. Thus, SHAKE128 OIDs in this specification 496 are RECOMMENDED with 2048 (112-bit security) or 3072-bit (128-bit 497 security) RSA modulus or curves with group order of 256-bits (128-bit 498 security). SHAKE256 with 64 bytes output length offers 256-bits of 499 collision and preimage resistance. Thus, the SHAKE256 OIDs in this 500 specification are RECOMMENDED with 4096-bit RSA modulus or higher or 501 curves with group order of at least 512 bits such as NIST Curve P-521 502 (256-bit security). Note that we recommended 4096-bit RSA because we 503 would need 15360-bit modulus for 256-bits of security which is 504 impractical for today's technology. 506 When more than two parties share the same message-authentication key, 507 data origin authentication is not provided. Any party that knows the 508 message-authentication key can compute a valid MAC, therefore the 509 content could originate from any one of the parties. 511 7. Acknowledgements 513 This document is based on Russ Housley's draft 514 [I-D.housley-lamps-cms-sha3-hash]. It replaces SHA3 hash functions 515 by SHAKE128 and SHAKE256 as the LAMPS WG agreed. 517 The authors would like to thank Russ Housley for his guidance and 518 very valuable contributions with the ASN.1 module. Valuable feedback 519 was also provided by Eric Rescorla. 521 8. References 523 8.1. Normative References 525 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 526 Requirement Levels", BCP 14, RFC 2119, 527 DOI 10.17487/RFC2119, March 1997, 528 . 530 [RFC3370] Housley, R., "Cryptographic Message Syntax (CMS) 531 Algorithms", RFC 3370, DOI 10.17487/RFC3370, August 2002, 532 . 534 [RFC4055] Schaad, J., Kaliski, B., and R. Housley, "Additional 535 Algorithms and Identifiers for RSA Cryptography for use in 536 the Internet X.509 Public Key Infrastructure Certificate 537 and Certificate Revocation List (CRL) Profile", RFC 4055, 538 DOI 10.17487/RFC4055, June 2005, 539 . 541 [RFC5480] Turner, S., Brown, D., Yiu, K., Housley, R., and T. Polk, 542 "Elliptic Curve Cryptography Subject Public Key 543 Information", RFC 5480, DOI 10.17487/RFC5480, March 2009, 544 . 546 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 547 RFC 5652, DOI 10.17487/RFC5652, September 2009, 548 . 550 [RFC8017] Moriarty, K., Ed., Kaliski, B., Jonsson, J., and A. Rusch, 551 "PKCS #1: RSA Cryptography Specifications Version 2.2", 552 RFC 8017, DOI 10.17487/RFC8017, November 2016, 553 . 555 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 556 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 557 May 2017, . 559 [SHA3] National Institute of Standards and Technology, U.S. 560 Department of Commerce, "SHA-3 Standard - Permutation- 561 Based Hash and Extendable-Output Functions", FIPS PUB 202, 562 August 2015. 564 [SP800-185] 565 National Institute of Standards and Technology, "SHA-3 566 Derived Functions: cSHAKE, KMAC, TupleHash and 567 ParallelHash. NIST SP 800-185", December 2016, 568 . 571 8.2. Informative References 573 [I-D.housley-lamps-cms-sha3-hash] 574 Housley, R., "Use of the SHA3 One-way Hash Functions in 575 the Cryptographic Message Syntax (CMS)", draft-housley- 576 lamps-cms-sha3-hash-00 (work in progress), March 2017. 578 [I-D.ietf-lamps-pkix-shake] 579 Kampanakis, P. and Q. Dang, "Internet X.509 Public Key 580 Infrastructure: Additional Algorithm Identifiers for 581 RSASSA-PSS and ECDSA using SHAKEs", draft-ietf-lamps-pkix- 582 shake-15 (work in progress), July 2019. 584 [RFC3279] Bassham, L., Polk, W., and R. Housley, "Algorithms and 585 Identifiers for the Internet X.509 Public Key 586 Infrastructure Certificate and Certificate Revocation List 587 (CRL) Profile", RFC 3279, DOI 10.17487/RFC3279, April 588 2002, . 590 [RFC5753] Turner, S. and D. Brown, "Use of Elliptic Curve 591 Cryptography (ECC) Algorithms in Cryptographic Message 592 Syntax (CMS)", RFC 5753, DOI 10.17487/RFC5753, January 593 2010, . 595 [RFC5911] Hoffman, P. and J. Schaad, "New ASN.1 Modules for 596 Cryptographic Message Syntax (CMS) and S/MIME", RFC 5911, 597 DOI 10.17487/RFC5911, June 2010, 598 . 600 [RFC6268] Schaad, J. and S. Turner, "Additional New ASN.1 Modules 601 for the Cryptographic Message Syntax (CMS) and the Public 602 Key Infrastructure Using X.509 (PKIX)", RFC 6268, 603 DOI 10.17487/RFC6268, July 2011, 604 . 606 [RFC6979] Pornin, T., "Deterministic Usage of the Digital Signature 607 Algorithm (DSA) and Elliptic Curve Digital Signature 608 Algorithm (ECDSA)", RFC 6979, DOI 10.17487/RFC6979, August 609 2013, . 611 [SEC1] Standards for Efficient Cryptography Group, "SEC 1: 612 Elliptic Curve Cryptography", May 2009, 613 . 615 [shake-nist-oids] 616 National Institute of Standards and Technology, "Computer 617 Security Objects Register", October 2017, 618 . 621 [SP800-107] 622 National Institute of Standards and Technology (NIST), 623 "SP800-107: Recommendation for Applications Using Approved 624 Hash Algorithms", May 2014, 625 . 628 [SP800-78-4] 629 National Institute of Standards and Technology (NIST), 630 "SP800-78-4: Cryptographic Algorithms and Key Sizes for 631 Personal Identity Verification", May 2014, 632 . 635 [X9.62] American National Standard for Financial Services (ANSI), 636 "X9.62-2005 Public Key Cryptography for the Financial 637 Services Industry: The Elliptic Curve Digital Signature 638 Standard (ECDSA)", November 2005. 640 Appendix A. ASN.1 Module 642 This appendix includes the ASN.1 modules for SHAKEs in CMS. This 643 module includes some ASN.1 from other standards for reference. 645 CMSAlgsForSHAKE-2019 { iso(1) member-body(2) us(840) 646 rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) modules(0) 647 id-mod-cms-shakes-2019(TBD) } 649 DEFINITIONS EXPLICIT TAGS ::= 651 BEGIN 653 -- EXPORTS ALL; 655 IMPORTS 657 DIGEST-ALGORITHM, MAC-ALGORITHM, SMIME-CAPS 658 FROM AlgorithmInformation-2009 659 { iso(1) identified-organization(3) dod(6) internet(1) security(5) 660 mechanisms(5) pkix(7) id-mod(0) 661 id-mod-algorithmInformation-02(58) } 663 RSAPublicKey, rsaEncryption, id-ecPublicKey 664 FROM PKIXAlgs-2009 { iso(1) identified-organization(3) dod(6) 665 internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) 666 id-mod-pkix1-algorithms2008-02(56) } ; 668 -- 669 -- Message Digest Algorithms (mda-) 670 -- used in SignedData, SignerInfo, DigestedData, 671 -- and the AuthenticatedData digestAlgorithm 672 -- fields in CMS 673 -- 674 MessageDigestAlgs DIGEST-ALGORITHM ::= { 675 -- This expands MessageAuthAlgs from [RFC5652] 676 -- and MessageDigestAlgs in [RFC5753] 677 mda-shake128 | 678 mda-shake256, 679 ... 680 } 682 -- 683 -- One-Way Hash Functions 684 -- SHAKE128 685 mda-shake128 DIGEST-ALGORITHM ::= { 686 IDENTIFIER id-shake128 -- with output length 32 bytes. 687 } 688 id-shake128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) 689 us(840) organization(1) gov(101) 690 csor(3) nistAlgorithm(4) 691 hashAlgs(2) 11 } 693 -- SHAKE256 694 mda-shake256 DIGEST-ALGORITHM ::= { 695 IDENTIFIER id-shake256 -- with output length 64 bytes. 696 } 697 id-shake256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) 698 us(840) organization(1) gov(101) 699 csor(3) nistAlgorithm(4) 700 hashAlgs(2) 12 } 702 -- 703 -- Public key algorithm identifiers located in the 704 -- OriginatorPublicKey's algorithm attribute in CMS. 705 -- And Signature identifiers used in SignerInfo 706 -- signatureAlgorithm field of SignedData content 707 -- type and countersignature attribute in CMS. 708 -- 709 -- From RFC5280, for reference. 710 -- rsaEncryption OBJECT IDENTIFIER ::= { pkcs-1 1 } 711 -- When the rsaEncryption algorithm identifier is used 712 -- for a public key, the AlgorithmIdentifier parameters 713 -- field MUST contain NULL. 714 -- 715 id-RSASSA-PSS-SHAKE128 OBJECT IDENTIFIER ::= { iso(1) 716 identified-organization(3) dod(6) internet(1) 717 security(5) mechanisms(5) pkix(7) algorithms(6) 718 TBD1 } 719 id-RSASSA-PSS-SHAKE256 OBJECT IDENTIFIER ::= { iso(1) 720 identified-organization(3) dod(6) internet(1) 721 security(5) mechanisms(5) pkix(7) algorithms(6) 722 TBD2 } 723 -- When the id-RSASSA-PSS-* algorithm identifiers are used 724 -- for a public key or signature in CMS, the AlgorithmIdentifier 725 -- parameters field MUST be absent. The message digest algorithm 726 -- used in RSASSA-PSS MUST be SHAKE128 or SHAKE256 with a 32 or 727 -- 64 byte outout length, respectively. The mask generation 728 -- function MUST be SHAKE128 or SHAKE256 with an output length 729 -- of (8*ceil((n-1)/8) - 264) or (8*ceil((n-1)/8) - 520) bits, 730 -- respectively, where n is the RSA modulus in bits. 731 -- The RSASSA-PSS saltLength MUST be 32 or 64 bytes, respectively. 732 -- The trailerField MUST be 1, which represents the trailer 733 -- field with hexadecimal value 0xBC. Regardless of 734 -- id-RSASSA-PSS-* or rsaEncryption being used as the 735 -- AlgorithmIdentifier of the OriginatorPublicKey, the RSA 736 -- public key MUST be encoded using the RSAPublicKey type. 738 -- From RFC4055, for reference. 739 -- RSAPublicKey ::= SEQUENCE { 740 -- modulus INTEGER, -- -- n 741 -- publicExponent INTEGER } -- -- e 743 id-ecdsa-with-shake128 OBJECT IDENTIFIER ::= { iso(1) 744 identified-organization(3) dod(6) internet(1) 745 security(5) mechanisms(5) pkix(7) algorithms(6) 746 TBD3 } 747 id-ecdsa-with-shake256 OBJECT IDENTIFIER ::= { iso(1) 748 identified-organization(3) dod(6) internet(1) 749 security(5) mechanisms(5) pkix(7) algorithms(6) 750 TBD4 } 751 -- When the id-ecdsa-with-shake* algorithm identifiers are 752 -- used in CMS, the AlgorithmIdentifier parameters field 753 -- MUST be absent and the signature algorithm should be 754 -- deterministic ECDSA [RFC6979]. The message digest MUST 755 -- be SHAKE128 or SHAKE256 with a 32 or 64 byte outout 756 -- length, respectively. In both cases, the ECDSA public key, 757 -- MUST be encoded using the id-ecPublicKey type. 759 -- From RFC5480, for reference. 760 -- id-ecPublicKey OBJECT IDENTIFIER ::= { 761 -- iso(1) member-body(2) us(840) ansi-X9-62(10045) keyType(2) 1 } 762 -- The id-ecPublicKey parameters must be absent or present 763 -- and are defined as 764 -- ECParameters ::= CHOICE { 765 -- namedCurve OBJECT IDENTIFIER 766 -- -- -- implicitCurve NULL 767 -- -- -- specifiedCurve SpecifiedECDomain 768 -- } 770 -- 771 -- Message Authentication (maca-) Algorithms 772 -- used in AuthenticatedData macAlgorithm in CMS 773 -- 774 MessageAuthAlgs MAC-ALGORITHM ::= { 775 -- This expands MessageAuthAlgs from [RFC5652] and [RFC6268] 776 maca-KMACwithSHAKE128 | 777 maca-KMACwithSHAKE256, 778 ... 779 } 781 SMimeCaps SMIME-CAPS ::= { 782 -- The expands SMimeCaps from [RFC5911] 783 maca-KMACwithSHAKE128.&smimeCaps | 784 maca-KMACwithSHAKE256.&smimeCaps, 785 ... 786 } 788 -- 789 -- KMAC with SHAKE128 790 maca-KMACwithSHAKE128 MAC-ALGORITHM ::= { 791 IDENTIFIER id-KMACWithSHAKE128 792 PARAMS TYPE KMACwithSHAKE128-params ARE optional 793 -- If KMACwithSHAKE128-params parameters are absent 794 -- the SHAKE128 output length used in KMAC is 256 bits 795 -- and the customization string is an empty string. 796 IS-KEYED-MAC TRUE 797 SMIME-CAPS {IDENTIFIED BY id-KMACWithSHAKE128} 798 } 799 id-KMACWithSHAKE128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 800 country(16) us(840) organization(1) 801 gov(101) csor(3) nistAlgorithm(4) 802 hashAlgs(2) 19 } 804 KMACwithSHAKE128-params ::= SEQUENCE { 805 kMACOutputLength INTEGER DEFAULT 256, -- Output length in bits 806 customizationString OCTET STRING DEFAULT ''H 807 } 809 -- KMAC with SHAKE256 810 maca-KMACwithSHAKE256 MAC-ALGORITHM ::= { 811 IDENTIFIER id-KMACWithSHAKE256 812 PARAMS TYPE KMACwithSHAKE256-params ARE optional 813 -- If KMACwithSHAKE256-params parameters are absent 814 -- the SHAKE256 output length used in KMAC is 512 bits 815 -- and the customization string is an empty string. 816 IS-KEYED-MAC TRUE 817 SMIME-CAPS {IDENTIFIED BY id-KMACWithSHAKE256} 818 } 819 id-KMACWithSHAKE256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 820 country(16) us(840) organization(1) 821 gov(101) csor(3) nistAlgorithm(4) 822 hashAlgs(2) 20 } 823 KMACwithSHAKE256-params ::= SEQUENCE { 824 kMACOutputLength INTEGER DEFAULT 512, -- Output length in bits 825 customizationString OCTET STRING DEFAULT ''H 826 } 828 END 830 Authors' Addresses 832 Panos Kampanakis 833 Cisco Systems 835 Email: pkampana@cisco.com 837 Quynh Dang 838 NIST 839 100 Bureau Drive 840 Gaithersburg, MD 20899 842 Email: quynh.Dang@nist.gov