<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.5.26 (Ruby 2.3.7) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-lamps-cms-sphincs-plus-00" category="std" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.15.1 -->
  <front>
    <title abbrev="SPHINCS+ Signature Algorithm in CMS">Use of the SPHINCS+ Signature Algorithm in the Cryptographic Message Syntax (CMS)</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-lamps-cms-sphincs-plus-00"/>
    <author initials="R." surname="Housley" fullname="Russ Housley">
      <organization abbrev="Vigil Security">Vigil Security, LLC</organization>
      <address>
        <email>housley@vigilsec.com</email>
      </address>
    </author>
    <author initials="S." surname="Fluhrer" fullname="Scott Fluhrer">
      <organization>Cisco Systems</organization>
      <address>
        <email>sfluhrer@cisco.com</email>
      </address>
    </author>
    <author initials="P." surname="Kampanakis" fullname="Panos Kampanakis">
      <organization>Amazon Web Services</organization>
      <address>
        <email>kpanos@amazon.com</email>
      </address>
    </author>
    <author initials="B." surname="Westerbaan" fullname="Bas Westerbaan">
      <organization>Cloudflare</organization>
      <address>
        <email>bas@westerbaan.name</email>
      </address>
    </author>
    <date year="2022" month="October" day="23"/>
    <area>Security</area>
    <keyword>Internet-Draft</keyword>
    <abstract>
      <t>SPHINCS+ is a stateless hash-based signature scheme.  This document
specifies the conventions for using the SPHINCS+ stateless hash-based
signature algorithm with the Cryptographic Message Syntax (CMS).  In
addition, the algorithm identifier and public key syntax are
provided.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>NOTICE: This document will be adjusted to match the SPHINCS+ specification
that is published by NIST.  Until that happens, just about everything in
this document is likely to change.</t>
      <t>This document specifies the conventions for using the SPHINCS+ hash-based
signature algorithm (add reference to the NIST document here)
with the Cryptographic Message Syntax (CMS) <xref target="RFC5652"/>
signed-data content type.</t>
      <t>SPHINCS+ offers three security levels.  The parameters for each of the
security levels were chosen to provide 128 bits of security, 192 bits of
security, and 256 bits of security.  A separate algorithm identifier has
been assigned for SPHINCS+ at each of these security levels.</t>
      <t>SPHINCS+ is a stateless hash-based signature algorithm.  Other hash-based
signature algorithms are stateful, including HSS/LMS <xref target="RFC8554"/> and
XMSS <xref target="RFC8391"/>.  Without the need for state kept by the signer,
SPHINCS+ is much less fragile.</t>
      <section anchor="asn1">
        <name>ASN.1</name>
        <t>CMS values are generated using ASN.1 <xref target="X680"/>, using the Basic
Encoding Rules (BER) and the Distinguished Encoding Rules
(DER) <xref target="X690"/>.</t>
      </section>
      <section anchor="motivation">
        <name>Motivation</name>
        <t>There have been recent advances in cryptanalysis and advances in the
development of quantum computers.  Each of these advances pose a
threat to widely deployed digital signature.</t>
        <t>If large-scale quantum computers are ever built, they will be able to
break many of the public-key cryptosystems currently in use, including
RSA, DSA, ECDSA, and EdDSA.  A post-quantum cryptosystem (PQC) is secure
against quantum computers that have more than a trivial number of quantum
bits (qu-bits).  It is open to conjecture when it will be feasible to build
such quantum computers; however, it is prudent to use cryptographic
algorithms that remain secure if a large-scale quantum computer is
invented.  SPHINCS+ is a PQC signature algorithm.</t>
        <t>One use of a PQC signature algoritm is the protection of software
updates, perhaps using the format described in <xref target="RFC4108"/>, to enable
deployment of software that implements other new PQC algorithms for
key management and confidentiality.</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 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      </section>
    </section>
    <section anchor="sphincs-hash-based-signature-algorithm-overview">
      <name>SPHINCS+ Hash-based Signature Algorithm Overview</name>
      <t>SPHINCS+ is a hash-based signature scheme which consists of a few
