<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-lamps-cms-sha3-hash-04" number="9688" obsoletes="" updates="" category="std" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3" xml:lang="en">

  <front>
    <title abbrev="Using SHA3 with the CMS">Use of the SHA3 One-Way Hash Functions in the Cryptographic Message Syntax (CMS)</title>
    <seriesInfo name="RFC" value="9688"/>
    <author initials="R." surname="Housley" fullname="Russ Housley">
      <organization abbrev="Vigil Security">Vigil Security, LLC</organization>
      <address>
        <postal>
          <city>Herndon</city>
          <region>VA</region>
          <country>United States of America</country>
        </postal>
        <email>housley@vigilsec.com</email>
      </address>
    </author>
    <date year="2024" month="November"/>

    <area>SEC</area>
    <workgroup>lamps</workgroup>

<keyword>example</keyword>

    <abstract>
<t>This document describes the conventions for using the one-way hash functions
in the SHA3 family with the Cryptographic Message Syntax (CMS).  The SHA3
family can be used as a message digest algorithm, as part of a signature
algorithm, as part of a message authentication code, or as part of a Key
Derivation Function (KDF).</t>
    </abstract>
  </front>
  <middle>
<section anchor="intro">
      <name>Introduction</name>
      <t>The Cryptographic Message Syntax (CMS) <xref target="RFC5652"/> is used to digitally sign,
digest, authenticate, or encrypt arbitrary message contents.  This
specification describes the use of the four one-way hash functions in the
SHA3 family (SHA3-224, SHA3-256, SHA3-384, and SHA3-512) <xref target="SHA3"/> with the
CMS.  In addition, this specification describes the use of these four
one-way hash functions with the RSASSA PKCS#1 version 1.5 signature
algorithm <xref target="RFC8017"/> and the Elliptic Curve Digital Signature Algorithm
(ECDSA) <xref target="DSS"/> with the CMS signed-data content type.</t>
      <t>This document should not be confused with <xref target="RFC8702"/>, which defines
conventions for using the SHAKE family of SHA3-based extensible output
functions with the CMS.</t>
      <section anchor="asn1">
        <name>ASN.1</name>
        <t>CMS values are generated with ASN.1 <xref target="X.680"/>, using the Basic
Encoding Rules (BER) and the Distinguished Encoding Rules (DER) <xref target="X.690"/>.</t>
      </section>
      <section anchor="terminology">
        <name>Terminology</name>
        <t>
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>",
    "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>",
    "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>",
    "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be
    interpreted as described in BCP&nbsp;14 <xref target="RFC2119"/> <xref
    target="RFC8174"/> when, and only when, they appear in all capitals, as
    shown here.
        </t>
      </section>
    </section>
    <section anchor="sha3oids">
      <name>Message Digest Algorithms</name>
      <t>One-way hash functions are also referred to as message digest algorithms.
This section specifies the conventions employed by CMS implementations
that support SHA3-224, SHA3-256, SHA3-384, and SHA3-512 <xref target="SHA3"/>.</t>
<t>Digest algorithm identifiers are located in the SignedData digestAlgorithms
field, the SignerInfo digestAlgorithm field, the DigestedData digestAlgorithm
field, and the AuthenticatedData digestAlgorithm field.</t> <t>Digest values
are located in the DigestedData digest field and the Message Digest
authenticated attribute.  In addition, digest values are input to signature
algorithms.</t>
      <t>SHA3-224, SHA3-256, SHA3-384, and SHA3-512 produce output values with
224, 256, 384, and 512 bits, respectively.  The object identifiers for
      these four one-way hash functions are as follows:</t>
      <sourcecode type="asn.1"><![CDATA[
   hashAlgs OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16)
       us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 2 }

   id-sha3-224 OBJECT IDENTIFIER ::= { hashAlgs 7 }

   id-sha3-256 OBJECT IDENTIFIER ::= { hashAlgs 8 }

   id-sha3-384 OBJECT IDENTIFIER ::= { hashAlgs 9 }

   id-sha3-512 OBJECT IDENTIFIER ::= { hashAlgs 10 }
]]></sourcecode>
      <t>When using the id-sha3-224, id-sha3-s256, id-sha3-384, or id-sha3-512
algorithm identifiers, the parameters field <bcp14>MUST</bcp14> be absent, not NULL
but absent.</t>
    </section>
    <section anchor="signature-algorithms">
      <name>Signature Algorithms</name>
      <t>This section specifies the conventions employed by CMS implementations
that support the four SHA3 one-way hash functions with the RSASSA PKCS#1 v1.5 signature algorithm <xref target="RFC8017"/> and the ECDSA <xref target="DSS"/> with the CMS signed-data content type.</t>
      <t>Signature algorithm identifiers are located in the SignerInfo
signatureAlgorithm field of SignedData.  Also, signature algorithm
identifiers are located in the SignerInfo signatureAlgorithm field
of countersignature attributes.</t>
      <t>Signature values are located in the SignerInfo signature field of
