idnits 2.17.1 draft-ietf-lamps-cms-shakes-09.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 -- The document date (April 11, 2019) is 1841 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 (~~), 3 warnings (==), 3 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 13, 2019 April 11, 2019 8 Use of the SHAKE One-way Hash Functions in the Cryptographic Message 9 Syntax (CMS) 10 draft-ietf-lamps-cms-shakes-09 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 13, 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 . . . . . . . . . . . . . . . . . . . . . . . 4 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 . . . . . . . . . . . . . . . . . . . 9 68 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 10 69 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 70 8.1. Normative References . . . . . . . . . . . . . . . . . . 10 71 8.2. Informative References . . . . . . . . . . . . . . . . . 11 72 Appendix A. ASN.1 Module . . . . . . . . . . . . . . . . . . . . 12 73 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 16 75 1. Change Log 77 [ EDNOTE: Remove this section before publication. ] 79 o draft-ietf-lamps-cms-shake-09: 81 * Fixed minor text nit. 83 * Updates in Sec Considerations section. 85 o draft-ietf-lamps-cms-shake-08: 87 * id-shake128-len and id-shake256-len were replaced with id- 88 sha128 with 32 bytes output length and id-shake256 with 64 89 bytes output length. 91 * Fixed a discrepancy between section 3 and 4.4 about the KMAC 92 OIDs that have parameters as optional. 94 o draft-ietf-lamps-cms-shake-07: 96 * Small nit from Russ while in WGLC. 98 o draft-ietf-lamps-cms-shake-06: 100 * Incorporated Eric's suggestion from WGLC. 102 o draft-ietf-lamps-cms-shake-05: 104 * Added informative references. 106 * Updated ASN.1 so it compiles. 108 * Updated IANA considerations. 110 o draft-ietf-lamps-cms-shake-04: 112 * Added RFC8174 reference and text. 114 * Explicitly explained why RSASSA-PSS-params are omitted in 115 section 4.2.1. 117 * Simplified Public Keys section by removing redundant info from 118 RFCs. 120 o draft-ietf-lamps-cms-shake-03: 122 * Removed paragraph suggesting KMAC to be used in generating k in 123 Deterministic ECDSA. That should be RFC6979-bis. 125 * Removed paragraph from Security Considerations that talks about 126 randomness of k because we are using deterministic ECDSA. 128 * Completed ASN.1 module and fixed KMAC ASN.1 based on Jim's 129 feedback. 131 * Text fixes. 133 o draft-ietf-lamps-cms-shake-02: 135 * Updates based on suggestions and clarifications by Jim. 137 * Started ASN.1 module. 139 o draft-ietf-lamps-cms-shake-01: 141 * Significant reorganization of the sections to simplify the 142 introduction, the new OIDs and their use in CMS. 144 * Added new OIDs for RSASSA-PSS that hardcodes hash, salt and 145 MGF, according the WG consensus. 147 * Updated Public Key section to use the new RSASSA-PSS OIDs and 148 clarify the algorithm identifier usage. 150 * Removed the no longer used SHAKE OIDs from section 3.1. 152 o draft-ietf-lamps-cms-shake-00: 154 * Various updates to title and section names. 156 * Content changes filling in text and references. 158 o draft-dang-lamps-cms-shakes-hash-00: 160 * Initial version 162 2. Introduction 164 The Cryptographic Message Syntax (CMS) [RFC5652] is used to digitally 165 sign, digest, authenticate, or encrypt arbitrary message contents. 166 This specification describes the use of the SHAKE128 and SHAKE256 167 specified in [SHA3] as new hash functions in CMS. In addition, it 168 describes the use of these functions with the RSASSA-PSS signature 169 algorithm [RFC8017] and the Elliptic Curve Digital Signature 170 Algorithm (ECDSA) [X9.62] with the CMS signed-data content type. 172 In the SHA-3 family, two extendable-output functions (SHAKEs), 173 SHAKE128 and SHAKE256, are defined. Four other hash function 174 instances, SHA3-224, SHA3-256, SHA3-384, and SHA3-512 are also 175 defined but are out of scope for this document. A SHAKE is a 176 variable length hash function defined as SHAKE(M, d) where the output 177 is a d-bits long digest of message M. The corresponding collision 178 and second preimage resistance strengths for SHAKE128 are 179 min(d/2,128) and min(d,128) bits respectively. And, the 180 corresponding collision and second preimage resistance strengths for 181 SHAKE256 are min(d/2,256) and min(d,256) bits respectively. 183 A SHAKE can be used in CMS as the message digest function (to hash 184 the message to be signed) in RSASSA-PSS and ECDSA, message 185 authentication code and as the mask generating function in RSASSA- 186 PSS. This specification describes the identifiers for SHAKEs to be 187 used in CMS and their meaning. 189 2.1. Terminology 191 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 192 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 193 "OPTIONAL" in this document are to be interpreted as described in BCP 194 14 [RFC2119] [RFC8174] when, and only when, they appear in all 195 capitals, as shown here. 197 3. Identifiers 199 This section defines six new object identifiers (OIDs) for using 200 SHAKE128 and SHAKE256 in CMS. 202 EDNOTE: If PKIX draft is standardized first maybe we should not say 203 the identifiers are new for the RSASSA-PSS and ECDSA. 205 Two object identifiers for SHAKE128 and SHAKE256 hash functions are 206 defined in [shake-nist-oids] and we include them here for 207 convenience. 209 id-shake128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 210 country(16) us(840) organization(1) gov(101) csor(3) 211 nistAlgorithm(4) 2 11 } 213 id-shake256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 214 country(16) us(840) organization(1) gov(101) csor(3) 215 nistAlgorithm(4) 2 12 } 217 In this specification, when using the id-shake128 or id-shake256 218 algorithm identifiers, the parameters MUST be absent. That is, the 219 identifier SHALL be a SEQUENCE of one component, the OID. 221 We define two new identifiers for RSASSA-PSS signatures using SHAKEs. 223 id-RSASSA-PSS-SHAKE128 OBJECT IDENTIFIER ::= { TBD1 } 225 id-RSASSA-PSS-SHAKE256 OBJECT IDENTIFIER ::= { TBD2 } 227 [ EDNOTE: "TBD1", "TBD2" will be specified by NIST later. ] 229 The same RSASSA-PSS algorithm identifiers can be used for identifying 230 public keys and signatures. 232 We define two new algorithm identifiers of ECDSA signatures using 233 SHAKEs. 235 id-ecdsa-with-shake128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 236 country(16) us(840) organization(1) gov(101) csor(3) 237 nistAlgorithm(4) 3 TBD3 } 239 id-ecdsa-with-shake256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 240 country(16) us(840) organization(1) gov(101) csor(3) 241 nistAlgorithm(4) 3 TBD4 } 243 [ EDNOTE: "TBD3", "TBD4" will be specified by NIST. ] 245 The parameters for the four RSASSA-PSS and ECDSA identifiers MUST be 246 absent. That is, each identifier SHALL be a SEQUENCE of one 247 component, the OID. 249 Two new object identifiers for KMACs using SHAKE128 and SHAKE256 are 250 defined below. 252 id-KmacWithSHAKE128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 253 country(16) us(840) organization(1) gov(101) csor(3) 254 nistAlgorithm(4) 2 19 } 256 id-KmacWithSHAKE256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 257 country(16) us(840) organization(1) gov(101) csor(3) 258 nistAlgorithm(4) 2 20 } 260 The parameters for id-KmacWithSHAKE128 and id-KmacWithSHAKE256 are 261 OPTIONAL. 263 Section 4.1, Section 4.2.1, Section 4.2.2 and Section 4.4 specify the 264 required output length for each use of SHAKE128 or SHAKE256 in 265 message digests, RSASSA-PSS, ECDSA and KMAC. 267 4. Use in CMS 269 4.1. Message Digests 271 The id-shake128 and id-shake256 OIDs (Section 3) can be used as the 272 digest algorithm identifiers located in the SignedData, SignerInfo, 273 DigestedData, and the AuthenticatedData digestAlgorithm fields in CMS 274 [RFC5652]. The encoding MUST omit the parameters field and the 275 output size, d, for the SHAKE128 or SHAKE256 message digest MUST be 276 256 or 512 bits respectively. 278 The digest values are located in the DigestedData field and the 279 Message Digest authenticated attribute included in the 280 signedAttributes of the SignedData signerInfo. In addition, digest 281 values are input to signature algorithms. The digest algorithm MUST 282 be the same as the message hash algorithms used in signatures. 284 4.2. Signatures 286 In CMS, signature algorithm identifiers are located in the SignerInfo 287 signatureAlgorithm field of SignedData content type and 288 countersignature attribute. Signature values are located in the 289 SignerInfo signature field of SignedData and countersignature. 291 Conforming implementations that process RSASSA-PSS and ECDSA with 292 SHAKE signatures when processing CMS data MUST recognize the 293 corresponding OIDs specified in Section 3. 295 When using RSASSA-PSS or ECDSA with SHAKEs, the RSA modulus and ECDSA 296 curve order SHOULD be chosen in line with the SHAKE output length. 297 In the context of this document SHAKE128 OIDs are RECOMMENDED for 298 2048 or 3072-bit RSA modulus or curves with group order of 256-bits. 299 SHAKE256 OIDs are RECOMMENDED for 4096-bit RSA modulus and higher or 300 curves with group order of 384-bits and higher. 302 4.2.1. RSASSA-PSS Signatures 304 The RSASSA-PSS algorithm is defined in [RFC8017]. When id-RSASSA- 305 PSS-SHAKE128 or id-RSASSA-PSS-SHAKE256 specified in Section 3 is 306 used, the encoding MUST omit the parameters field. That is, the 307 AlgorithmIdentifier SHALL be a SEQUENCE of one component, id-RSASSA- 308 PSS-SHAKE128 or id-RSASSA-PSS-SHAKE256. [RFC4055] defines RSASSA- 309 PSS-params that are used to define the algorithms and inputs to the 310 algorithm. This specification does not use parameters because the 311 hash and mask generating algorithm and trailer and salt are embedded 312 in the OID definition. 314 The hash algorithm to hash a message being signed and the hash and 315 the hash algorithm as the mask generation function used in RSASSA-PSS 316 MUST be the same, SHAKE128 or SHAKE256 respectively. The output- 317 length of the hash algorithm which hashes the message SHALL be 32 or 318 64 bytes respectively. 320 The mask generation function takes an octet string of variable length 321 and a desired output length as input, and outputs an octet string of 322 the desired length. In RSASSA-PSS with SHAKEs, the SHAKEs MUST be 323 used natively as the MGF function, instead of the MGF1 algorithm that 324 uses the hash function in multiple iterations as specified in 325 Section B.2.1 of [RFC8017]. In other words, the MGF is defined as 326 the SHAKE128 or SHAKE256 output of the mgfSeed for id-RSASSA-PSS- 327 SHAKE128 and id-RSASSA-PSS-SHAKE256 respectively. The mgfSeed is the 328 seed from which mask is generated, an octet string [RFC8017]. As 329 explained in Step 9 of section 9.1.1 of [RFC8017], the output length 330 of the MGF is emLen - hLen - 1 bytes. emLen is the maximum message 331 length ceil((n-1)/8), where n is the RSA modulus in bits. hLen is 32 332 and 64-bytes for id-RSASSA-PSS-SHAKE128 and id-RSASSA-PSS-SHAKE256 333 respectively. Thus when SHAKE is used as the MGF, the SHAKE output 334 length maskLen is (n - 264) or (n - 520) bits respectively. For 335 example, when RSA modulus n is 2048, the output length of SHAKE128 or 336 SHAKE256 as the MGF will be 1784 or 1528-bits when id-RSASSA-PSS- 337 SHAKE128 or id-RSASSA-PSS-SHAKE256 is used respectively. 339 The RSASSA-PSS saltLength MUST be 32 or 64 bytes respectively. 340 Finally, the trailerField MUST be 1, which represents the trailer 341 field with hexadecimal value 0xBC [RFC8017]. 343 4.2.2. ECDSA Signatures 345 The Elliptic Curve Digital Signature Algorithm (ECDSA) is defined in 346 [X9.62]. When the id-ecdsa-with-shake128 or id-ecdsa-with-shake256 347 (specified in Section 3) algorithm identifier appears, the respective 348 SHAKE function is used as the hash. The encoding MUST omit the 349 parameters field. That is, the AlgorithmIdentifier SHALL be a 350 SEQUENCE of one component, the OID id-ecdsa-with-shake128 or id- 351 ecdsa-with-shake256. 353 For simplicity and compliance with the ECDSA standard specification, 354 the output size of the hash function must be explicitly determined. 355 The output size, d, for SHAKE128 or SHAKE256 used in ECDSA MUST be 356 256 or 512 bits respectively. 358 It is RECOMMENDED that conforming implementations that generate ECDSA 359 with SHAKE signatures in CMS generate such signatures with a 360 deterministically generated, non-random k in accordance with all the 361 requirements specified in [RFC6979]. They MAY also generate such 362 signatures in accordance with all other recommendations in [X9.62] or 363 [SEC1] if they have a stated policy that requires conformance to 364 these standards. 366 4.3. Public Keys 368 In CMS, the signer's public key algorithm identifiers are located in 369 the OriginatorPublicKey's algorithm attribute. The conventions and 370 encoding for RSASSA-PSS and ECDSA public keys algorithm identifiers 371 are as specified in Section 2.3 of [RFC3279], Section 3.1 of 372 [RFC4055] and Section 2.1 of [RFC5480]. 374 Traditionally, the rsaEncryption object identifier is used to 375 identify RSA public keys. The rsaEncryption object identifier 376 continues to identify the public key when the RSA private key owner 377 does not wish to limit the use of the public key exclusively to 378 RSASSA-PSS with SHAKEs. When the RSA private key owner wishes to 379 limit the use of the public key exclusively to RSASSA-PSS, the 380 AlgorithmIdentifier for RSASSA-PSS defined in Section 3 SHOULD be 381 used as the algorithm attribute in the OriginatorPublicKey sequence. 382 Conforming client implementations that process RSASSA-PSS with SHAKE 383 public keys in CMS message MUST recognize the corresponding OIDs in 384 Section 3. 386 Conforming implementations MUST specify and process the algorithms 387 explicitly by using the OIDs specified in Section 3 when encoding 388 ECDSA with SHAKE public keys in CMS messages. 390 The identifier parameters, as explained in Section 3, MUST be absent. 392 4.4. Message Authentication Codes 394 KMAC message authentication code (KMAC) is specified in [SP800-185]. 395 In CMS, KMAC algorithm identifiers are located in the 396 AuthenticatedData macAlgorithm field. The KMAC values are located in 397 the AuthenticatedData mac field. 399 When the id-KmacWithSHAKE128 or id-KmacWithSHAKE256 OID is used as 400 the MAC algorithm identifier, the parameters field is optional 401 (absent or present). If absent, the SHAKE256 output length used in 402 KMAC is 256 or 512 bits respectively and the customization string is 403 an empty string by default. 405 Conforming implementations that process KMACs with the SHAKEs when 406 processing CMS data MUST recognize these identifiers. 408 When calculating the KMAC output, the variable N is 0xD2B282C2, S is 409 an empty string, and L, the integer representing the requested output 410 length in bits, is 256 or 512 for KmacWithSHAKE128 or 411 KmacWithSHAKE256 respectively in this specification. 413 5. IANA Considerations 415 One object identifier for the ASN.1 module in Appendix A was assigned 416 in the SMI Security for S/MIME Module Identifiers 417 (1.2.840.113549.1.9.16.0) registry: 419 CMSAlgsForSHAKE-2019 { iso(1) member-body(2) us(840) 420 rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) modules(0) 421 id-mod-cms-shakes-2019(TBD) } 423 6. Security Considerations 425 This document updates [RFC3370]. The security considerations section 426 of that document applies to this specification as well. 428 NIST has defined appropriate use of the hash functions in terms of 429 the algorithm strengths and expected time frames for secure use in 430 Special Publications (SPs) [SP800-78-4] and [SP800-107]. These 431 documents can be used as guides to choose appropriate key sizes for 432 various security scenarios. 434 When more than two parties share the same message-authentication key, 435 data origin authentication is not provided. Any party that knows the 436 message-authentication key can compute a valid MAC, therefore the 437 content could originate from any one of the parties. 439 7. Acknowledgements 441 This document is based on Russ Housley's draft 442 [I-D.housley-lamps-cms-sha3-hash]. It replaces SHA3 hash functions 443 by SHAKE128 and SHAKE256 as the LAMPS WG agreed. 445 The authors would like to thank Russ Housley for his guidance and 446 very valuable contributions with the ASN.1 module. Valuable feedback 447 was also provided by Eric Rescorla. 449 8. References 451 8.1. Normative References 453 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 454 Requirement Levels", BCP 14, RFC 2119, 455 DOI 10.17487/RFC2119, March 1997, 456 . 458 [RFC3370] Housley, R., "Cryptographic Message Syntax (CMS) 459 Algorithms", RFC 3370, DOI 10.17487/RFC3370, August 2002, 460 . 462 [RFC4055] Schaad, J., Kaliski, B., and R. Housley, "Additional 463 Algorithms and Identifiers for RSA Cryptography for use in 464 the Internet X.509 Public Key Infrastructure Certificate 465 and Certificate Revocation List (CRL) Profile", RFC 4055, 466 DOI 10.17487/RFC4055, June 2005, 467 . 469 [RFC5480] Turner, S., Brown, D., Yiu, K., Housley, R., and T. Polk, 470 "Elliptic Curve Cryptography Subject Public Key 471 Information", RFC 5480, DOI 10.17487/RFC5480, March 2009, 472 . 474 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 475 RFC 5652, DOI 10.17487/RFC5652, September 2009, 476 . 478 [RFC8017] Moriarty, K., Ed., Kaliski, B., Jonsson, J., and A. Rusch, 479 "PKCS #1: RSA Cryptography Specifications Version 2.2", 480 RFC 8017, DOI 10.17487/RFC8017, November 2016, 481 . 483 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 484 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 485 May 2017, . 487 [SHA3] National Institute of Standards and Technology, U.S. 488 Department of Commerce, "SHA-3 Standard - Permutation- 489 Based Hash and Extendable-Output Functions", FIPS PUB 202, 490 August 2015. 492 [SP800-185] 493 National Institute of Standards and Technology, "SHA-3 494 Derived Functions: cSHAKE, KMAC, TupleHash and 495 ParallelHash. NIST SP 800-185", December 2016, 496 . 499 8.2. Informative References 501 [I-D.housley-lamps-cms-sha3-hash] 502 Housley, R., "Use of the SHA3 One-way Hash Functions in 503 the Cryptographic Message Syntax (CMS)", draft-housley- 504 lamps-cms-sha3-hash-00 (work in progress), March 2017. 506 [RFC3279] Bassham, L., Polk, W., and R. Housley, "Algorithms and 507 Identifiers for the Internet X.509 Public Key 508 Infrastructure Certificate and Certificate Revocation List 509 (CRL) Profile", RFC 3279, DOI 10.17487/RFC3279, April 510 2002, . 512 [RFC5753] Turner, S. and D. Brown, "Use of Elliptic Curve 513 Cryptography (ECC) Algorithms in Cryptographic Message 514 Syntax (CMS)", RFC 5753, DOI 10.17487/RFC5753, January 515 2010, . 517 [RFC5911] Hoffman, P. and J. Schaad, "New ASN.1 Modules for 518 Cryptographic Message Syntax (CMS) and S/MIME", RFC 5911, 519 DOI 10.17487/RFC5911, June 2010, 520 . 522 [RFC6268] Schaad, J. and S. Turner, "Additional New ASN.1 Modules 523 for the Cryptographic Message Syntax (CMS) and the Public 524 Key Infrastructure Using X.509 (PKIX)", RFC 6268, 525 DOI 10.17487/RFC6268, July 2011, 526 . 528 [RFC6979] Pornin, T., "Deterministic Usage of the Digital Signature 529 Algorithm (DSA) and Elliptic Curve Digital Signature 530 Algorithm (ECDSA)", RFC 6979, DOI 10.17487/RFC6979, August 531 2013, . 533 [SEC1] Standards for Efficient Cryptography Group, "SEC 1: 534 Elliptic Curve Cryptography", May 2009, 535 . 537 [shake-nist-oids] 538 National Institute of Standards and Technology, "Computer 539 Security Objects Register", October 2017, 540 . 543 [SP800-107] 544 National Institute of Standards and Technology (NIST), 545 "SP800-107: Recommendation for Applications Using Approved 546 Hash Algorithms", May 2014, 547 . 550 [SP800-78-4] 551 National Institute of Standards and Technology (NIST), 552 "SP800-78-4: Cryptographic Algorithms and Key Sizes for 553 Personal Identity Verification", May 2014, 554 . 557 [X9.62] American National Standard for Financial Services (ANSI), 558 "X9.62-2005 Public Key Cryptography for the Financial 559 Services Industry: The Elliptic Curve Digital Signature 560 Standard (ECDSA)", November 2005. 562 Appendix A. ASN.1 Module 564 This appendix includes the ASN.1 modules for SHAKEs in CMS. This 565 module includes some ASN.1 from other standards for reference. 567 CMSAlgsForSHAKE-2019 { iso(1) member-body(2) us(840) 568 rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) modules(0) 569 id-mod-cms-shakes-2019(TBD) } 571 DEFINITIONS EXPLICIT TAGS ::= 573 BEGIN 575 -- EXPORTS ALL; 577 IMPORTS 579 DIGEST-ALGORITHM, MAC-ALGORITHM, SMIME-CAPS 580 FROM AlgorithmInformation-2009 581 { iso(1) identified-organization(3) dod(6) internet(1) security(5) 582 mechanisms(5) pkix(7) id-mod(0) 583 id-mod-algorithmInformation-02(58) } 585 RSAPublicKey, rsaEncryption, id-ecPublicKey 586 FROM PKIXAlgs-2009 { iso(1) identified-organization(3) dod(6) 587 internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) 588 id-mod-pkix1-algorithms2008-02(56) } ; 590 -- 591 -- Message Digest Algorithms (mda-) 592 -- used in SignedData, SignerInfo, DigestedData, 593 -- and the AuthenticatedData digestAlgorithm 594 -- fields in CMS 595 -- 596 MessageDigestAlgs DIGEST-ALGORITHM ::= { 597 -- This expands MessageAuthAlgs from [RFC5652] 598 -- and MessageDigestAlgs in [RFC5753] 599 mda-shake128 | 600 mda-shake256, 601 ... 602 } 604 -- 605 -- One-Way Hash Functions 606 -- SHAKE128 607 mda-shake128 DIGEST-ALGORITHM ::= { 608 IDENTIFIER id-shake128 -- with output length 32 bytes. 609 } 610 id-shake128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) 611 us(840) organization(1) gov(101) 612 csor(3) nistAlgorithm(4) 613 hashAlgs(2) 11 } 615 -- SHAKE256 616 mda-shake256 DIGEST-ALGORITHM ::= { 617 IDENTIFIER id-shake256 -- with output length 64 bytes. 618 } 619 id-shake256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) 620 us(840) organization(1) gov(101) 621 csor(3) nistAlgorithm(4) 622 hashAlgs(2) 12 } 624 -- 625 -- Public key algorithm identifiers located in the 626 -- OriginatorPublicKey's algorithm attribute in CMS. 627 -- And Signature identifiers used in SignerInfo 628 -- signatureAlgorithm field of SignedData content 629 -- type and countersignature attribute in CMS. 630 -- 631 -- From RFC5280, for reference. 632 -- rsaEncryption OBJECT IDENTIFIER ::= { pkcs-1 1 } 633 -- When the rsaEncryption algorithm identifier is used 634 -- for a public key, the AlgorithmIdentifier parameters 635 -- field MUST contain NULL. 636 -- 637 id-RSASSA-PSS-SHAKE128 OBJECT IDENTIFIER ::= { TBD1 } 638 id-RSASSA-PSS-SHAKE256 OBJECT IDENTIFIER ::= { TBD2 } 640 -- When the id-RSASSA-PSS-* algorithm identifiers are used 641 -- for a public key or signature in CMS, the AlgorithmIdentifier 642 -- parameters field MUST be absent. The message digest algorithm 643 -- used in RSASSA-PSS MUST be SHAKE128 or SHAKE256 with a 32 or 644 -- 64 byte outout length respectively. The mask generating 645 -- function MUST be SHAKE128 or SHAKE256 with an output length 646 -- of (n - 264) or (n - 520) bits respectively, where n 647 -- is the RSA modulus in bits. The RSASSA-PSS saltLength MUST 648 -- be 32 or 64 bytes respectively. The trailerField MUST be 1, 649 -- which represents the trailer field with hexadecimal value 650 -- 0xBC. Regardless of id-RSASSA-PSS-* or rsaEncryption being 651 -- used as the AlgorithmIdentifier of the OriginatorPublicKey, 652 -- the RSA public key MUST be encoded using the RSAPublicKey 653 -- type. 654 -- From RFC4055, for reference. 655 -- RSAPublicKey ::= SEQUENCE { 656 -- modulus INTEGER, -- -- n 657 -- publicExponent INTEGER } -- -- e 659 id-ecdsa-with-shake128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 660 country(16) us(840) organization(1) 661 gov(101) csor(3) nistAlgorithm(4) 662 sigAlgs(3) TBD3 } 663 id-ecdsa-with-shake256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 664 country(16) us(840) organization(1) 665 gov(101) csor(3) nistAlgorithm(4) 666 sigAlgs(3) TBD4 } 668 -- When the id-ecdsa-with-shake* algorithm identifiers are 669 -- used in CMS, the AlgorithmIdentifier parameters field 670 -- MUST be absent and the signature algorithm should be 671 -- deterministic ECDSA [RFC6979]. The message digest MUST 672 -- be SHAKE128 or SHAKE256 with a 32 or 64 byte outout 673 -- length respectively. In both cases, the ECDSA public key, 674 -- MUST be encoded using the id-ecPublicKey type. 675 -- From RFC5480, for reference. 676 -- id-ecPublicKey OBJECT IDENTIFIER ::= { 677 -- iso(1) member-body(2) us(840) ansi-X9-62(10045) keyType(2) 1 } 678 -- The id-ecPublicKey parameters must be absent or present 679 -- and are defined as 680 -- ECParameters ::= CHOICE { 681 -- namedCurve OBJECT IDENTIFIER 682 -- -- -- implicitCurve NULL 683 -- -- -- specifiedCurve SpecifiedECDomain 684 -- } 686 -- 687 -- Message Authentication (maca-) Algorithms 688 -- used in AuthenticatedData macAlgorithm in CMS 689 -- 690 MessageAuthAlgs MAC-ALGORITHM ::= { 691 -- This expands MessageAuthAlgs from [RFC5652] and [RFC6268] 692 maca-KMACwithSHAKE128 | 693 maca-KMACwithSHAKE256, 694 ... 695 } 697 SMimeCaps SMIME-CAPS ::= { 698 -- The expands SMimeCaps from [RFC5911] 699 maca-KMACwithSHAKE128.&smimeCaps | 700 maca-KMACwithSHAKE256.&smimeCaps, 701 ... 702 } 704 -- 705 -- KMAC with SHAKE128 706 maca-KMACwithSHAKE128 MAC-ALGORITHM ::= { 707 IDENTIFIER id-KMACWithSHAKE128 708 PARAMS TYPE KMACwithSHAKE128-params ARE optional 709 -- If KMACwithSHAKE128-params parameters are absent 710 -- the SHAKE128 output length used in KMAC is 256 bits 711 -- and the customization string is an empty string. 712 IS-KEYED-MAC TRUE 713 SMIME-CAPS {IDENTIFIED BY id-KMACWithSHAKE128} 714 } 715 id-KMACWithSHAKE128 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 716 country(16) us(840) organization(1) 717 gov(101) csor(3) nistAlgorithm(4) 718 hashAlgs(2) 19 } 719 KMACwithSHAKE128-params ::= SEQUENCE { 720 kMACOutputLength INTEGER DEFAULT 256, -- Output length in bits 721 customizationString OCTET STRING DEFAULT ''H 722 } 724 -- KMAC with SHAKE256 725 maca-KMACwithSHAKE256 MAC-ALGORITHM ::= { 726 IDENTIFIER id-KMACWithSHAKE256 727 PARAMS TYPE KMACwithSHAKE256-params ARE optional 728 -- If KMACwithSHAKE256-params parameters are absent 729 -- the SHAKE256 output length used in KMAC is 512 bits 730 -- and the customization string is an empty string. 731 IS-KEYED-MAC TRUE 732 SMIME-CAPS {IDENTIFIED BY id-KMACWithSHAKE256} 733 } 734 id-KMACWithSHAKE256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 735 country(16) us(840) organization(1) 736 gov(101) csor(3) nistAlgorithm(4) 737 hashAlgs(2) 20 } 738 KMACwithSHAKE256-params ::= SEQUENCE { 739 kMACOutputLength INTEGER DEFAULT 512, -- Output length in bits 740 customizationString OCTET STRING DEFAULT ''H 741 } 743 END 745 Authors' Addresses 747 Panos Kampanakis 748 Cisco Systems 750 Email: pkampana@cisco.com 752 Quynh Dang 753 NIST 754 100 Bureau Drive 755 Gaithersburg, MD 20899 757 Email: quynh.Dang@nist.gov