time signature construction, namely Forest of Random Subsets (FORS)
and a hypertree. FORS signs a message with a private key. The
corresponding FORS public keys are the leaves in k binary trees.
The roots of these trees are hashed together to form a FORS root.
SPHINCS+ uses a one-time signature scheme called WOTS+. The FORS
tree roots are signed by a WOTS+ one-time signature private
key. The corresponding WOTS+ public keys form the leaves in d-layers
of Merkle subtrees in the SPHINCS+ hypertree. The bottom layer of
that hypertree signs the FORS roots with WOTS+. The root of the
bottom Merkle subtrees are then signed with WOTS+ and the
corresponding WOTS+ public keys form the leaves of the next level up
subtree. Subtree roots are consequently signed by their corresponding
subtree layers until we reach the top subtree. The top layer subtree
forms the hypertree root which is trusted at the verifier.</t>
      <t>A SPHINCS+ signature consists of the FORS signature, the WOTS+
signature in each layer and the path to the root of each subtree
until we reach the root of the hypertree.</t>
      <t>A SPHINCS+ signature is verified by verifying the FORS signature, the
WOTS+ signatures and the path to the root of each subtree. When reaching
the root of the hypertree, the signature verifies only if it hashes to
the pre-trusted root of the SPHINCS+ hypertree.</t>
      <t>SPHINCS+ is a stateless hash-based signature algorithm. Stateful
hash-based signature schemes require that the WOTS+ private key
(generated by using a state index) is never reused or the scheme
loses it security. Although its security decreases, FORS which is
used at the bottom of the SPHINCS+ hypertree does not collapse if
the same private key used to sign two or more different messages
like in stateful hash-based signature schemes. Without the need for
state kept by the signer to ensure it is not reused, SPHINCS+
is much less fragile.</t>
      <t>SPHINCS+ was designed to sign up to 2^64 messages and
offers three security levels. The parameters of the
SPHINCS+ hypertree include the security parameter,
the hash function, the tree height, the number of
layers of subtrees, the Winternitz parameter of WOTS+,
the number of FORS trees and leaves in each. The
parameters for each of the security levels were
chosen to provide 128 bits of security, 192 bits
of security, and 256 bits of security.</t>
    </section>
    <section anchor="sphincs-public-key-identifier">
      <name>SPHINCS+ Public Key Identifier</name>
      <t>The AlgorithmIdentifier for a SPHINCS+ public key <bcp14>MUST</bcp14> use one of the
id-alg-sphincs-plus object identifiers listed below, based on the
security level used to generate the SPHINCS+ hypertree.  The parameters
field of the AlgorithmIdentifier for the SPHINCS+ public key <bcp14>MUST</bcp14> be absent.</t>
      <t>When this AlgorithmIdentifier appears in the SubjectPublicKeyInfo field of
an X.509 certificate <xref target="RFC5280"/>, the certificate key usage extension <bcp14>MAY</bcp14>
contain digitalSignature, nonRepudiation, keyCertSign, and cRLSign; the
certificate key usage extension <bcp14>MUST NOT</bcp14> contain other values.</t>
      <artwork><![CDATA[
   pk-sphincs-plus-128 PUBLIC-KEY ::= {
       IDENTIFIER id-alg-sphincs-plus-128
       KEY SPHINCS-Plus-PublicKey
       PARAMS ARE absent
       CERT-KEY-USAGE
         { digitalSignature, nonRepudiation, keyCertSign, cRLSign } }

   pk-sphincs-plus-192 PUBLIC-KEY ::= {
       IDENTIFIER id-alg-sphincs-plus-192
       KEY SPHINCS-Plus-PublicKey
       PARAMS ARE absent
       CERT-KEY-USAGE
         { digitalSignature, nonRepudiation, keyCertSign, cRLSign } }

   pk-sphincs-plus-256 PUBLIC-KEY ::= {
       IDENTIFIER id-alg-sphincs-plus-256
       KEY SPHINCS-Plus-PublicKey
       PARAMS ARE absent
       CERT-KEY-USAGE
         { digitalSignature, nonRepudiation, keyCertSign, cRLSign } }

   SPHINCS-Plus-PublicKey ::= OCTET STRING
]]></artwork>
      <t>NOTE: The values for these object identifiers will be assigned by NIST.