SignedData.  Also, signature values are located in the SignerInfo
signature field of countersignature attributes.</t>
      <section anchor="rsassa-pkcs1-v15-with-sha3">
        <name>RSASSA PKCS#1 v1.5 with SHA3</name>
        <t>The RSASSA PKCS#1 v1.5 is defined in <xref target="RFC8017"/>.  When RSASSA PKCS#1 v1.5 is
used in conjunction with one of the SHA3 one-way hash functions, the
object identifiers are:</t>
        <sourcecode type="asn.1"><![CDATA[
   OID ::= OBJECT IDENTIFIER

   sigAlgs OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16)
       us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 3 }

   id-rsassa-pkcs1-v1-5-with-sha3-224 OID ::= { sigAlgs 13 }

   id-rsassa-pkcs1-v1-5-with-sha3-256 OID ::= { sigAlgs 14 }

   id-rsassa-pkcs1-v1-5-with-sha3-384 OID ::= { sigAlgs 15 }

   id-rsassa-pkcs1-v1-5-with-sha3-512 OID ::= { sigAlgs 16 }
]]></sourcecode>
        <t>The algorithm identifier for RSASSA PKCS#1 v1.5 subject public keys
in certificates is specified in <xref target="RFC3279"/>, and it is repeated here for
convenience:</t>
        <sourcecode type="asn.1"><![CDATA[
   rsaEncryption OBJECT IDENTIFIER ::= { iso(1) member-body(2)
       us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1 }
]]></sourcecode>
        <t>When the rsaEncryption, id-rsassa-pkcs1-v1-5-with-sha3-224,
id-rsassa-pkcs1-v1-5-with-sha3-256,
id-rsassa-pkcs1-v1-5-with-sha3-384, and
id-rsassa-pkcs1-v1-5-with-sha3-512 algorithm identifiers are used,
the AlgorithmIdentifier parameters field <bcp14>MUST</bcp14> contain NULL.</t>
        <t>When the rsaEncryption algorithm identifier is used, the RSA public key,
which is composed of a modulus and a public exponent, <bcp14>MUST</bcp14> be encoded
using the RSAPublicKey type as specified in <xref target="RFC3279"/>.  The output of
this encoding is carried in the certificate subject public key.  The
definition of RSAPublicKey is repeated here for convenience:</t>
        <sourcecode type="asn.1"><![CDATA[
   RSAPublicKey ::= SEQUENCE {
      modulus INTEGER, -- n
      publicExponent INTEGER } -- e
]]></sourcecode>
        <t>When signing, the RSASSA PKCS#1 v1.5 signature algorithm generates a
single value. That value is used directly as the signature value.</t>
      </section>
      <section anchor="ecdsa-with-sha3">
        <name>ECDSA with SHA3</name>
        <t>The ECDSA is defined in
<xref target="DSS"/>.  When the ECDSA is used in conjunction with one of the SHA3
one-way hash functions, the object identifiers are:</t>
        <sourcecode type="asn.1"><![CDATA[
   sigAlgs OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16)
       us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 3 }

   id-ecdsa-with-sha3-224 OBJECT IDENTIFIER ::= { sigAlgs 9 }

   id-ecdsa-with-sha3-256 OBJECT IDENTIFIER ::= { sigAlgs 10 }

   id-ecdsa-with-sha3-384 OBJECT IDENTIFIER ::= { sigAlgs 11 }

   id-ecdsa-with-sha3-512 OBJECT IDENTIFIER ::= { sigAlgs 12 }
   ]]></sourcecode>
<t> When the id-sha3-224, id-sha3-s256, id-sha3-384, or id-sha3-512 algorithm
identifier is used, the parameters field <bcp14>MUST</bcp14> be absent, not NULL but absent.</t>
<t> When the id-ecdsa-with-sha3-224, id-ecdsa-with-sha3-256, id-
ecdsa-with-sha3-384, and id-ecdsa-with-sha3-512 algorithm identifiers are
used, the parameters field <bcp14>MUST</bcp14> be absent, not NULL but absent.</t>  
<t>The conventions for
ECDSA public keys are as specified in <xref target="RFC5480"/>.  The
ECParameters associated with the ECDSA public key in the signers certificate
<bcp14>SHALL</bcp14> apply to the verification of the signature.</t> <t>When
signing, the ECDSA algorithm generates two values.  These values are commonly
referred to as r and s.  To easily transfer these two values as one signature,
they <bcp14>MUST</bcp14> be ASN.1 encoded using the ECDSA-Sig-Value defined in
<xref target="RFC3279"/>, which is repeated here for convenience:</t>
<sourcecode type="asn.1"><![CDATA[ ECDSA-Sig-Value ::= SEQUENCE { r INTEGER, s
INTEGER } ]]></sourcecode>
      </section>
    </section>
    <section anchor="message-authentication-codes-using-hmac-and-sha3">
      <name>Message Authentication Codes Using HMAC and SHA3</name>
      <t>This section specifies the conventions employed by CMS implementations
