idnits 2.17.1 draft-ietf-lamps-cms-shakes-10.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 'Updates: ' line in the draft header should list only the _numbers_ of the RFCs which will be updated by this document (if approved); it should not include the word 'RFC' in the list. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Couldn't figure out when the document was first submitted -- there may comments or warnings related to the use of a disclaimer for pre-RFC5378 work that could not be issued because of this. Please check the Legal Provisions document at https://trustee.ietf.org/license-info to determine if you need the pre-RFC5378 disclaimer. -- The document date (April 25, 2019) is 1799 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' -- No information found for draft-housley-lamps-cms-sha3-hash - is the name correct? Summary: 1 error (**), 0 flaws (~~), 3 warnings (==), 4 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: RFC3370 (if approved) Q. Dang 5 Intended status: Standards Track NIST 6 Expires: October 27, 2019 April 25, 2019 8 Use of the SHAKE One-way Hash Functions in the Cryptographic Message 9 Syntax (CMS) 10 draft-ietf-lamps-cms-shakes-10 12 Abstract 14 This document describes the conventions for using the SHAKE family of 15 hash functions with the Cryptographic Message Syntax (CMS) as one-way 16 hash functions with the RSA Probabilistic signature and ECDSA 17 signature algorithms, as message digests and message authentication 18 codes. The conventions for the associated signer public keys in CMS 19 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 October 27, 2019. 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 . . . . . . . . . . . . . . . . . . . . . . . . 4 57 2.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5 58 3. Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . 5 59 4. Use in CMS . . . . . . . . . . . . . . . . . . . . . . . . . 6 60 4.1. Message Digests . . . . . . . . . . . . . . . . . . . . . 6 61 4.2. Signatures . . . . . . . . . . . . . . . . . . . . . . . 7 62 4.2.1. RSASSA-PSS Signatures . . . . . . . . . . . . . . . . 7 63 4.2.2. ECDSA Signatures . . . . . . . . . . . . . . . . . . 8 64 4.3. Public Keys . . . . . . . . . . . . . . . . . . . . . . . 8 65 4.4. Message Authentication Codes . . . . . . . . . . . . . . 9 66 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 67 6. Security Considerations . . . . . . . . . . . . . . . . . . . 10 68 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 10 69 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 11 70 8.1. Normative References . . . . . . . . . . . . . . . . . . 11 71 8.2. Informative References . . . . . . . . . . . . . . . . . 12 72 Appendix A. ASN.1 Module . . . . . . . . . . . . . . . . . . . . 13 73 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 17 75 1. Change Log 77 [ EDNOTE: Remove this section before publication. ] 79 o draft-ietf-lamps-cms-shake-10: 81 * Updated IANA considerations section to request for OID 82 assignments. 84 o draft-ietf-lamps-cms-shake-09: 86 * Fixed minor text nit. 88 * Updates in Sec Considerations section. 90 o draft-ietf-lamps-cms-shake-08: 92 * id-shake128-len and id-shake256-len were replaced with id- 93 sha128 with 32 bytes output length and id-shake256 with 64 94 bytes output length. 96 * Fixed a discrepancy between section 3 and 4.4 about the KMAC 97 OIDs that have parameters as optional. 99 o draft-ietf-lamps-cms-shake-07: 101 * Small nit from Russ while in WGLC. 103 o draft-ietf-lamps-cms-shake-06: 105 * Incorporated Eric's suggestion from WGLC. 107 o draft-ietf-lamps-cms-shake-05: 109 * Added informative references. 111 * Updated ASN.1 so it compiles. 113 * Updated IANA considerations. 115 o draft-ietf-lamps-cms-shake-04: 117 * Added RFC8174 reference and text. 119 * Explicitly explained why RSASSA-PSS-params are omitted in 120 section 4.2.1. 122 * Simplified Public Keys section by removing redundant info from 123 RFCs. 125 o draft-ietf-lamps-cms-shake-03: 127 * Removed paragraph suggesting KMAC to be used in generating k in 128 Deterministic ECDSA. That should be RFC6979-bis. 130 * Removed paragraph from Security Considerations that talks about 131 randomness of k because we are using deterministic ECDSA. 133 * Completed ASN.1 module and fixed KMAC ASN.1 based on Jim's 134 feedback. 136 * Text fixes. 138 o draft-ietf-lamps-cms-shake-02: 140 * Updates based on suggestions and clarifications by Jim. 142 * Started ASN.1 module. 144 o draft-ietf-lamps-cms-shake-01: 146 * Significant reorganization of the sections to simplify the 147 introduction, the new OIDs and their use in CMS. 149 * Added new OIDs for RSASSA-PSS that hardcodes hash, salt and 150 MGF, according the WG consensus. 152 * Updated Public Key section to use the new RSASSA-PSS OIDs and 153 clarify the algorithm identifier usage. 155 * Removed the no longer used SHAKE OIDs from section 3.1. 157 o draft-ietf-lamps-cms-shake-00: 159 * Various updates to title and section names. 161 * Content changes filling in text and references. 163 o draft-dang-lamps-cms-shakes-hash-00: 165 * Initial version 167 2. Introduction 169 The Cryptographic Message Syntax (CMS) [RFC5652] is used to digitally 170 sign, digest, authenticate, or encrypt arbitrary message contents. 171 This specification describes the use of the SHAKE128 and SHAKE256 172 specified in [SHA3] as new hash functions in CMS. In addition, it 173 describes the use of these functions with the RSASSA-PSS signature 174 algorithm [RFC8017] and the Elliptic Curve Digital Signature 175 Algorithm (ECDSA) [X9.62] with the CMS signed-data content type. 177 In the SHA-3 family, two extendable-output functions (SHAKEs), 178 SHAKE128 and SHAKE256, are defined. Four other hash function 179 instances, SHA3-224, SHA3-256, SHA3-384, and SHA3-512 are also 180 defined but are out of scope for this document. A SHAKE is a 181 variable length hash function defined as SHAKE(M, d) where the output 182 is a d-bits long digest of message M. The corresponding collision 183 and second preimage resistance strengths for SHAKE128 are 184 min(d/2,128) and min(d,128) bits respectively. And, the 185 corresponding collision and second preimage resistance strengths for 186 SHAKE256 are min(d/2,256) and min(d,256) bits respectively. 188 A SHAKE can be used in CMS as the message digest function (to hash 189 the message to be signed) in RSASSA-PSS and ECDSA, message 190 authentication code and as the mask generating function in RSASSA- 191 PSS. This specification describes the identifiers for SHAKEs to be 192 used in CMS and their meaning. 194 2.1. Terminology 196 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 197 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 198 "OPTIONAL" in this document are to be interpreted as described in BCP 199 14 [RFC2119] [RFC8174] when, and only when, they appear in all 200 capitals, as shown here. 202 3. Identifiers 204 This section defines six new object identifiers (OIDs) for using 205 SHAKE128 and SHAKE256 in CMS. 207 EDNOTE: If PKIX draft is standardized first maybe we should not say 208 the identifiers are new for the RSASSA-PSS and ECDSA. 210 Two object identifiers for SHAKE128 and SHAKE256 hash functions are 211 defined in [shake-nist-oids] and we include them here for 212 convenience. 214 id-shake128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 215 country(16) us(840) organization(1) gov(101) csor(3) 216 nistAlgorithm(4) 2 11 } 218 id-shake256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 219 country(16) us(840) organization(1) gov(101) csor(3) 220 nistAlgorithm(4) 2 12 } 222 In this specification, when using the id-shake128 or id-shake256 223 algorithm identifiers, the parameters MUST be absent. That is, the 224 identifier SHALL be a SEQUENCE of one component, the OID. 226 We define two identifiers for RSASSA-PSS signatures using SHAKEs. 228 id-RSASSA-PSS-SHAKE128 OBJECT IDENTIFIER ::= { iso(1) 229 identified-organization(3) dod(6) internet(1) 230 security(5) mechanisms(5) pkix(7) algorithms(6) 231 TBD1 } 233 id-RSASSA-PSS-SHAKE256 OBJECT IDENTIFIER ::= { iso(1) 234 identified-organization(3) dod(6) internet(1) 235 security(5) mechanisms(5) pkix(7) algorithms(6) 236 TBD2 } 238 The same RSASSA-PSS algorithm identifiers can be used for identifying 239 public keys and signatures. 241 We define two algorithm identifiers of ECDSA signatures using SHAKEs. 243 id-ecdsa-with-shake128 OBJECT IDENTIFIER ::= { iso(1) 244 identified-organization(3) dod(6) internet(1) 245 security(5) mechanisms(5) pkix(7) algorithms(6) 246 TBD3 } 248 id-ecdsa-with-shake256 OBJECT IDENTIFIER ::= { iso(1) 249 identified-organization(3) dod(6) internet(1) 250 security(5) mechanisms(5) pkix(7) algorithms(6) 251 TBD4 } 253 The parameters for the four RSASSA-PSS and ECDSA identifiers MUST be 254 absent. That is, each identifier SHALL be a SEQUENCE of one 255 component, the OID. 257 Two object identifiers for KMACs using SHAKE128 and SHAKE256 are 258 defined below. 260 id-KmacWithSHAKE128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 261 country(16) us(840) organization(1) gov(101) csor(3) 262 nistAlgorithm(4) 2 19 } 264 id-KmacWithSHAKE256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 265 country(16) us(840) organization(1) gov(101) csor(3) 266 nistAlgorithm(4) 2 20 } 268 The parameters for id-KmacWithSHAKE128 and id-KmacWithSHAKE256 are 269 OPTIONAL. 271 Section 4.1, Section 4.2.1, Section 4.2.2 and Section 4.4 specify the 272 required output length for each use of SHAKE128 or SHAKE256 in 273 message digests, RSASSA-PSS, ECDSA and KMAC. 275 4. Use in CMS 277 4.1. Message Digests 279 The id-shake128 and id-shake256 OIDs (Section 3) can be used as the 280 digest algorithm identifiers located in the SignedData, SignerInfo, 281 DigestedData, and the AuthenticatedData digestAlgorithm fields in CMS 282 [RFC5652]. The encoding MUST omit the parameters field and the 283 output size, d, for the SHAKE128 or SHAKE256 message digest MUST be 284 256 or 512 bits respectively. 286 The digest values are located in the DigestedData field and the 287 Message Digest authenticated attribute included in the 288 signedAttributes of the SignedData signerInfo. In addition, digest 289 values are input to signature algorithms. The digest algorithm MUST 290 be the same as the message hash algorithms used in signatures. 292 4.2. Signatures 294 In CMS, signature algorithm identifiers are located in the SignerInfo 295 signatureAlgorithm field of SignedData content type and 296 countersignature attribute. Signature values are located in the 297 SignerInfo signature field of SignedData and countersignature. 299 Conforming implementations that process RSASSA-PSS and ECDSA with 300 SHAKE signatures when processing CMS data MUST recognize the 301 corresponding OIDs specified in Section 3. 303 When using RSASSA-PSS or ECDSA with SHAKEs, the RSA modulus and ECDSA 304 curve order SHOULD be chosen in line with the SHAKE output length. 305 In the context of this document SHAKE128 OIDs are RECOMMENDED for 306 2048 or 3072-bit RSA modulus or curves with group order of 256-bits. 307 SHAKE256 OIDs are RECOMMENDED for 4096-bit RSA modulus and higher or 308 curves with group order of 384-bits and higher. 310 4.2.1. RSASSA-PSS Signatures 312 The RSASSA-PSS algorithm is defined in [RFC8017]. When id-RSASSA- 313 PSS-SHAKE128 or id-RSASSA-PSS-SHAKE256 specified in Section 3 is 314 used, the encoding MUST omit the parameters field. That is, the 315 AlgorithmIdentifier SHALL be a SEQUENCE of one component, id-RSASSA- 316 PSS-SHAKE128 or id-RSASSA-PSS-SHAKE256. [RFC4055] defines RSASSA- 317 PSS-params that are used to define the algorithms and inputs to the 318 algorithm. This specification does not use parameters because the 319 hash and mask generating algorithm and trailer and salt are embedded 320 in the OID definition. 322 The hash algorithm to hash a message being signed and the hash and 323 the hash algorithm as the mask generation function used in RSASSA-PSS 324 MUST be the same, SHAKE128 or SHAKE256 respectively. The output- 325 length of the hash algorithm which hashes the message SHALL be 32 or 326 64 bytes respectively. 328 The mask generation function takes an octet string of variable length 329 and a desired output length as input, and outputs an octet string of 330 the desired length. In RSASSA-PSS with SHAKEs, the SHAKEs MUST be 331 used natively as the MGF function, instead of the MGF1 algorithm that 332 uses the hash function in multiple iterations as specified in 333 Section B.2.1 of [RFC8017]. In other words, the MGF is defined as 334 the SHAKE128 or SHAKE256 output of the mgfSeed for id-RSASSA-PSS- 335 SHAKE128 and id-RSASSA-PSS-SHAKE256 respectively. The mgfSeed is the 336 seed from which mask is generated, an octet string [RFC8017]. As 337 explained in Step 9 of section 9.1.1 of [RFC8017], the output length 338 of the MGF is emLen - hLen - 1 bytes. emLen is the maximum message 339 length ceil((n-1)/8), where n is the RSA modulus in bits. hLen is 32 340 and 64-bytes for id-RSASSA-PSS-SHAKE128 and id-RSASSA-PSS-SHAKE256 341 respectively. Thus when SHAKE is used as the MGF, the SHAKE output 342 length maskLen is (n - 264) or (n - 520) bits respectively. For 343 example, when RSA modulus n is 2048, the output length of SHAKE128 or 344 SHAKE256 as the MGF will be 1784 or 1528-bits when id-RSASSA-PSS- 345 SHAKE128 or id-RSASSA-PSS-SHAKE256 is used respectively. 347 The RSASSA-PSS saltLength MUST be 32 or 64 bytes respectively. 348 Finally, the trailerField MUST be 1, which represents the trailer 349 field with hexadecimal value 0xBC [RFC8017]. 351 4.2.2. ECDSA Signatures 353 The Elliptic Curve Digital Signature Algorithm (ECDSA) is defined in 354 [X9.62]. When the id-ecdsa-with-shake128 or id-ecdsa-with-shake256 355 (specified in Section 3) algorithm identifier appears, the respective 356 SHAKE function is used as the hash. The encoding MUST omit the 357 parameters field. That is, the AlgorithmIdentifier SHALL be a 358 SEQUENCE of one component, the OID id-ecdsa-with-shake128 or id- 359 ecdsa-with-shake256. 361 For simplicity and compliance with the ECDSA standard specification, 362 the output size of the hash function must be explicitly determined. 363 The output size, d, for SHAKE128 or SHAKE256 used in ECDSA MUST be 364 256 or 512 bits respectively. 366 It is RECOMMENDED that conforming implementations that generate ECDSA 367 with SHAKE signatures in CMS generate such signatures with a 368 deterministically generated, non-random k in accordance with all the 369 requirements specified in [RFC6979]. They MAY also generate such 370 signatures in accordance with all other recommendations in [X9.62] or 371 [SEC1] if they have a stated policy that requires conformance to 372 these standards. 374 4.3. Public Keys 376 In CMS, the signer's public key algorithm identifiers are located in 377 the OriginatorPublicKey's algorithm attribute. The conventions and 378 encoding for RSASSA-PSS and ECDSA public keys algorithm identifiers 379 are as specified in Section 2.3 of [RFC3279], Section 3.1 of 380 [RFC4055] and Section 2.1 of [RFC5480]. 382 Traditionally, the rsaEncryption object identifier is used to 383 identify RSA public keys. The rsaEncryption object identifier 384 continues to identify the public key when the RSA private key owner 385 does not wish to limit the use of the public key exclusively to 386 RSASSA-PSS with SHAKEs. When the RSA private key owner wishes to 387 limit the use of the public key exclusively to RSASSA-PSS, the 388 AlgorithmIdentifier for RSASSA-PSS defined in Section 3 SHOULD be 389 used as the algorithm attribute in the OriginatorPublicKey sequence. 390 Conforming client implementations that process RSASSA-PSS with SHAKE 391 public keys in CMS message MUST recognize the corresponding OIDs in 392 Section 3. 394 Conforming implementations MUST specify and process the algorithms 395 explicitly by using the OIDs specified in Section 3 when encoding 396 ECDSA with SHAKE public keys in CMS messages. 398 The identifier parameters, as explained in Section 3, MUST be absent. 400 4.4. Message Authentication Codes 402 KMAC message authentication code (KMAC) is specified in [SP800-185]. 403 In CMS, KMAC algorithm identifiers are located in the 404 AuthenticatedData macAlgorithm field. The KMAC values are located in 405 the AuthenticatedData mac field. 407 When the id-KmacWithSHAKE128 or id-KmacWithSHAKE256 OID is used as 408 the MAC algorithm identifier, the parameters field is optional 409 (absent or present). If absent, the SHAKE256 output length used in 410 KMAC is 256 or 512 bits respectively and the customization string is 411 an empty string by default. 413 Conforming implementations that process KMACs with the SHAKEs when 414 processing CMS data MUST recognize these identifiers. 416 When calculating the KMAC output, the variable N is 0xD2B282C2, S is 417 an empty string, and L, the integer representing the requested output 418 length in bits, is 256 or 512 for KmacWithSHAKE128 or 419 KmacWithSHAKE256 respectively in this specification. 421 5. IANA Considerations 423 One object identifier for the ASN.1 module in Appendix A was 424 requested for the SMI Security for S/MIME Module Identifiers 425 (1.2.840.113549.1.9.16.0) registry: 427 +---------+----------------------+--------------------+ 428 | Decimal | Description | References | 429 +---------+----------------------+--------------------+ 430 | TBD | CMSAlgsForSHAKE-2019 | [EDNOTE: THIS RFC] | 431 +---------+----------------------+--------------------+ 433 IANA has assigned four OID identifiers in the SMI Security for PKIX 434 Algorithms [SMI-PKIX] (1.3.6.1.5.5.7.6) registry 436 id-RSASSA-PSS-SHAKE128 OBJECT IDENTIFIER ::= { iso(1) 437 identified-organization(3) dod(6) internet(1) 438 security(5) mechanisms(5) pkix(7) algorithms(6) 439 TBD1 } 440 id-RSASSA-PSS-SHAKE256 OBJECT IDENTIFIER ::= { iso(1) 441 identified-organization(3) dod(6) internet(1) 442 security(5) mechanisms(5) pkix(7) algorithms(6) 443 TBD2 } 444 id-ecdsa-with-shake128 OBJECT IDENTIFIER ::= { iso(1) 445 identified-organization(3) dod(6) internet(1) 446 security(5) mechanisms(5) pkix(7) algorithms(6) 447 TBD3 } 448 id-ecdsa-with-shake256 OBJECT IDENTIFIER ::= { iso(1) 449 identified-organization(3) dod(6) internet(1) 450 security(5) mechanisms(5) pkix(7) algorithms(6) 451 TBD4 } 453 6. Security Considerations 455 This document updates [RFC3370]. The security considerations section 456 of that document applies to this specification as well. 458 NIST has defined appropriate use of the hash functions in terms of 459 the algorithm strengths and expected time frames for secure use in 460 Special Publications (SPs) [SP800-78-4] and [SP800-107]. These 461 documents can be used as guides to choose appropriate key sizes for 462 various security scenarios. 464 When more than two parties share the same message-authentication key, 465 data origin authentication is not provided. Any party that knows the 466 message-authentication key can compute a valid MAC, therefore the 467 content could originate from any one of the parties. 469 7. Acknowledgements 471 This document is based on Russ Housley's draft 472 [I-D.housley-lamps-cms-sha3-hash]. It replaces SHA3 hash functions 473 by SHAKE128 and SHAKE256 as the LAMPS WG agreed. 475 The authors would like to thank Russ Housley for his guidance and 476 very valuable contributions with the ASN.1 module. Valuable feedback 477 was also provided by Eric Rescorla. 479 8. References 481 8.1. Normative References 483 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 484 Requirement Levels", BCP 14, RFC 2119, 485 DOI 10.17487/RFC2119, March 1997, 486 . 488 [RFC3370] Housley, R., "Cryptographic Message Syntax (CMS) 489 Algorithms", RFC 3370, DOI 10.17487/RFC3370, August 2002, 490 . 492 [RFC4055] Schaad, J., Kaliski, B., and R. Housley, "Additional 493 Algorithms and Identifiers for RSA Cryptography for use in 494 the Internet X.509 Public Key Infrastructure Certificate 495 and Certificate Revocation List (CRL) Profile", RFC 4055, 496 DOI 10.17487/RFC4055, June 2005, 497 . 499 [RFC5480] Turner, S., Brown, D., Yiu, K., Housley, R., and T. Polk, 500 "Elliptic Curve Cryptography Subject Public Key 501 Information", RFC 5480, DOI 10.17487/RFC5480, March 2009, 502 . 504 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 505 RFC 5652, DOI 10.17487/RFC5652, September 2009, 506 . 508 [RFC8017] Moriarty, K., Ed., Kaliski, B., Jonsson, J., and A. Rusch, 509 "PKCS #1: RSA Cryptography Specifications Version 2.2", 510 RFC 8017, DOI 10.17487/RFC8017, November 2016, 511 . 513 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 514 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 515 May 2017, . 517 [SHA3] National Institute of Standards and Technology, U.S. 518 Department of Commerce, "SHA-3 Standard - Permutation- 519 Based Hash and Extendable-Output Functions", FIPS PUB 202, 520 August 2015. 522 [SP800-185] 523 National Institute of Standards and Technology, "SHA-3 524 Derived Functions: cSHAKE, KMAC, TupleHash and 525 ParallelHash. NIST SP 800-185", December 2016, 526 . 529 8.2. Informative References 531 [I-D.housley-lamps-cms-sha3-hash] 532 Housley, R., "Use of the SHA3 One-way Hash Functions in 533 the Cryptographic Message Syntax (CMS)", draft-housley- 534 lamps-cms-sha3-hash-00 (work in progress), March 2017. 536 [RFC3279] Bassham, L., Polk, W., and R. Housley, "Algorithms and 537 Identifiers for the Internet X.509 Public Key 538 Infrastructure Certificate and Certificate Revocation List 539 (CRL) Profile", RFC 3279, DOI 10.17487/RFC3279, April 540 2002, . 542 [RFC5753] Turner, S. and D. Brown, "Use of Elliptic Curve 543 Cryptography (ECC) Algorithms in Cryptographic Message 544 Syntax (CMS)", RFC 5753, DOI 10.17487/RFC5753, January 545 2010, . 547 [RFC5911] Hoffman, P. and J. Schaad, "New ASN.1 Modules for 548 Cryptographic Message Syntax (CMS) and S/MIME", RFC 5911, 549 DOI 10.17487/RFC5911, June 2010, 550 . 552 [RFC6268] Schaad, J. and S. Turner, "Additional New ASN.1 Modules 553 for the Cryptographic Message Syntax (CMS) and the Public 554 Key Infrastructure Using X.509 (PKIX)", RFC 6268, 555 DOI 10.17487/RFC6268, July 2011, 556 . 558 [RFC6979] Pornin, T., "Deterministic Usage of the Digital Signature 559 Algorithm (DSA) and Elliptic Curve Digital Signature 560 Algorithm (ECDSA)", RFC 6979, DOI 10.17487/RFC6979, August 561 2013, . 563 [SEC1] Standards for Efficient Cryptography Group, "SEC 1: 564 Elliptic Curve Cryptography", May 2009, 565 . 567 [shake-nist-oids] 568 National Institute of Standards and Technology, "Computer 569 Security Objects Register", October 2017, 570 . 573 [SMI-PKIX] 574 IANA, "SMI Security for PKIX Algorithms", March 2019, 575 . 578 [SP800-107] 579 National Institute of Standards and Technology (NIST), 580 "SP800-107: Recommendation for Applications Using Approved 581 Hash Algorithms", May 2014, 582 . 585 [SP800-78-4] 586 National Institute of Standards and Technology (NIST), 587 "SP800-78-4: Cryptographic Algorithms and Key Sizes for 588 Personal Identity Verification", May 2014, 589 . 592 [X9.62] American National Standard for Financial Services (ANSI), 593 "X9.62-2005 Public Key Cryptography for the Financial 594 Services Industry: The Elliptic Curve Digital Signature 595 Standard (ECDSA)", November 2005. 597 Appendix A. ASN.1 Module 599 This appendix includes the ASN.1 modules for SHAKEs in CMS. This 600 module includes some ASN.1 from other standards for reference. 602 CMSAlgsForSHAKE-2019 { iso(1) member-body(2) us(840) 603 rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) modules(0) 604 id-mod-cms-shakes-2019(TBD) } 606 DEFINITIONS EXPLICIT TAGS ::= 608 BEGIN 610 -- EXPORTS ALL; 612 IMPORTS 614 DIGEST-ALGORITHM, MAC-ALGORITHM, SMIME-CAPS 615 FROM AlgorithmInformation-2009 616 { iso(1) identified-organization(3) dod(6) internet(1) security(5) 617 mechanisms(5) pkix(7) id-mod(0) 618 id-mod-algorithmInformation-02(58) } 620 RSAPublicKey, rsaEncryption, id-ecPublicKey 621 FROM PKIXAlgs-2009 { iso(1) identified-organization(3) dod(6) 622 internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) 623 id-mod-pkix1-algorithms2008-02(56) } ; 625 -- 626 -- Message Digest Algorithms (mda-) 627 -- used in SignedData, SignerInfo, DigestedData, 628 -- and the AuthenticatedData digestAlgorithm 629 -- fields in CMS 630 -- 631 MessageDigestAlgs DIGEST-ALGORITHM ::= { 632 -- This expands MessageAuthAlgs from [RFC5652] 633 -- and MessageDigestAlgs in [RFC5753] 634 mda-shake128 | 635 mda-shake256, 636 ... 637 } 639 -- 640 -- One-Way Hash Functions 641 -- SHAKE128 642 mda-shake128 DIGEST-ALGORITHM ::= { 643 IDENTIFIER id-shake128 -- with output length 32 bytes. 644 } 645 id-shake128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) 646 us(840) organization(1) gov(101) 647 csor(3) nistAlgorithm(4) 648 hashAlgs(2) 11 } 650 -- SHAKE256 651 mda-shake256 DIGEST-ALGORITHM ::= { 652 IDENTIFIER id-shake256 -- with output length 64 bytes. 653 } 654 id-shake256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) 655 us(840) organization(1) gov(101) 656 csor(3) nistAlgorithm(4) 657 hashAlgs(2) 12 } 659 -- 660 -- Public key algorithm identifiers located in the 661 -- OriginatorPublicKey's algorithm attribute in CMS. 662 -- And Signature identifiers used in SignerInfo 663 -- signatureAlgorithm field of SignedData content 664 -- type and countersignature attribute in CMS. 665 -- 666 -- From RFC5280, for reference. 667 -- rsaEncryption OBJECT IDENTIFIER ::= { pkcs-1 1 } 668 -- When the rsaEncryption algorithm identifier is used 669 -- for a public key, the AlgorithmIdentifier parameters 670 -- field MUST contain NULL. 671 -- 672 id-RSASSA-PSS-SHAKE128 OBJECT IDENTIFIER ::= { iso(1) 673 identified-organization(3) dod(6) internet(1) 674 security(5) mechanisms(5) pkix(7) algorithms(6) 675 TBD1 } 676 id-RSASSA-PSS-SHAKE256 OBJECT IDENTIFIER ::= { iso(1) 677 identified-organization(3) dod(6) internet(1) 678 security(5) mechanisms(5) pkix(7) algorithms(6) 679 TBD2 } 680 -- When the id-RSASSA-PSS-* algorithm identifiers are used 681 -- for a public key or signature in CMS, the AlgorithmIdentifier 682 -- parameters field MUST be absent. The message digest algorithm 683 -- used in RSASSA-PSS MUST be SHAKE128 or SHAKE256 with a 32 or 684 -- 64 byte outout length respectively. The mask generating 685 -- function MUST be SHAKE128 or SHAKE256 with an output length 686 -- of (n - 264) or (n - 520) bits respectively, where n 687 -- is the RSA modulus in bits. The RSASSA-PSS saltLength MUST 688 -- be 32 or 64 bytes respectively. The trailerField MUST be 1, 689 -- which represents the trailer field with hexadecimal value 690 -- 0xBC. Regardless of id-RSASSA-PSS-* or rsaEncryption being 691 -- used as the AlgorithmIdentifier of the OriginatorPublicKey, 692 -- the RSA public key MUST be encoded using the RSAPublicKey 693 -- type. 695 -- From RFC4055, for reference. 696 -- RSAPublicKey ::= SEQUENCE { 697 -- modulus INTEGER, -- -- n 698 -- publicExponent INTEGER } -- -- e 700 id-ecdsa-with-shake128 OBJECT IDENTIFIER ::= { iso(1) 701 identified-organization(3) dod(6) internet(1) 702 security(5) mechanisms(5) pkix(7) algorithms(6) 703 TBD3 } 704 id-ecdsa-with-shake256 OBJECT IDENTIFIER ::= { iso(1) 705 identified-organization(3) dod(6) internet(1) 706 security(5) mechanisms(5) pkix(7) algorithms(6) 707 TBD4 } 708 -- When the id-ecdsa-with-shake* algorithm identifiers are 709 -- used in CMS, the AlgorithmIdentifier parameters field 710 -- MUST be absent and the signature algorithm should be 711 -- deterministic ECDSA [RFC6979]. The message digest MUST 712 -- be SHAKE128 or SHAKE256 with a 32 or 64 byte outout 713 -- length respectively. In both cases, the ECDSA public key, 714 -- MUST be encoded using the id-ecPublicKey type. 716 -- From RFC5480, for reference. 717 -- id-ecPublicKey OBJECT IDENTIFIER ::= { 718 -- iso(1) member-body(2) us(840) ansi-X9-62(10045) keyType(2) 1 } 719 -- The id-ecPublicKey parameters must be absent or present 720 -- and are defined as 721 -- ECParameters ::= CHOICE { 722 -- namedCurve OBJECT IDENTIFIER 723 -- -- -- implicitCurve NULL 724 -- -- -- specifiedCurve SpecifiedECDomain 725 -- } 727 -- 728 -- Message Authentication (maca-) Algorithms 729 -- used in AuthenticatedData macAlgorithm in CMS 730 -- 731 MessageAuthAlgs MAC-ALGORITHM ::= { 732 -- This expands MessageAuthAlgs from [RFC5652] and [RFC6268] 733 maca-KMACwithSHAKE128 | 734 maca-KMACwithSHAKE256, 735 ... 736 } 738 SMimeCaps SMIME-CAPS ::= { 739 -- The expands SMimeCaps from [RFC5911] 740 maca-KMACwithSHAKE128.&smimeCaps | 741 maca-KMACwithSHAKE256.&smimeCaps, 742 ... 743 } 745 -- 746 -- KMAC with SHAKE128 747 maca-KMACwithSHAKE128 MAC-ALGORITHM ::= { 748 IDENTIFIER id-KMACWithSHAKE128 749 PARAMS TYPE KMACwithSHAKE128-params ARE optional 750 -- If KMACwithSHAKE128-params parameters are absent 751 -- the SHAKE128 output length used in KMAC is 256 bits 752 -- and the customization string is an empty string. 753 IS-KEYED-MAC TRUE 754 SMIME-CAPS {IDENTIFIED BY id-KMACWithSHAKE128} 755 } 756 id-KMACWithSHAKE128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 757 country(16) us(840) organization(1) 758 gov(101) csor(3) nistAlgorithm(4) 759 hashAlgs(2) 19 } 760 KMACwithSHAKE128-params ::= SEQUENCE { 761 kMACOutputLength INTEGER DEFAULT 256, -- Output length in bits 762 customizationString OCTET STRING DEFAULT ''H 763 } 765 -- KMAC with SHAKE256 766 maca-KMACwithSHAKE256 MAC-ALGORITHM ::= { 767 IDENTIFIER id-KMACWithSHAKE256 768 PARAMS TYPE KMACwithSHAKE256-params ARE optional 769 -- If KMACwithSHAKE256-params parameters are absent 770 -- the SHAKE256 output length used in KMAC is 512 bits 771 -- and the customization string is an empty string. 772 IS-KEYED-MAC TRUE 773 SMIME-CAPS {IDENTIFIED BY id-KMACWithSHAKE256} 774 } 775 id-KMACWithSHAKE256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 776 country(16) us(840) organization(1) 777 gov(101) csor(3) nistAlgorithm(4) 778 hashAlgs(2) 20 } 779 KMACwithSHAKE256-params ::= SEQUENCE { 780 kMACOutputLength INTEGER DEFAULT 512, -- Output length in bits 781 customizationString OCTET STRING DEFAULT ''H 782 } 784 END 786 Authors' Addresses 788 Panos Kampanakis 789 Cisco Systems 791 Email: pkampana@cisco.com 793 Quynh Dang 794 NIST 795 100 Bureau Drive 796 Gaithersburg, MD 20899 798 Email: quynh.Dang@nist.gov