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