that support the Hashed Message Authentication Code (HMAC) <xref target="RFC2104"/> with SHA3 message authentication code (MAC).</t>
      <t>MAC algorithm identifiers are located in the AuthenticatedData
macAlgorithm field.</t>
      <t>MAC values are located in the AuthenticatedData mac field.</t>
      <t>When HMAC is used in conjunction with one of the SHA3
one-way hash functions, the object identifiers are:</t>
      <sourcecode type="asn.1"><![CDATA[
   hashAlgs OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16)
       us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 2 }
 
   id-hmacWithSHA3-224 OBJECT IDENTIFIER ::= { hashAlgs 13 }

   id-hmacWithSHA3-256 OBJECT IDENTIFIER ::= { hashAlgs 14 }

   id-hmacWithSHA3-384 OBJECT IDENTIFIER ::= { hashAlgs 15 }

   id-hmacWithSHA3-512 OBJECT IDENTIFIER ::= { hashAlgs 16 }
]]></sourcecode>
      <t>When the id-hmacWithSHA3-224, id-hmacWithSHA3-256,
id-hmacWithSHA3-384, and id-hmacWithSHA3-512 algorithm
identifiers are used, the parameters field <bcp14>MUST</bcp14> be absent,
not NULL but absent.</t>
    </section>
    <section anchor="key-derivation-functions">
      <name>Key Derivation Functions</name>
      <t>The CMS KEMRecipientInfo structure <xref target="RFC9629"/> is one place where
algorithm identifiers for key-derivation functions are needed.</t>
      <section anchor="hkdf-with-sha3">
        <name>HKDF with SHA3</name>
        <t>This section assigns four algorithm identifiers that can be employed by CMS
implementations that support the HMAC-based Extract-and-Expand Key Derivation
Function (HKDF) <xref target="RFC5869"/> with the SHA3 family of hash functions.</t>
        <t>When HKDF is used in conjunction with one of the SHA3
one-way hash functions, the object identifiers are:</t>
        <sourcecode type="asn.1"><![CDATA[
   id-alg OBJECT IDENTIFIER ::= { iso(1) member-body(2)
       us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) 3 }

   id-alg-hkdf-with-sha3-224 OBJECT IDENTIFIER ::= { id-alg 32 }

   id-alg-hkdf-with-sha3-256 OBJECT IDENTIFIER ::= { id-alg 33 }

   id-alg-hkdf-with-sha3-384 OBJECT IDENTIFIER ::= { id-alg 34 }

   id-alg-hkdf-with-sha3-512 OBJECT IDENTIFIER ::= { id-alg 35 }
]]></sourcecode>
<t>When id-alg-hkdf-with-sha3-224, id-alg-hkdf-with-sha3-256,
id-alg-hkdf-with-sha3-384, or id-alg-hkdf-with-sha3-512 is used in
an algorithm identifier, the parameters field <bcp14>MUST</bcp14> be absent,
not NULL but absent.</t>
      </section>
      <section anchor="kmac128-kdf-and-kmac256-kdf">
        <name>KMAC128-KDF and KMAC256-KDF</name>
        <t>This section specifies the conventions employed by CMS implementations
that employ either KMAC128 or KMAC256 as KDFs as
defined in Section 4.4 of <xref target="NIST.SP.800-108r1-upd1"/>.</t>
        <t>KMAC128 and KMAC256 are specified in <xref target="NIST.SP.800-185"/>. The use of KMAC128
and KMAC256 as KDFs are defined as follows:</t>
            <t indent="3">KMAC128-KDF is KMAC128(K, X, L, S).</t>
            <t indent="3">KMAC256-KDF is KMAC256(K, X, L, S).</t>
        <t>The parameters to the KMAC128 and KMAC256 functions are:</t>
<dl>
              <dt>K</dt>
              <dd>
                <t>The input key-derivation key.  The length of K <bcp14>MUST</bcp14> be less than 2<sup>2040</sup>.</t>
              </dd>
              <dt>X</dt>
              <dd>
                <t>The context, which contains the ASN.1 DER encoding of CMSORIforKEMOtherInfo when the KDF is used with <xref target="RFC9629"/>.</t>
              </dd>
              <dt>L</dt>
              <dd>
                <t>The output length in bits.  L <bcp14>MUST</bcp14> be greater than or equal to 0 and <bcp14>MUST</bcp14> be less than 2<sup>2040</sup>.</t>
              </dd>
              <dt>S</dt>
              <dd>
                <t>The optional customization label, such as "KDF" (0x4B4446).  The length of S <bcp14>MUST</bcp14> be less than 2<sup>2040</sup>.</t>
              </dd>
            </dl>
        <t>The K parameter is known to all authorized parties; it is often the output
