idnits 2.17.1 draft-ietf-lamps-cms-shakes-16.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 7, 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 8, 2020 August 7, 2019 8 Use of the SHAKE One-way Hash Functions in the Cryptographic Message 9 Syntax (CMS) 10 draft-ietf-lamps-cms-shakes-16 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 8, 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-16: 81 * Minor nits. 83 * Using bytes instead of bits for consistency. 85 o draft-ietf-lamps-cms-shake-15: 87 * Minor editorial nits. 89 o draft-ietf-lamps-cms-shake-14: 91 * Fixing error with incorrect preimage resistance bits for SHA128 92 and SHA256. 94 o draft-ietf-lamps-cms-shake-13: 96 * Addressing comments from Dan M.'s secdir review. 98 * Addressing comment from Scott B.'s opsdir review about 99 references in the abstract. 101 o draft-ietf-lamps-cms-shake-12: 103 * Nits identified by Roman, Barry L. in ballot position review. 105 o draft-ietf-lamps-cms-shake-11: 107 * Minor nits. 109 * Nits identified by Roman in AD Review. 111 o draft-ietf-lamps-cms-shake-10: 113 * Updated IANA considerations section to request for OID 114 assignments. 116 o draft-ietf-lamps-cms-shake-09: 118 * Fixed minor text nit. 120 * Updates in Sec Considerations section. 122 o draft-ietf-lamps-cms-shake-08: 124 * id-shake128-len and id-shake256-len were replaced with id- 125 sha128 with 32 bytes output length and id-shake256 with 64 126 bytes output length. 128 * Fixed a discrepancy between section 3 and 4.4 about the KMAC 129 OIDs that have parameters as optional. 131 o draft-ietf-lamps-cms-shake-07: 133 * Small nit from Russ while in WGLC. 135 o draft-ietf-lamps-cms-shake-06: 137 * Incorporated Eric's suggestion from WGLC. 139 o draft-ietf-lamps-cms-shake-05: 141 * Added informative references. 143 * Updated ASN.1 so it compiles. 145 * Updated IANA considerations. 147 o draft-ietf-lamps-cms-shake-04: 149 * Added RFC8174 reference and text. 151 * Explicitly explained why RSASSA-PSS-params are omitted in 152 section 4.2.1. 154 * Simplified Public Keys section by removing redundant info from 155 RFCs. 157 o draft-ietf-lamps-cms-shake-03: 159 * Removed paragraph suggesting KMAC to be used in generating k in 160 Deterministic ECDSA. That should be RFC6979-bis. 162 * Removed paragraph from Security Considerations that talks about 163 randomness of k because we are using deterministic ECDSA. 165 * Completed ASN.1 module and fixed KMAC ASN.1 based on Jim's 166 feedback. 168 * Text fixes. 170 o draft-ietf-lamps-cms-shake-02: 172 * Updates based on suggestions and clarifications by Jim. 174 * Started ASN.1 module. 176 o draft-ietf-lamps-cms-shake-01: 178 * Significant reorganization of the sections to simplify the 179 introduction, the new OIDs and their use in CMS. 181 * Added new OIDs for RSASSA-PSS that hardcodes hash, salt and 182 MGF, according the WG consensus. 184 * Updated Public Key section to use the new RSASSA-PSS OIDs and 185 clarify the algorithm identifier usage. 187 * Removed the no longer used SHAKE OIDs from section 3.1. 189 o draft-ietf-lamps-cms-shake-00: 191 * Various updates to title and section names. 193 * Content changes filling in text and references. 195 o draft-dang-lamps-cms-shakes-hash-00: 197 * Initial version 199 2. Introduction 201 The "Cryptographic Message Syntax (CMS)" [RFC5652] is used to 202 digitally sign, digest, authenticate, or encrypt arbitrary message 203 contents. "Cryptographic Message Syntax (CMS) Algorithms" [RFC3370] 204 defines the use of common cryptographic algorithms with CMS. This 205 specification updates RFC3370 and describes the use of the SHAKE128 206 and SHAKE256 specified in [SHA3] as new hash functions in CMS. In 207 addition, it describes the use of these functions with the RSASSA-PSS 208 signature algorithm [RFC8017] and the Elliptic Curve Digital 209 Signature Algorithm (ECDSA) [X9.62] with the CMS signed-data content 210 type. 212 In the SHA-3 family, two extendable-output functions (SHAKEs), 213 SHAKE128 and SHAKE256, are defined. Four other hash function 214 instances, SHA3-224, SHA3-256, SHA3-384, and SHA3-512, are also 215 defined but are out of scope for this document. A SHAKE is a 216 variable length hash function defined as SHAKE(M, d) where the output 217 is a d-bits-long digest of message M. The corresponding collision 218 and second-preimage-resistance strengths for SHAKE128 are 219 min(d/2,128) and min(d,128) bits, respectively (Appendix A.1 [SHA3]). 220 And the corresponding collision and second-preimage-resistance 221 strengths for SHAKE256 are min(d/2,256) and min(d,256) bits, 222 respectively. In this specification we use d=256 (for SHAKE128) and 223 d=512 (for SHAKE256). 225 A SHAKE can be used in CMS as the message digest function (to hash 226 the message to be signed) in RSASSA-PSS and ECDSA, message 227 authentication code and as the mask generation function (MGF) in 228 RSASSA-PSS. This specification describes the identifiers for SHAKEs 229 to be used in CMS and their meaning. 231 2.1. Terminology 233 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 234 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 235 "OPTIONAL" in this document are to be interpreted as described in BCP 236 14 [RFC2119] [RFC8174] when, and only when, they appear in all 237 capitals, as shown here. 239 3. Identifiers 241 This section identifies eight new object identifiers (OIDs) for using 242 SHAKE128 and SHAKE256 in CMS. 244 Two object identifiers for SHAKE128 and SHAKE256 hash functions are 245 defined in [shake-nist-oids] and we include them here for 246 convenience. 248 id-shake128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 249 country(16) us(840) organization(1) gov(101) csor(3) 250 nistAlgorithm(4) 2 11 } 252 id-shake256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 253 country(16) us(840) organization(1) gov(101) csor(3) 254 nistAlgorithm(4) 2 12 } 256 In this specification, when using the id-shake128 or id-shake256 257 algorithm identifiers, the parameters MUST be absent. That is, the 258 identifier SHALL be a SEQUENCE of one component, the OID. 260 [I-D.ietf-lamps-pkix-shake] [ EDNOTE: Update reference with the RFC 261 when it is ready ] defines two identifiers for RSASSA-PSS signatures 262 using SHAKEs which we include here for convenience. 264 id-RSASSA-PSS-SHAKE128 OBJECT IDENTIFIER ::= { iso(1) 265 identified-organization(3) dod(6) internet(1) 266 security(5) mechanisms(5) pkix(7) algorithms(6) 267 TBD1 } 269 id-RSASSA-PSS-SHAKE256 OBJECT IDENTIFIER ::= { iso(1) 270 identified-organization(3) dod(6) internet(1) 271 security(5) mechanisms(5) pkix(7) algorithms(6) 272 TBD2 } 274 The same RSASSA-PSS algorithm identifiers can be used for identifying 275 public keys and signatures. 277 [I-D.ietf-lamps-pkix-shake] [ EDNOTE: Update reference with the RFC 278 when it is ready ] also defines two algorithm identifiers of ECDSA 279 signatures using SHAKEs which we include here for convenience. 281 id-ecdsa-with-shake128 OBJECT IDENTIFIER ::= { iso(1) 282 identified-organization(3) dod(6) internet(1) 283 security(5) mechanisms(5) pkix(7) algorithms(6) 284 TBD3 } 286 id-ecdsa-with-shake256 OBJECT IDENTIFIER ::= { iso(1) 287 identified-organization(3) dod(6) internet(1) 288 security(5) mechanisms(5) pkix(7) algorithms(6) 289 TBD4 } 291 The parameters for the four RSASSA-PSS and ECDSA identifiers MUST be 292 absent. That is, each identifier SHALL be a SEQUENCE of one 293 component, the OID. 295 Two object identifiers for KMACs using SHAKE128 and SHAKE256 as 296 defined in by the National Institute of Standards and Technology 297 (NIST) in [shake-nist-oids] [EDNOTE: Make sure NIST has published 298 these. ] and we include them here for convenience. 300 id-KmacWithSHAKE128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 301 country(16) us(840) organization(1) gov(101) csor(3) 302 nistAlgorithm(4) 2 19 } 304 id-KmacWithSHAKE256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 305 country(16) us(840) organization(1) gov(101) csor(3) 306 nistAlgorithm(4) 2 20 } 308 The parameters for id-KmacWithSHAKE128 and id-KmacWithSHAKE256 are 309 OPTIONAL. 311 Section 4.1, Section 4.2.1, Section 4.2.2 and Section 4.4 specify the 312 required output length for each use of SHAKE128 or SHAKE256 in 313 message digests, RSASSA-PSS, ECDSA and KMAC. 315 4. Use in CMS 317 4.1. Message Digests 319 The id-shake128 and id-shake256 OIDs (Section 3) can be used as the 320 digest algorithm identifiers located in the SignedData, SignerInfo, 321 DigestedData, and the AuthenticatedData digestAlgorithm fields in CMS 322 [RFC5652]. The OID encoding MUST omit the parameters field and the 323 output length of SHAKE128 or SHAKE256 as the message digest MUST be 324 32 or 64 bytes, respectively. 326 The digest values are located in the DigestedData field and the 327 Message Digest authenticated attribute included in the 328 signedAttributes of the SignedData signerInfo. In addition, digest 329 values are input to signature algorithms. The digest algorithm MUST 330 be the same as the message hash algorithms used in signatures. 332 4.2. Signatures 334 In CMS, signature algorithm identifiers are located in the SignerInfo 335 signatureAlgorithm field of SignedData content type and 336 countersignature attribute. Signature values are located in the 337 SignerInfo signature field of SignedData content type and 338 countersignature attribute. 340 Conforming implementations that process RSASSA-PSS and ECDSA with 341 SHAKE signatures when processing CMS data MUST recognize the 342 corresponding OIDs specified in Section 3. 344 When using RSASSA-PSS or ECDSA with SHAKEs, the RSA modulus or ECDSA 345 curve order SHOULD be chosen in line with the SHAKE output length. 346 Refer to Section 6 for more details. 348 4.2.1. RSASSA-PSS Signatures 350 The RSASSA-PSS algorithm is defined in [RFC8017]. When id-RSASSA- 351 PSS-SHAKE128 or id-RSASSA-PSS-SHAKE256 specified in Section 3 is 352 used, the encoding MUST omit the parameters field. That is, the 353 AlgorithmIdentifier SHALL be a SEQUENCE of one component, id-RSASSA- 354 PSS-SHAKE128 or id-RSASSA-PSS-SHAKE256. [RFC4055] defines RSASSA- 355 PSS-params that are used to define the algorithms and inputs to the 356 algorithm. This specification does not use parameters because the 357 hash, mask generation algorithm, trailer and salt are embedded in the 358 OID definition. 360 The hash algorithm to hash a message being signed and the hash 361 algorithm as the mask generation function used in RSASSA-PSS MUST be 362 the same: both SHAKE128 or both SHAKE256. The output length of the 363 hash algorithm which hashes the message SHALL be 32 (for SHAKE128) or 364 64 bytes (for SHAKE256). 366 The mask generation function takes an octet string of variable length 367 and a desired output length as input, and outputs an octet string of 368 the desired length. In RSASSA-PSS with SHAKEs, the SHAKEs MUST be 369 used natively as the MGF function, instead of the MGF1 algorithm that 370 uses the hash function in multiple iterations as specified in 371 Section B.2.1 of [RFC8017]. In other words, the MGF is defined as 372 the SHAKE128 or SHAKE256 with input being the mgfSeed for id-RSASSA- 373 PSS- SHAKE128 and id-RSASSA-PSS-SHAKE256, respectively. The mgfSeed 374 is the seed from which mask is generated, an octet string [RFC8017]. 375 As explained in Step 9 of section 9.1.1 of [RFC8017], the output 376 length of the MGF is emLen - hLen - 1 bytes. emLen is the maximum 377 message length ceil((n-1)/8), where n is the RSA modulus in bits. 378 hLen is 32 and 64-bytes for id-RSASSA-PSS-SHAKE128 and id-RSASSA-PSS- 379 SHAKE256, respectively. Thus when SHAKE is used as the MGF, the 380 SHAKE output length maskLen is (8*emLen - 264) or (8*emLen - 520) 381 bits, respectively. For example, when RSA modulus n is 2048, the 382 output length of SHAKE128 or SHAKE256 as the MGF will be 1784 or 383 1528-bits when id-RSASSA-PSS-SHAKE128 or id-RSASSA-PSS-SHAKE256 is 384 used, respectively. 386 The RSASSA-PSS saltLength MUST be 32 bytes for id-RSASSA-PSS-SHAKE128 387 or 64 bytes for id-RSASSA-PSS-SHAKE256. Finally, the trailerField 388 MUST be 1, which represents the trailer field with hexadecimal value 389 0xBC [RFC8017]. 391 4.2.2. ECDSA Signatures 393 The Elliptic Curve Digital Signature Algorithm (ECDSA) is defined in 394 [X9.62]. When the id-ecdsa-with-shake128 or id-ecdsa-with-shake256 395 (specified in Section 3) algorithm identifier appears, the respective 396 SHAKE function is used as the hash. The encoding MUST omit the 397 parameters field. That is, the AlgorithmIdentifier SHALL be a 398 SEQUENCE of one component, the OID id-ecdsa-with-shake128 or id- 399 ecdsa-with-shake256. 401 For simplicity and compliance with the ECDSA standard specification, 402 the output length of the hash function must be explicitly determined. 403 The output length for SHAKE128 or SHAKE256 used in ECDSA MUST be 32 404 or 64 bytes, respectively. 406 Conforming CA implementations that generate ECDSA with SHAKE 407 signatures in certificates or CRLs SHOULD generate such signatures 408 with a deterministically generated, non-random k in accordance with 409 all the requirements specified in [RFC6979]. They MAY also generate 410 such signatures in accordance with all other recommendations in 411 [X9.62] or [SEC1] if they have a stated policy that requires 412 conformance to those standards. Those standards have not specified 413 SHAKE128 and SHAKE256 as hash algorithm options. However, SHAKE128 414 and SHAKE256 with output length being 32 and 64 octets, respectively 415 can be used instead of 256 and 512-bit output hash algorithms such as 416 SHA256 and SHA512. 418 4.3. Public Keys 420 In CMS, the signer's public key algorithm identifiers are located in 421 the OriginatorPublicKey's algorithm attribute. The conventions and 422 encoding for RSASSA-PSS and ECDSA public keys algorithm identifiers 423 are as specified in Section 2.3 of [RFC3279], Section 3.1 of 424 [RFC4055] and Section 2.1 of [RFC5480]. 426 Traditionally, the rsaEncryption object identifier is used to 427 identify RSA public keys. The rsaEncryption object identifier 428 continues to identify the public key when the RSA private key owner 429 does not wish to limit the use of the public key exclusively to 430 RSASSA-PSS with SHAKEs. When the RSA private key owner wishes to 431 limit the use of the public key exclusively to RSASSA-PSS, the 432 AlgorithmIdentifier for RSASSA-PSS defined in Section 3 SHOULD be 433 used as the algorithm attribute in the OriginatorPublicKey sequence. 434 Conforming client implementations that process RSASSA-PSS with SHAKE 435 public keys in CMS message MUST recognize the corresponding OIDs in 436 Section 3. 438 Conforming implementations MUST specify and process the algorithms 439 explicitly by using the OIDs specified in Section 3 when encoding 440 ECDSA with SHAKE public keys in CMS messages. 442 The identifier parameters, as explained in Section 3, MUST be absent. 444 4.4. Message Authentication Codes 446 KMAC message authentication code (KMAC) is specified in [SP800-185]. 447 In CMS, KMAC algorithm identifiers are located in the 448 AuthenticatedData macAlgorithm field. The KMAC values are located in 449 the AuthenticatedData mac field. 451 When the id-KmacWithSHAKE128 or id-KmacWithSHAKE256 OID is used as 452 the MAC algorithm identifier, the parameters field is optional 453 (absent or present). If absent, the SHAKE256 output length used in 454 KMAC is 32 or 64 bytes, respectively, and the customization string is 455 an empty string by default. 457 Conforming implementations that process KMACs with the SHAKEs when 458 processing CMS data MUST recognize these identifiers. 460 When calculating the KMAC output, the variable N is 0xD2B282C2, S is 461 an empty string, and L, the integer representing the requested output 462 length in bits, is 256 or 512 for KmacWithSHAKE128 or 463 KmacWithSHAKE256, respectively, in this specification. 465 5. IANA Considerations 467 One object identifier for the ASN.1 module in Appendix A was 468 requested for the SMI Security for S/MIME Module Identifiers 469 (1.2.840.113549.1.9.16.0) registry: 471 +---------+----------------------+--------------------+ 472 | Decimal | Description | References | 473 +---------+----------------------+--------------------+ 474 | TBD | CMSAlgsForSHAKE-2019 | [EDNOTE: THIS RFC] | 475 +---------+----------------------+--------------------+ 477 6. Security Considerations 479 This document updates [RFC3370]. The security considerations section 480 of that document applies to this specification as well. 482 NIST has defined appropriate use of the hash functions in terms of 483 the algorithm strengths and expected time frames for secure use in 484 Special Publications (SPs) [SP800-78-4] and [SP800-107]. These 485 documents can be used as guides to choose appropriate key sizes for 486 various security scenarios. 488 SHAKE128 with output length of 32 bytes offers 128-bits of collision 489 and preimage resistance. Thus, SHAKE128 OIDs in this specification 490 are RECOMMENDED with 2048 (112-bit security) or 3072-bit (128-bit 491 security) RSA modulus or curves with group order of 256-bits (128-bit 492 security). SHAKE256 with 64 bytes output length offers 256-bits of 493 collision and preimage resistance. Thus, the SHAKE256 OIDs in this 494 specification are RECOMMENDED with 4096-bit RSA modulus or higher or 495 curves with group order of at least 512 bits such as NIST Curve P-521 496 (256-bit security). Note that we recommended 4096-bit RSA because we 497 would need 15360-bit modulus for 256-bits of security which is 498 impractical for today's technology. 500 When more than two parties share the same message-authentication key, 501 data origin authentication is not provided. Any party that knows the 502 message-authentication key can compute a valid MAC, therefore the 503 content could originate from any one of the parties. 505 7. Acknowledgements 507 This document is based on Russ Housley's draft 508 [I-D.housley-lamps-cms-sha3-hash]. It replaces SHA3 hash functions 509 by SHAKE128 and SHAKE256 as the LAMPS WG agreed. 511 The authors would like to thank Russ Housley for his guidance and 512 very valuable contributions with the ASN.1 module. Valuable feedback 513 was also provided by Eric Rescorla. 515 8. References 517 8.1. Normative References 519 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 520 Requirement Levels", BCP 14, RFC 2119, 521 DOI 10.17487/RFC2119, March 1997, 522 . 524 [RFC3370] Housley, R., "Cryptographic Message Syntax (CMS) 525 Algorithms", RFC 3370, DOI 10.17487/RFC3370, August 2002, 526 . 528 [RFC4055] Schaad, J., Kaliski, B., and R. Housley, "Additional 529 Algorithms and Identifiers for RSA Cryptography for use in 530 the Internet X.509 Public Key Infrastructure Certificate 531 and Certificate Revocation List (CRL) Profile", RFC 4055, 532 DOI 10.17487/RFC4055, June 2005, 533 . 535 [RFC5480] Turner, S., Brown, D., Yiu, K., Housley, R., and T. Polk, 536 "Elliptic Curve Cryptography Subject Public Key 537 Information", RFC 5480, DOI 10.17487/RFC5480, March 2009, 538 . 540 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 541 RFC 5652, DOI 10.17487/RFC5652, September 2009, 542 . 544 [RFC8017] Moriarty, K., Ed., Kaliski, B., Jonsson, J., and A. Rusch, 545 "PKCS #1: RSA Cryptography Specifications Version 2.2", 546 RFC 8017, DOI 10.17487/RFC8017, November 2016, 547 . 549 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 550 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 551 May 2017, . 553 [SHA3] National Institute of Standards and Technology, U.S. 554 Department of Commerce, "SHA-3 Standard - Permutation- 555 Based Hash and Extendable-Output Functions", FIPS PUB 202, 556 August 2015. 558 [SP800-185] 559 National Institute of Standards and Technology, "SHA-3 560 Derived Functions: cSHAKE, KMAC, TupleHash and 561 ParallelHash. NIST SP 800-185", December 2016, 562 . 565 8.2. Informative References 567 [I-D.housley-lamps-cms-sha3-hash] 568 Housley, R., "Use of the SHA3 One-way Hash Functions in 569 the Cryptographic Message Syntax (CMS)", draft-housley- 570 lamps-cms-sha3-hash-00 (work in progress), March 2017. 572 [I-D.ietf-lamps-pkix-shake] 573 Kampanakis, P. and Q. Dang, "Internet X.509 Public Key 574 Infrastructure: Additional Algorithm Identifiers for 575 RSASSA-PSS and ECDSA using SHAKEs", draft-ietf-lamps-pkix- 576 shake-15 (work in progress), July 2019. 578 [RFC3279] Bassham, L., Polk, W., and R. Housley, "Algorithms and 579 Identifiers for the Internet X.509 Public Key 580 Infrastructure Certificate and Certificate Revocation List 581 (CRL) Profile", RFC 3279, DOI 10.17487/RFC3279, April 582 2002, . 584 [RFC5753] Turner, S. and D. Brown, "Use of Elliptic Curve 585 Cryptography (ECC) Algorithms in Cryptographic Message 586 Syntax (CMS)", RFC 5753, DOI 10.17487/RFC5753, January 587 2010, . 589 [RFC5911] Hoffman, P. and J. Schaad, "New ASN.1 Modules for 590 Cryptographic Message Syntax (CMS) and S/MIME", RFC 5911, 591 DOI 10.17487/RFC5911, June 2010, 592 . 594 [RFC6268] Schaad, J. and S. Turner, "Additional New ASN.1 Modules 595 for the Cryptographic Message Syntax (CMS) and the Public 596 Key Infrastructure Using X.509 (PKIX)", RFC 6268, 597 DOI 10.17487/RFC6268, July 2011, 598 . 600 [RFC6979] Pornin, T., "Deterministic Usage of the Digital Signature 601 Algorithm (DSA) and Elliptic Curve Digital Signature 602 Algorithm (ECDSA)", RFC 6979, DOI 10.17487/RFC6979, August 603 2013, . 605 [SEC1] Standards for Efficient Cryptography Group, "SEC 1: 606 Elliptic Curve Cryptography", May 2009, 607 . 609 [shake-nist-oids] 610 National Institute of Standards and Technology, "Computer 611 Security Objects Register", October 2017, 612 . 615 [SP800-107] 616 National Institute of Standards and Technology (NIST), 617 "SP800-107: Recommendation for Applications Using Approved 618 Hash Algorithms", May 2014, 619 . 622 [SP800-78-4] 623 National Institute of Standards and Technology (NIST), 624 "SP800-78-4: Cryptographic Algorithms and Key Sizes for 625 Personal Identity Verification", May 2014, 626 . 629 [X9.62] American National Standard for Financial Services (ANSI), 630 "X9.62-2005 Public Key Cryptography for the Financial 631 Services Industry: The Elliptic Curve Digital Signature 632 Standard (ECDSA)", November 2005. 634 Appendix A. ASN.1 Module 636 This appendix includes the ASN.1 modules for SHAKEs in CMS. This 637 module includes some ASN.1 from other standards for reference. 639 CMSAlgsForSHAKE-2019 { iso(1) member-body(2) us(840) 640 rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) modules(0) 641 id-mod-cms-shakes-2019(TBD) } 643 DEFINITIONS EXPLICIT TAGS ::= 645 BEGIN 647 -- EXPORTS ALL; 649 IMPORTS 651 DIGEST-ALGORITHM, MAC-ALGORITHM, SMIME-CAPS 652 FROM AlgorithmInformation-2009 653 { iso(1) identified-organization(3) dod(6) internet(1) security(5) 654 mechanisms(5) pkix(7) id-mod(0) 655 id-mod-algorithmInformation-02(58) } 657 RSAPublicKey, rsaEncryption, id-ecPublicKey 658 FROM PKIXAlgs-2009 { iso(1) identified-organization(3) dod(6) 659 internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) 660 id-mod-pkix1-algorithms2008-02(56) } ; 662 -- 663 -- Message Digest Algorithms (mda-) 664 -- used in SignedData, SignerInfo, DigestedData, 665 -- and the AuthenticatedData digestAlgorithm 666 -- fields in CMS 667 -- 668 MessageDigestAlgs DIGEST-ALGORITHM ::= { 669 -- This expands MessageAuthAlgs from [RFC5652] 670 -- and MessageDigestAlgs in [RFC5753] 671 mda-shake128 | 672 mda-shake256, 673 ... 674 } 676 -- 677 -- One-Way Hash Functions 678 -- SHAKE128 679 mda-shake128 DIGEST-ALGORITHM ::= { 680 IDENTIFIER id-shake128 -- with output length 32 bytes. 681 } 682 id-shake128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) 683 us(840) organization(1) gov(101) 684 csor(3) nistAlgorithm(4) 685 hashAlgs(2) 11 } 687 -- SHAKE256 688 mda-shake256 DIGEST-ALGORITHM ::= { 689 IDENTIFIER id-shake256 -- with output length 64 bytes. 690 } 691 id-shake256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) 692 us(840) organization(1) gov(101) 693 csor(3) nistAlgorithm(4) 694 hashAlgs(2) 12 } 696 -- 697 -- Public key algorithm identifiers located in the 698 -- OriginatorPublicKey's algorithm attribute in CMS. 699 -- And Signature identifiers used in SignerInfo 700 -- signatureAlgorithm field of SignedData content 701 -- type and countersignature attribute in CMS. 702 -- 703 -- From RFC5280, for reference. 704 -- rsaEncryption OBJECT IDENTIFIER ::= { pkcs-1 1 } 705 -- When the rsaEncryption algorithm identifier is used 706 -- for a public key, the AlgorithmIdentifier parameters 707 -- field MUST contain NULL. 708 -- 709 id-RSASSA-PSS-SHAKE128 OBJECT IDENTIFIER ::= { iso(1) 710 identified-organization(3) dod(6) internet(1) 711 security(5) mechanisms(5) pkix(7) algorithms(6) 712 TBD1 } 713 id-RSASSA-PSS-SHAKE256 OBJECT IDENTIFIER ::= { iso(1) 714 identified-organization(3) dod(6) internet(1) 715 security(5) mechanisms(5) pkix(7) algorithms(6) 716 TBD2 } 717 -- When the id-RSASSA-PSS-* algorithm identifiers are used 718 -- for a public key or signature in CMS, the AlgorithmIdentifier 719 -- parameters field MUST be absent. The message digest algorithm 720 -- used in RSASSA-PSS MUST be SHAKE128 or SHAKE256 with a 32 or 721 -- 64 byte outout length, respectively. The mask generation 722 -- function MUST be SHAKE128 or SHAKE256 with an output length 723 -- of (8*ceil((n-1)/8) - 264) or (8*ceil((n-1)/8) - 520) bits, 724 -- respectively, where n is the RSA modulus in bits. 725 -- The RSASSA-PSS saltLength MUST be 32 or 64 bytes, respectively. 726 -- The trailerField MUST be 1, which represents the trailer 727 -- field with hexadecimal value 0xBC. Regardless of 728 -- id-RSASSA-PSS-* or rsaEncryption being used as the 729 -- AlgorithmIdentifier of the OriginatorPublicKey, the RSA 730 -- public key MUST be encoded using the RSAPublicKey type. 732 -- From RFC4055, for reference. 733 -- RSAPublicKey ::= SEQUENCE { 734 -- modulus INTEGER, -- -- n 735 -- publicExponent INTEGER } -- -- e 737 id-ecdsa-with-shake128 OBJECT IDENTIFIER ::= { iso(1) 738 identified-organization(3) dod(6) internet(1) 739 security(5) mechanisms(5) pkix(7) algorithms(6) 740 TBD3 } 741 id-ecdsa-with-shake256 OBJECT IDENTIFIER ::= { iso(1) 742 identified-organization(3) dod(6) internet(1) 743 security(5) mechanisms(5) pkix(7) algorithms(6) 744 TBD4 } 745 -- When the id-ecdsa-with-shake* algorithm identifiers are 746 -- used in CMS, the AlgorithmIdentifier parameters field 747 -- MUST be absent and the signature algorithm should be 748 -- deterministic ECDSA [RFC6979]. The message digest MUST 749 -- be SHAKE128 or SHAKE256 with a 32 or 64 byte outout 750 -- length, respectively. In both cases, the ECDSA public key, 751 -- MUST be encoded using the id-ecPublicKey type. 753 -- From RFC5480, for reference. 754 -- id-ecPublicKey OBJECT IDENTIFIER ::= { 755 -- iso(1) member-body(2) us(840) ansi-X9-62(10045) keyType(2) 1 } 756 -- The id-ecPublicKey parameters must be absent or present 757 -- and are defined as 758 -- ECParameters ::= CHOICE { 759 -- namedCurve OBJECT IDENTIFIER 760 -- -- -- implicitCurve NULL 761 -- -- -- specifiedCurve SpecifiedECDomain 762 -- } 764 -- 765 -- Message Authentication (maca-) Algorithms 766 -- used in AuthenticatedData macAlgorithm in CMS 767 -- 768 MessageAuthAlgs MAC-ALGORITHM ::= { 769 -- This expands MessageAuthAlgs from [RFC5652] and [RFC6268] 770 maca-KMACwithSHAKE128 | 771 maca-KMACwithSHAKE256, 772 ... 773 } 775 SMimeCaps SMIME-CAPS ::= { 776 -- The expands SMimeCaps from [RFC5911] 777 maca-KMACwithSHAKE128.&smimeCaps | 778 maca-KMACwithSHAKE256.&smimeCaps, 779 ... 780 } 782 -- 783 -- KMAC with SHAKE128 784 maca-KMACwithSHAKE128 MAC-ALGORITHM ::= { 785 IDENTIFIER id-KMACWithSHAKE128 786 PARAMS TYPE KMACwithSHAKE128-params ARE optional 787 -- If KMACwithSHAKE128-params parameters are absent 788 -- the SHAKE128 output length used in KMAC is 256 bits 789 -- and the customization string is an empty string. 790 IS-KEYED-MAC TRUE 791 SMIME-CAPS {IDENTIFIED BY id-KMACWithSHAKE128} 792 } 793 id-KMACWithSHAKE128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 794 country(16) us(840) organization(1) 795 gov(101) csor(3) nistAlgorithm(4) 796 hashAlgs(2) 19 } 798 KMACwithSHAKE128-params ::= SEQUENCE { 799 kMACOutputLength INTEGER DEFAULT 256, -- Output length in bits 800 customizationString OCTET STRING DEFAULT ''H 801 } 803 -- KMAC with SHAKE256 804 maca-KMACwithSHAKE256 MAC-ALGORITHM ::= { 805 IDENTIFIER id-KMACWithSHAKE256 806 PARAMS TYPE KMACwithSHAKE256-params ARE optional 807 -- If KMACwithSHAKE256-params parameters are absent 808 -- the SHAKE256 output length used in KMAC is 512 bits 809 -- and the customization string is an empty string. 810 IS-KEYED-MAC TRUE 811 SMIME-CAPS {IDENTIFIED BY id-KMACWithSHAKE256} 812 } 813 id-KMACWithSHAKE256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 814 country(16) us(840) organization(1) 815 gov(101) csor(3) nistAlgorithm(4) 816 hashAlgs(2) 20 } 817 KMACwithSHAKE256-params ::= SEQUENCE { 818 kMACOutputLength INTEGER DEFAULT 512, -- Output length in bits 819 customizationString OCTET STRING DEFAULT ''H 820 } 822 END 824 Authors' Addresses 826 Panos Kampanakis 827 Cisco Systems 829 Email: pkampana@cisco.com 831 Quynh Dang 832 NIST 833 100 Bureau Drive 834 Gaithersburg, MD 20899 836 Email: quynh.Dang@nist.gov