Once assigned, they will be added to a future revision of this document.</t>
      <t>The SPHINCS+ public key value is an OCTET STRING.</t>
    </section>
    <section anchor="signed-data-conventions">
      <name>Signed-data Conventions</name>
      <t>As specified in CMS <xref target="RFC5652"/>, the digital signature is produced from
the message digest and the signer's private key.  The signature is computed
over different values depending on whether signed attributes are absent or
present.</t>
      <t>When signed attributes are absent, the SPHINCS+ signature is computed over
the content.  When signed attributes are present, a hash is computed over
the content using the same hash function that is used in the SPHINCS+ tree,
and then a message-digest attribute is constructed to contain the resulting
hash value, and then the result of DER encoding the set of signed attributes,
which <bcp14>MUST</bcp14> include a content-type attribute and a message-digest attribute,
and then the SPHINCS+ signature is computed over the DER-encoded output.
In summary:</t>
      <artwork><![CDATA[
   IF (signed attributes are absent)
   THEN SPHINCS+_Sign(content)
   ELSE message-digest attribute = Hash(content);
        SPHINCS+_Sign(DER(SignedAttributes))
]]></artwork>
      <t>When using SPHINCS+, the fields in the SignerInfo are used as follows:</t>
      <dl newline="true">
        <dt>
digestAlgorithm:  </dt>
        <dd>
          <t>The digestAlgorithm <bcp14>MUST</bcp14> contain the one-way hash
function used to in the SPHINCS+ tree.  The algorithm identifiers for
<xref target="FIPS180"/> and <xref target="FIPS202"/> are repeated below for convenience.</t>
        </dd>
      </dl>
      <artwork><![CDATA[
      mda-sha256 DIGEST-ALGORITHM ::= {
        IDENTIFIER id-sha256
        PARAMS TYPE NULL ARE preferredAbsent }

      mda-shake256 DIGEST-ALGORITHM ::= {
        IDENTIFIER id-shake256
        PARAMS TYPE NULL ARE preferredAbsent }

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

      id-shake256 OBJECT IDENTIFIER ::= { hashAlgs 12 }
]]></artwork>
      <dl newline="true">
        <dt>
signatureAlgorithm:  </dt>
        <dd>
          <t>The signatureAlgorithm <bcp14>MUST</bcp14> contain one of the the SPHINCS+ algorithm
identifiers, and the algorithm parameters field <bcp14>MUST</bcp14> be absent.  The
algorithm identifier <bcp14>MUST</bcp14> be one of the following: 
id-alg-sphincs-plus-128, id-alg-sphincs-plus-192, or
id-alg-sphincs-plus-256.</t>
        </dd>
        <dt>
signature:  </dt>
        <dd>
          <t>The signature contains the signature value resulting from the
SPHINCS+ signing operation with the parameters associated with the
selected signatureAlgorithm.  The SPHINCS+ signing operation and the
signature verification operation are specified in TBD.</t>
        </dd>
      </dl>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>Implementations <bcp14>MUST</bcp14> protect the private keys.  Compromise of the
private keys may result in the ability to forge signatures.</t>
      <t>When generating an SPHINCS+ key pair, an implementation <bcp14>MUST</bcp14> generate
each key pair independently of all other key pairs in the SPHINCS+
hypertree.</t>
      <t>A SPHINCS+ tree <bcp14>MUST NOT</bcp14> be used for more than 2^64 signing operations.</t>
      <t>The generation of private keys relies on random numbers.  The use