of a KEM Decap() operation.  The X parameter is assembled from data that
is transmitted by the originator.  The L parameter is determined by the
size of the output keying material.  The S parameter is optional, and if
it is provided by the originator, it is passed in the parameters field of
the KDF algorithm identifier.</t>
        <t>When KMAC128-KDF or KMAC256-KDF is used, the object identifiers are:</t>
        <sourcecode type="asn.1"><![CDATA[
   hashAlgs OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16)
       us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 2 }
 
   id-kmac128 OBJECT IDENTIFIER ::= { hashAlgs 21 }

   id-kmac256 OBJECT IDENTIFIER ::= { hashAlgs 22 }
]]></sourcecode>
        <t>When id-kmac128 or id-kmac256 is used as part of an algorithm identifier, the
parameters field <bcp14>MUST</bcp14> be absent when there is no customization label (S).  If any
value is provided for S, then the parameters field <bcp14>MUST</bcp14> be present and
contain the value of S, encoded as Customization.</t>
        <sourcecode type="asn.1"><![CDATA[
   Customization ::= OCTET STRING
]]></sourcecode>
      </section>
      <section anchor="kdf2-and-kdf3-with-sha3">
        <name>KDF2 and KDF3 with SHA3</name>
        <t>This section specifies the conventions employed by CMS implementations
that employ either the KDF2 or KDF3 functions defined in <xref target="ANS-X9.44-2007"/>.
The CMS KEMRecipientInfo structure <xref target="RFC9629"/> is one
place where algorithm identifiers for key-derivation functions are needed.</t>
        <t>The key-derivation function algorithm identifier is an object identifier
and optional parameters.  When KDF2 and KDF3 are used, they are identified by
the id-kdf-kdf2 and id-kdf-kdf3 object identifiers, respectively.  The
key-derivation function algorithm identifier parameters carry a message
digest algorithm identifier, which indicates the hash function that
is being employed.  To support SHA3, the key-derivation function
algorithm identifier parameters contain an algorithm identifier from
<xref target="sha3oids"/>.</t>
        <sourcecode type="asn.1"><![CDATA[
   x9-44 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3)
       tc68(133) country(16) x9(840) x9Standards(9) x9-44(44) }

   x9-44-components OBJECT IDENTIFIER ::= { x9-44 components(1) }

   id-kdf-kdf2 OBJECT IDENTIFIER ::= { x9-44-components kdf2(1) }

   id-kdf-kdf3 OBJECT IDENTIFIER ::= { x9-44-components kdf3(2) }
]]></sourcecode>
      </section>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>Implementations must protect the signer's private key.  Compromise of the
signer's private key permits masquerade.</t>
      <t>Implementations must protect the key-derivation key.  Compromise of the
key-derivation key permits others to derive the derived keying material,
which would result in loss of confidentiality, integrity, or authentication,
depending on the use of the derived keying material.</t>
      <t>When more than two parties share the same message-authentication key,
data origin authentication is not assured.  Any party that knows the
message-authentication key can compute a valid MAC; therefore, the content
could originate from any one of the parties.</t>
      <t>  Implementations must randomly generate message-authentication keys
  and one-time values, such as the a per-message secret number (called the
  k value) when generating an ECDSA signature.
In addition, the generation of public/private key pairs relies on a
random numbers.  The use of inadequate pseudorandom number generators
(PRNGs) to generate cryptographic values can result in little or no
security.  Instead of brute-force searching the whole key space, an
attacker may find it much easier to reproduce the PRNG environment that
produced the keys and then search the resulting small set of
possibilities.  The generation of quality random numbers is
difficult.  <xref target="RFC4086"/> offers important guidance in this area,
and Appendix 3 of FIPS PUB 186-4 <xref target="DSS"/> provides some PRNG techniques.</t>
      <t>Implementers should be aware that cryptographic algorithms become weaker
with time.  As new cryptanalysis techniques are developed and computing
performance improves, the work factor to break a particular cryptographic
algorithm will reduce.  Therefore, cryptographic algorithm
implementations should be modular, allowing new algorithms to be readily
inserted.  That is, implementers should be prepared to regularly update
the set of algorithms in their implementations.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>IANA has assigned one object identifier for the ASN.1 module in <xref target="asn1mod"/>
in the "SMI Security for S/MIME Module Identifiers (1.2.840.113549.1.9.16.0)"
registry <xref target="IANA-MOD"/>:</t>
      <sourcecode type="asn1"><![CDATA[
   id-mod-sha3-oids-2023 OBJECT IDENTIFIER ::= {
      iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1)
      pkcs-9(9) smime(16) mod(0) 78 }
]]></sourcecode>
      <t>IANA has assigned four object identifiers for the HKDF using SHA3 algorithm
identifiers in the "SMI Security for S/MIME Algorithms (1.2.840.113549.1.9.16.3)"
registry <xref target="IANA-ALG"/>:</t>
      <sourcecode type="asn1"><![CDATA[
   id-alg-hkdf-with-sha3-224 OBJECT IDENTIFIER ::= { id-alg 32 }

   id-alg-hkdf-with-sha3-256 OBJECT IDENTIFIER ::= { id-alg 33 }

   id-alg-hkdf-with-sha3-384 OBJECT IDENTIFIER ::= { id-alg 34 }

   id-alg-hkdf-with-sha3-512 OBJECT IDENTIFIER ::= { id-alg 35 }
]]></sourcecode>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="ANS-X9.44-2007" target="https://webstore.ansi.org/standards/ascx9/ansix9442007r2017">
          <front>
            <title>Public Key Cryptography for the Financial Services Industry -- Key Establishment Using Integer Factorization Cryptography</title>
            <author>
              <organization>American National Standards Institute</organization>
            </author>
            <date year="2017"/>
          </front>
          <seriesInfo name="ANSI" value="X9.44-2007 (R2017)"/>
        </reference>

        <reference anchor="NIST.SP.800-108r1-upd1" target="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-108r1-upd1.pdf">
          <front>
            <title>Recommendation for Key Derivation Using Pseudorandom Functions</title>
            <author fullname="Lily Chen">
              <organization>National Institute of Standards and Technology</organization>
            </author>
            <date year="2024" month="February" day="02"/>
          </front>
          <seriesInfo name="NIST SP" value="800-108r1-upd1"/>
          <seriesInfo name="DOI" value="10.6028/NIST.SP.800-108r1-upd1"/>
        </reference>

        <reference anchor="NIST.SP.800-185" target="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf">
          <front>
            <title>SHA-3 Derived Functions: cSHAKE, KMAC, TupleHash and ParallelHash</title>
            <author fullname="John Kelsey">
              <organization>National Institute of Standards and Technology</organization>
            </author>
            <author fullname="Shu-jen Chang">
              <organization>National Institute of Standards and Technology</organization>
            </author>
            <author fullname="Ray Perlner">
              <organization>National Institute of Standards and Technology</organization>
            </author>
            <date year="2016" month="December"/>
          </front>
          <seriesInfo name="NIST SP" value="800-185"/>
          <seriesInfo name="DOI" value="10.6028/NIST.SP.800-185"/>
        </reference>

        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2104.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3279.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5652.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5480.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5869.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5912.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8017.xml"/>

        <reference anchor="SHA3" target="http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf">
          <front>
            <title>SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions</title>
            <author>
              <organization>National Institute of Standards and Technology</organization>
            </author>
            <date year="2015" month="August"/>
          </front>
          <seriesInfo name="NIST FIPS" value="202"/>
          <seriesInfo name="DOI" value="10.6028/NIST.FIPS.202"/>
        </reference>

        <reference anchor="DSS" target="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf">
          <front>
            <title>Digital Signature Standard (DSS)</title>
            <author>
              <organization>National Institute of Standards and Technology</organization>
            </author>
            <date year="2023" month="February" day="03"/>
          </front>
          <seriesInfo name="FIPS PUB" value="186-5"/>
          <seriesInfo name="DOI" value="10.6028/NIST.FIPS.186-5"/>
        </reference>

        <reference anchor="X.680" target="https://www.itu.int/rec/T-REC-X.680-202102-I/en">
          <front>
            <title>Information technology - Abstract Syntax Notation One (ASN.1): Specification of basic notation</title>
            <author>
              <organization>ITU-T</organization>
            </author>
            <date year="2021" month="February"/>
          </front>
          <seriesInfo name="ITU-T Recommendation" value="X.680"/>
          <seriesInfo name="ISO/IEC" value="8824-1:2021"/>
        </reference>

        <reference anchor="X.690" target="https://www.itu.int/rec/T-REC-X.690-202102-I/en">
          <front>
            <title>Information technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)</title>
            <author>
              <organization>ITU-T</organization>
            </author>
            <date year="2021" month="February"/>
          </front>
          <seriesInfo name="ITU-T Recommendation" value="X.690"/>
          <seriesInfo name="ISO/IEC" value="8825-1:2021"/>
        </reference>

	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>

      </references>

      <references anchor="sec-informative-references">
        <name>Informative References</name>

        <reference anchor="IANA-ALG" target="https://www.iana.org/assignments/smi-numbers/">
          <front>
            <title>SMI Security for S/MIME Algorithms (1.2.840.113549.1.9.16.3)</title>
            <author>
              <organization>IANA</organization>
            </author>
          </front>
        </reference>

        <reference anchor="IANA-MOD" target="https://www.iana.org/assignments/smi-numbers/">
          <front>
            <title>SMI Security for S/MIME Module Identifier (1.2.840.113549.1.9.16.0)</title>
            <author>
              <organization>IANA</organization>
            </author>
          </front>
        </reference>

        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9629.xml"/>

	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4086.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8702.xml"/>

      </references>
    </references>

<section numbered="true" anchor="asn1mod">
      <name>ASN.1 Module </name>
      <t>This section contains the ASN.1 module for the algorithm identifiers using the SHA3