of inadequate pseudo-random number generators (PRNGs) to generate
these values can result in little or no security.  An attacker may
find it much easier to reproduce the PRNG environment that produced
the keys, searching the resulting small set of possibilities, rather
than brute force searching the whole key space.  The generation of
quality random numbers is difficult, and <xref target="RFC4086"/> offers
important guidance in this area.</t>
      <t>When computing signatures, the same hash function <bcp14>SHOULD</bcp14> be used to
compute the message digest of the content and the signed attributes, if
they are present.</t>
      <t>When computing signatures, implementations <bcp14>SHOULD</bcp14> include protections against
fault injection attacks <xref target="CMP2018"/>.  Protections against these attacks
include signature verification prior to releasing the signature value to
confirm that no error injected and generating the signature a few times to
confirm that the same signature value is produced each time.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>TBD</t>
    </section>
    <section anchor="acknowledgements">
      <name>Acknowledgements</name>
      <t>Thanks to Mike Ounsworth for his careful review and constructive comments.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <reference anchor="RFC5280" target="https://www.rfc-editor.org/info/rfc5280">
          <front>
            <title>Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile</title>
            <author fullname="D. Cooper" initials="D." surname="Cooper">
              <organization/>
            </author>
            <author fullname="S. Santesson" initials="S." surname="Santesson">
              <organization/>
            </author>
            <author fullname="S. Farrell" initials="S." surname="Farrell">
              <organization/>
            </author>
            <author fullname="S. Boeyen" initials="S." surname="Boeyen">
              <organization/>
            </author>
            <author fullname="R. Housley" initials="R." surname="Housley">
              <organization/>
            </author>
            <author fullname="W. Polk" initials="W." surname="Polk">
              <organization/>
            </author>
            <date month="May" year="2008"/>
            <abstract>
              <t>This memo profiles the X.509 v3 certificate and X.509 v2 certificate revocation list (CRL) for use in the Internet.  An overview of this approach and model is provided as an introduction.  The X.509 v3 certificate format is described in detail, with additional information regarding the format and semantics of Internet name forms.  Standard certificate extensions are described and two Internet-specific extensions are defined.  A set of required certificate extensions is specified.  The X.509 v2 CRL format is described in detail along with standard and Internet-specific extensions.  An algorithm for X.509 certification path validation is described.  An ASN.1 module and examples are provided in the appendices.  [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5280"/>
          <seriesInfo name="DOI" value="10.17487/RFC5280"/>
        </reference>
        <reference anchor="RFC5652" target="https://www.rfc-editor.org/info/rfc5652">
          <front>
            <title>Cryptographic Message Syntax (CMS)</title>
            <author fullname="R. Housley" initials="R." surname="Housley">
              <organization/>
            </author>
            <date month="September" year="2009"/>
            <abstract>
              <t>This document describes the Cryptographic Message Syntax (CMS).  This syntax is used to digitally sign, digest, authenticate, or encrypt arbitrary message content.  [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="70"/>
          <seriesInfo name="RFC" value="5652"/>
          <seriesInfo name="DOI" value="10.17487/RFC5652"/>
        </reference>
        <reference anchor="X680" target="https://www.itu.int/rec/T-REC-X.680">
          <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="X690" target="https://www.itu.int/rec/T-REC-X.690">
          <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>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner">
              <organization/>
            </author>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba">
              <organization/>
            </author>
            <date month="May" year="2017"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol  specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the  defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references>
        <name>Informative References</name>
        <reference anchor="RFC4086" target="https://www.rfc-editor.org/info/rfc4086">
          <front>
            <title>Randomness Requirements for Security</title>
            <author fullname="D. Eastlake 3rd" initials="D." surname="Eastlake 3rd">
              <organization/>
            </author>
            <author fullname="J. Schiller" initials="J." surname="Schiller">
              <organization/>
            </author>
            <author fullname="S. Crocker" initials="S." surname="Crocker">
              <organization/>
            </author>
            <date month="June" year="2005"/>
            <abstract>
              <t>Security systems are built on strong cryptographic algorithms that foil pattern analysis attempts.  However, the security of these systems is dependent on generating secret quantities for passwords, cryptographic keys, and similar quantities.  The use of pseudo-random processes to generate secret quantities can result in pseudo-security. A sophisticated attacker may find it easier to reproduce the environment that produced the secret quantities and to search the resulting small set of possibilities than to locate the quantities in the whole of the potential number space.</t>
              <t>Choosing random quantities to foil a resourceful and motivated adversary is surprisingly difficult.  This document points out many pitfalls in using poor entropy sources or traditional pseudo-random number generation techniques for generating such quantities.  It recommends the use of truly random hardware techniques and shows that the existing hardware on many systems can be used for this purpose. It provides suggestions to ameliorate the problem when a hardware solution is not available, and it gives examples of how large such quantities need to be for some applications.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="106"/>
          <seriesInfo name="RFC" value="4086"/>
          <seriesInfo name="DOI" value="10.17487/RFC4086"/>
        </reference>
        <reference anchor="RFC4108" target="https://www.rfc-editor.org/info/rfc4108">
          <front>
            <title>Using Cryptographic Message Syntax (CMS) to Protect Firmware Packages</title>
            <author fullname="R. Housley" initials="R." surname="Housley">
              <organization/>
            </author>
            <date month="August" year="2005"/>
            <abstract>
              <t>This document describes the use of the Cryptographic Message Syntax (CMS) to protect firmware packages, which provide object code for one or more hardware module components.  CMS is specified in RFC 3852.  A digital signature is used to protect the firmware package from undetected modification and to provide data origin authentication. Encryption is optionally used to protect the firmware package from disclosure, and compression is optionally used to reduce the size of the protected firmware package.  A firmware package loading receipt can optionally be generated to acknowledge the successful loading of a firmware package.  Similarly, a firmware package load error report can optionally be generated to convey the failure to load a firmware package.  [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="4108"/>
          <seriesInfo name="DOI" value="10.17487/RFC4108"/>
        </reference>
        <reference anchor="RFC5911" target="https://www.rfc-editor.org/info/rfc5911">
          <front>
            <title>New ASN.1 Modules for Cryptographic Message Syntax (CMS) and S/MIME</title>
            <author fullname="P. Hoffman" initials="P." surname="Hoffman">
              <organization/>
            </author>
            <author fullname="J. Schaad" initials="J." surname="Schaad">
              <organization/>
            </author>
            <date month="June" year="2010"/>
            <abstract>
              <t>The Cryptographic Message Syntax (CMS) format, and many associated formats, are expressed using ASN.1.  The current ASN.1 modules conform to the 1988 version of ASN.1.  This document updates those ASN.1 modules to conform to the 2002 version of ASN.1.  There are no bits-on-the-wire changes to any of the formats; this is simply a change to the syntax.  This document is not an Internet Standards Track  specification; it is published for informational purposes.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5911"/>
          <seriesInfo name="DOI" value="10.17487/RFC5911"/>
        </reference>
        <reference anchor="RFC8554" target="https://www.rfc-editor.org/info/rfc8554">
          <front>
            <title>Leighton-Micali Hash-Based Signatures</title>
            <author fullname="D. McGrew" initials="D." surname="McGrew">
              <organization/>
            </author>
            <author fullname="M. Curcio" initials="M." surname="Curcio">
              <organization/>
            </author>
            <author fullname="S. Fluhrer" initials="S." surname="Fluhrer">
              <organization/>
            </author>
            <date month="April" year="2019"/>
            <abstract>
              <t>This note describes a digital-signature system based on cryptographic hash functions, following the seminal work in this area of Lamport, Diffie, Winternitz, and Merkle, as adapted by Leighton and Micali in 1995.  It specifies a one-time signature scheme and a general signature scheme.  These systems provide asymmetric authentication without using large integer mathematics and can achieve a high security level.  They are suitable for compact implementations, are relatively simple to implement, and are naturally resistant to side-channel attacks.  Unlike many other signature systems, hash-based signatures would still be secure even if it proves feasible for an attacker to build a quantum computer.</t>
              <t>This document is a product of the Crypto Forum Research Group (CFRG) in the IRTF.  This has been reviewed by many researchers, both in the research group and outside of it.  The Acknowledgements section lists many of them.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8554"/>
          <seriesInfo name="DOI" value="10.17487/RFC8554"/>
        </reference>
        <reference anchor="RFC8391" target="https://www.rfc-editor.org/info/rfc8391">
          <front>
            <title>XMSS: eXtended Merkle Signature Scheme</title>
            <author fullname="A. Huelsing" initials="A." surname="Huelsing">
              <organization/>
            </author>
            <author fullname="D. Butin" initials="D." surname="Butin">
              <organization/>
            </author>
            <author fullname="S. Gazdag" initials="S." surname="Gazdag">
              <organization/>
            </author>
            <author fullname="J. Rijneveld" initials="J." surname="Rijneveld">
              <organization/>
            </author>
            <author fullname="A. Mohaisen" initials="A." surname="Mohaisen">
              <organization/>
            </author>
            <date month="May" year="2018"/>
            <abstract>
              <t>This note describes the eXtended Merkle Signature Scheme (XMSS), a hash-based digital signature system that is based on existing descriptions in scientific literature.  This note specifies Winternitz One-Time Signature Plus (WOTS+), a one-time signature scheme; XMSS, a single-tree scheme; and XMSS^MT, a multi-tree variant of XMSS.  Both XMSS and XMSS^MT use WOTS+ as a main building block. XMSS provides cryptographic digital signatures without relying on the conjectured hardness of mathematical problems.  Instead, it is proven that it only relies on the properties of cryptographic hash functions.  XMSS provides strong security guarantees and is even secure when the collision resistance of the underlying hash function is broken.  It is suitable for compact implementations, is relatively simple to implement, and naturally resists side-channel attacks. Unlike most other signature systems, hash-based signatures can so far withstand known attacks using quantum computers.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8391"/>
          <seriesInfo name="DOI" value="10.17487/RFC8391"/>
        </reference>
        <reference anchor="FIPS180">
          <front>
            <title>Secure Hash Standard (SHS)</title>
            <author>
              <organization>National Institute of Standards and Technology (NIST)</organization>
            </author>
            <date year="2015" month="August"/>
          </front>
          <seriesInfo name="FIPS PUB" value="180-4"/>
        </reference>
        <reference anchor="FIPS202">
          <front>
            <title>SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions</title>
            <author>
              <organization>National Institute of Standards and Technology (NIST)</organization>
            </author>
            <date year="2015" month="August"/>
          </front>
          <seriesInfo name="FIPS PUB" value="202"/>
        </reference>
        <reference anchor="CMP2018" target="https://link.springer.com/chapter/10.1007/978-3-319-79063-3_8">
          <front>
            <title>Grafting Trees: A Fault Attack Against the SPHINCS Framework</title>
            <author initials="L." surname="Castelnovi" fullname="Laurent Castelnovi">
              <organization/>
            </author>
            <author initials="" surname="A, Martinelli" fullname="Ange Martinelli">
              <organization/>
            </author>
            <author initials="T." surname="Prest" fullname="Thomas Prest">
              <organization/>
            </author>
            <date year="2018"/>
          </front>
          <seriesInfo name="Post-Quantum Cryptography" value="pp. 165-184"/>
          <seriesInfo name="PQCrypto" value="2018"/>
          <seriesInfo name="Lecture Notes in Computer Science" value="vol 10786"/>
        </reference>
      </references>
    </references>
    <section anchor="appendix-asn1-module">
      <name>Appendix: ASN.1 Module</name>
      <t>This ASN.1 Module builds upon the conventions established in <xref target="RFC5911"/>.</t>
      <sourcecode type="asn.1"><![CDATA[
<CODE STARTS>

SPHINCS-Plus-Module-2022
  { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9)
    id-smime(16) id-mod(0) id-mod-sphincs-plus-2022(TBD) }

DEFINITIONS IMPLICIT TAGS ::= BEGIN

EXPORTS ALL;

IMPORTS
  PUBLIC-KEY, SIGNATURE-ALGORITHM, SMIME-CAPS
    FROM AlgorithmInformation-2009  -- RFC 5911
      { iso(1) identified-organization(3) dod(6) internet(1)
        security(5) mechanisms(5) pkix(7) id-mod(0)
        id-mod-algorithmInformation-02(58) } ;

--
-- Object Identifiers
--

id-alg-sphincs-plus-128 OBJECT IDENTIFIER ::= { TBD }

id-alg-sphincs-plus-192 OBJECT IDENTIFIER ::= { TBD }

id-alg-sphincs-plus-256 OBJECT IDENTIFIER ::= { TBD }

--
-- Signature Algorithm and Public Key
--

sa-sphincs-plus-128 SIGNATURE-ALGORITHM ::= {
    IDENTIFIER id-alg-sphincs-plus-128
    PARAMS ARE absent
    PUBLIC-KEYS { pk-sphincs-plus-128 }
    SMIME-CAPS { IDENTIFIED BY id-alg-sphincs-plus-128 } }

sa-sphincs-plus-192 SIGNATURE-ALGORITHM ::= {
    IDENTIFIER id-alg-sphincs-plus-192
    PARAMS ARE absent
    PUBLIC-KEYS { pk-sphincs-plus-192 }
    SMIME-CAPS { IDENTIFIED BY id-alg-sphincs-plus-192 } }

sa-sphincs-plus-256 SIGNATURE-ALGORITHM ::= {
    IDENTIFIER id-alg-sphincs-plus-256
    PARAMS ARE absent
    PUBLIC-KEYS { pk-sphincs-plus-256 }
    SMIME-CAPS { IDENTIFIED BY id-alg-sphincs-plus-256 } }

pk-sphincs-plus-128 PUBLIC-KEY ::= {
    IDENTIFIER id-alg-sphincs-plus-128
    KEY SPHINCS-Plus-PublicKey
    PARAMS ARE absent
    CERT-KEY-USAGE
        { digitalSignature, nonRepudiation, keyCertSign, cRLSign } }

pk-sphincs-plus-192 PUBLIC-KEY ::= {
    IDENTIFIER id-alg-sphincs-plus-192
    KEY SPHINCS-Plus-PublicKey
    PARAMS ARE absent
    CERT-KEY-USAGE
        { digitalSignature, nonRepudiation, keyCertSign, cRLSign } }

pk-sphincs-plus-256 PUBLIC-KEY ::= {
    IDENTIFIER id-alg-sphincs-plus-256
    KEY SPHINCS-Plus-PublicKey
    PARAMS ARE absent
    CERT-KEY-USAGE
        { digitalSignature, nonRepudiation, keyCertSign, cRLSign } }

SPHINCS-Plus-PublicKey ::= OCTET STRING

--
-- Expand the signature algorithm set used by CMS [RFC5911]
--

SignatureAlgorithmSet SIGNATURE-ALGORITHM ::=
    { sa-sphincs-plus-128 |
      sa-sphincs-plus-192 |
      sa-sphincs-plus-256,
      ... }

--
-- Expand the S/MIME capabilities set used by CMS [RFC5911]
--

SMimeCaps SMIME-CAPS ::=
    { sa-sphincs-plus-128.&smimeCaps |
      sa-sphincs-plus-192.&smimeCaps |
      sa-sphincs-plus-256.&smimeCaps,
      ... }
     
END

<CODE ENDS>
]]></sourcecode>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAKtMVWMAA9Vb63LbRpb+30/Rq1StqR2CJmXLlpRJKjRF2dzoFpLeJDU1
mwKBpogIBBA0IJrxOs+yz7J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