family of hash functions <xref target="SHA3"/>.  This module imports types from other ASN.1
modules that are defined in <xref target="RFC5912"/>.</t>
      <sourcecode type="asn.1" markers="true"><![CDATA[
   SHA3-OIDs-2023
     { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9)
       smime(16) modules(0) id-mod-sha3-oids-2023(78) }

   DEFINITIONS IMPLICIT TAGS ::=
   BEGIN

   EXPORTS ALL;

   IMPORTS
   
     AlgorithmIdentifier{}, DIGEST-ALGORITHM, SIGNATURE-ALGORITHM,
     KEY-DERIVATION, MAC-ALGORITHM
     FROM AlgorithmInformation-2009  -- [RFC5912]
       { iso(1) identified-organization(3) dod(6) internet(1)
         security(5) mechanisms(5) pkix(7) id-mod(0)
         id-mod-algorithmInformation-02(58) }

    mda-sha1, pk-rsa, pk-ec, ECDSA-Sig-Value
    FROM PKIXAlgs-2009  -- [RFC5912]
      { iso(1) identified-organization(3) dod(6) internet(1)
        security(5) mechanisms(5) pkix(7) id-mod(0)
        id-mod-pkix1-algorithms2008-02(56) }

    mda-sha224, mda-sha256, mda-sha384, mda-sha512
    FROM PKIX1-PSS-OAEP-Algorithms-2009  -- [RFC5912]
      { iso(1) identified-organization(3) dod(6) internet(1)
        security(5) mechanisms(5) pkix(7) id-mod(0)
        id-mod-pkix1-rsa-pkalgs-02(54) } ;


   --
   -- Alias
   --

   OID ::= OBJECT IDENTIFIER


   --
   -- Object Identifier Arcs
   --

   nistAlgorithm OID ::= { joint-iso-itu-t(2) country(16)
       us(840) organization(1) gov(101) csor(3) 4 }

   hashAlgs OID ::= { nistAlgorithm 2 }

   sigAlgs OID ::= { nistAlgorithm 3 }

   x9-44 OID ::= { iso(1) identified-organization(3) tc68(133)
       country(16) x9(840) x9Standards(9) x9-44(44) }

   x9-44-components OID ::= { x9-44 components(1) }

   id-alg OID ::= { iso(1) member-body(2) us(840)
       rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) 3 }


   --
   -- Message Digest Algorithms
   --

   id-sha3-224 OID ::= { hashAlgs 7 }

   id-sha3-256 OID ::= { hashAlgs 8 }

   id-sha3-384 OID ::= { hashAlgs 9 }

   id-sha3-512 OID ::= { hashAlgs 10 }

   mda-sha3-224 DIGEST-ALGORITHM ::= {
       IDENTIFIER id-sha3-224
       PARAMS ARE absent }

   mda-sha3-256 DIGEST-ALGORITHM ::= {
       IDENTIFIER id-sha3-256
       PARAMS ARE absent }

   mda-sha3-384 DIGEST-ALGORITHM ::= {
       IDENTIFIER id-sha3-384
       PARAMS ARE absent }

   mda-sha3-512 DIGEST-ALGORITHM ::= {
       IDENTIFIER id-sha3-512
       PARAMS ARE absent }

   HashAlgorithm ::= AlgorithmIdentifier{ DIGEST-ALGORITHM,
                         { HashAlgorithms } }

   HashAlgorithms DIGEST-ALGORITHM ::=  {
       mda-sha3-224 |
       mda-sha3-256 |
       mda-sha3-384 |
       mda-sha3-512,
       ... }


   --
   -- Signature Algorithms
   --

   id-rsassa-pkcs1-v1-5-with-sha3-224 OID ::= { sigAlgs 13 }

   id-rsassa-pkcs1-v1-5-with-sha3-256 OID ::= { sigAlgs 14 }

   id-rsassa-pkcs1-v1-5-with-sha3-384 OID ::= { sigAlgs 15 }

   id-rsassa-pkcs1-v1-5-with-sha3-512 OID ::= { sigAlgs 16 }

   id-ecdsa-with-sha3-224 OID ::= { sigAlgs 9 }

   id-ecdsa-with-sha3-256 OID ::= { sigAlgs 10 }

   id-ecdsa-with-sha3-384 OID ::= { sigAlgs 11 }

   id-ecdsa-with-sha3-512 OID ::= { sigAlgs 12 }

   sa-rsaWithSHA3-224 SIGNATURE-ALGORITHM ::= {
       IDENTIFIER id-rsassa-pkcs1-v1-5-with-sha3-224
       PARAMS TYPE NULL ARE required
       HASHES { mda-sha3-224 }
       PUBLIC-KEYS { pk-rsa }
       SMIME-CAPS {IDENTIFIED BY 
           id-rsassa-pkcs1-v1-5-with-sha3-224 } }

   sa-rsaWithSHA3-256 SIGNATURE-ALGORITHM ::= {
       IDENTIFIER id-rsassa-pkcs1-v1-5-with-sha3-256
       PARAMS TYPE NULL ARE required
       HASHES { mda-sha3-256 }
       PUBLIC-KEYS { pk-rsa }
       SMIME-CAPS {IDENTIFIED BY
           id-rsassa-pkcs1-v1-5-with-sha3-256 } }

   sa-rsaWithSHA3-384 SIGNATURE-ALGORITHM ::= {
       IDENTIFIER id-rsassa-pkcs1-v1-5-with-sha3-384
       PARAMS TYPE NULL ARE required
       HASHES { mda-sha3-384 }
       PUBLIC-KEYS { pk-rsa }
       SMIME-CAPS {IDENTIFIED BY
           id-rsassa-pkcs1-v1-5-with-sha3-384 } }

   sa-rsaWithSHA3-512 SIGNATURE-ALGORITHM ::= {
       IDENTIFIER id-rsassa-pkcs1-v1-5-with-sha3-512
       PARAMS TYPE NULL ARE required
       HASHES { mda-sha3-512 }
       PUBLIC-KEYS { pk-rsa }
       SMIME-CAPS {IDENTIFIED BY
           id-rsassa-pkcs1-v1-5-with-sha3-512 } }

   sa-ecdsaWithSHA3-224 SIGNATURE-ALGORITHM ::= {
       IDENTIFIER id-ecdsa-with-sha3-224
       VALUE ECDSA-Sig-Value
       PARAMS ARE absent
       HASHES { mda-sha3-224 }
       PUBLIC-KEYS { pk-ec }
       SMIME-CAPS {IDENTIFIED BY id-ecdsa-with-sha3-224 } }

   sa-ecdsaWithSHA3-256 SIGNATURE-ALGORITHM ::= {
       IDENTIFIER id-ecdsa-with-sha3-256
       VALUE ECDSA-Sig-Value
       PARAMS ARE absent
       HASHES { mda-sha3-256 }
       PUBLIC-KEYS { pk-ec }
       SMIME-CAPS {IDENTIFIED BY id-ecdsa-with-sha3-256 } }

   sa-ecdsaWithSHA3-384 SIGNATURE-ALGORITHM ::= {
       IDENTIFIER id-ecdsa-with-sha3-384
       VALUE ECDSA-Sig-Value
       PARAMS ARE absent
       HASHES { mda-sha3-384 }
       PUBLIC-KEYS { pk-ec }
       SMIME-CAPS {IDENTIFIED BY id-ecdsa-with-sha3-384 } }

   sa-ecdsaWithSHA3-512 SIGNATURE-ALGORITHM ::= {
       IDENTIFIER id-ecdsa-with-sha3-512
       VALUE ECDSA-Sig-Value
       PARAMS ARE absent
       HASHES { mda-sha3-512 }
       PUBLIC-KEYS { pk-ec }
       SMIME-CAPS {IDENTIFIED BY id-ecdsa-with-sha3-512 } }

   SignatureAlg ::= AlgorithmIdentifier{ SIGNATURE-ALGORITHM,
                         { SignatureAlgs } }
                         
   SignatureAlgs SIGNATURE-ALGORITHM ::= {
       sa-rsaWithSHA3-224 |
       sa-rsaWithSHA3-256 |
       sa-rsaWithSHA3-384 |
       sa-rsaWithSHA3-512 |
       sa-ecdsaWithSHA3-224 |
       sa-ecdsaWithSHA3-256 |
       sa-ecdsaWithSHA3-384 |
       sa-ecdsaWithSHA3-512,
       ... }
   
   
   --
   -- Message Authentication Codes
   --

   id-hmacWithSHA3-224 OID ::= { hashAlgs 13 }

   id-hmacWithSHA3-256 OID ::= { hashAlgs 14 }

   id-hmacWithSHA3-384 OID ::= { hashAlgs 15 }

   id-hmacWithSHA3-512 OID ::= { hashAlgs 16 }

   maca-hmacWithSHA3-224 MAC-ALGORITHM ::= {
       IDENTIFIER id-hmacWithSHA3-224
       PARAMS ARE absent
       IS-KEYED-MAC TRUE
       SMIME-CAPS {IDENTIFIED BY id-hmacWithSHA3-224 } }

   maca-hmacWithSHA3-256 MAC-ALGORITHM ::= {
       IDENTIFIER id-hmacWithSHA3-256
       PARAMS ARE absent
       IS-KEYED-MAC TRUE
       SMIME-CAPS {IDENTIFIED BY id-hmacWithSHA3-256 } }

   maca-hmacWithSHA3-384 MAC-ALGORITHM ::= {
       IDENTIFIER id-hmacWithSHA3-384
       PARAMS ARE absent
       IS-KEYED-MAC TRUE
       SMIME-CAPS {IDENTIFIED BY id-hmacWithSHA3-384 } }

   maca-hmacWithSHA3-512 MAC-ALGORITHM ::= {
       IDENTIFIER id-hmacWithSHA3-512
       PARAMS ARE absent
       IS-KEYED-MAC TRUE
       SMIME-CAPS {IDENTIFIED BY id-hmacWithSHA3-512 } }

   MACAlgorithm ::= AlgorithmIdentifier{ MAC-ALGORITHM,
                       { MACAlgorithms } }

   MACAlgorithms MAC-ALGORITHM ::= {
       maca-hmacWithSHA3-224 |
       maca-hmacWithSHA3-256 |
       maca-hmacWithSHA3-384 |
       maca-hmacWithSHA3-512,
       ... }


   --
   -- Key Derivation Algorithms
   --

   id-alg-hkdf-with-sha3-224 OID ::= { id-alg 32 }

   id-alg-hkdf-with-sha3-256 OID ::= { id-alg 33 }

   id-alg-hkdf-with-sha3-384 OID ::= { id-alg 34 }

   id-alg-hkdf-with-sha3-512 OID ::= { id-alg 35 }

   id-kmac128 OID ::= { hashAlgs 21 }

   id-kmac256  OID ::= { hashAlgs 22 }

   id-kdf-kdf2 OID ::= { x9-44-components kdf2(1) }

   id-kdf-kdf3 OID ::= { x9-44-components kdf3(2) }

   kda-hkdf-with-sha3-224 KEY-DERIVATION ::= {
       IDENTIFIER id-alg-hkdf-with-sha3-224
       PARAMS ARE absent
       -- No S/MIME caps defined -- }

   kda-hkdf-with-sha3-256 KEY-DERIVATION ::= {
       IDENTIFIER id-alg-hkdf-with-sha3-256
       PARAMS ARE absent
       -- No S/MIME caps defined -- }

   kda-hkdf-with-sha3-384 KEY-DERIVATION ::= {
       IDENTIFIER id-alg-hkdf-with-sha3-384
       PARAMS ARE absent
       -- No S/MIME caps defined -- }

   kda-hkdf-with-sha3-512 KEY-DERIVATION ::= {
       IDENTIFIER id-alg-hkdf-with-sha3-512
       PARAMS ARE absent
       -- No S/MIME caps defined -- }

   kda-kmac128 KEY-DERIVATION ::= {
       IDENTIFIER id-kmac128
       PARAMS TYPE Customization ARE optional
       -- PARAMS are absent when Customization is ''H --
       -- No S/MIME caps defined -- }

   kda-kmac256 KEY-DERIVATION ::= {
       IDENTIFIER id-kmac256
       PARAMS TYPE Customization ARE optional
       -- PARAMS are absent when Customization is ''H --
       -- No S/MIME caps defined -- }

   kda-kdf2 KEY-DERIVATION ::= {
       IDENTIFIER id-kdf-kdf2
       PARAMS TYPE KDF2-HashFunction ARE required
       -- No S/MIME caps defined -- }

   kda-kdf3 KEY-DERIVATION ::= {
       IDENTIFIER id-kdf-kdf3
       PARAMS TYPE KDF3-HashFunction ARE required
       -- No S/MIME caps defined -- }

   Customization ::= OCTET STRING

   KDF2-HashFunction ::= AlgorithmIdentifier { DIGEST-ALGORITHM,
                             { KDF2-HashFunctions } }

   KDF2-HashFunctions DIGEST-ALGORITHM ::= {
      X9-HashFunctions,
      ... }

   KDF3-HashFunction ::= AlgorithmIdentifier { DIGEST-ALGORITHM,
                             { KDF3-HashFunctions } }

   KDF3-HashFunctions DIGEST-ALGORITHM ::= {
      X9-HashFunctions,
      ... }

   X9-HashFunctions DIGEST-ALGORITHM ::= {
       mda-sha1 |
       mda-sha224 |
       mda-sha256 |
       mda-sha384 |
       mda-sha512 |
       mda-sha3-224 |
       mda-sha3-256 |
       mda-sha3-384 |
       mda-sha3-512,
       ... }

   KeyDerivationFunction ::=  AlgorithmIdentifier{ KEY-DERIVATION,
                                  { KeyDevAlgs } }

   KeyDevAlgs KEY-DERIVATION ::= {
       kda-hkdf-with-sha3-224 |
       kda-hkdf-with-sha3-256 |
       kda-hkdf-with-sha3-384 |
       kda-hkdf-with-sha3-512 |
       kda-kmac128 |
       kda-kmac256 |
       kda-kdf2 |
       kda-kdf3,
       ... }

   END
]]></sourcecode>
    </section>
    <section numbered="false" anchor="acknowledgements">
      <name>Acknowledgements</name>
      <t>Thanks to <contact fullname="Daniel Van Geest"/> and <contact
      fullname="Sean Turner"/> for their careful review and thoughtful
      comments.</t>
      <t>Thanks to <contact fullname="Sara Kerman"/>, <contact fullname="Quynh
      Dang"/>, and <contact fullname="David Cooper"/> for getting the object
      identifiers assigned for KMAC128 and KMAC256.</t>
    </section>
  </back>
</rfc>
