<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced. 
     An alternate method (rfc include) is described in the references. -->
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC9528 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.9528.xml">
<!ENTITY RFC9794 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.9794.xml">
<!ENTITY RFC9052 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.9052.xml">
<!ENTITY RFC9360 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.9360.xml">
<!ENTITY RFC8392 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8392.xml">
<!ENTITY RFC8949 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8949.xml">
<!ENTITY RFC8742 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8742.xml">
<!ENTITY RFC9053 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.9053.xml">
<!ENTITY RFC5116 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5116.xml">
<!ENTITY RFC7252 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7252.xml">
<!ENTITY RFC7959 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7959.xml">
<!ENTITY RFC9177 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.9177.xml">
<!ENTITY I-D.celi-wiggers-tls-authkem SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.celi-wiggers-tls-authkem.xml">
<!ENTITY I-D.uri-lake-pquake SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.uri-lake-pquake.xml">
<!ENTITY I-D.ietf-pquip-pqc-engineers SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-pquip-pqc-engineers.xml">
<!ENTITY I-D.ietf-lamps-kyber-certificates SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-lamps-kyber-certificates.xml">
<!ENTITY I-D.spm-lake-pqsuites SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.spm-lake-pqsuites.xml">
]>


<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="no" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes"?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="no"?>
<!-- Start each main section on a new page -->
<?rfc subcompact="no"?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-pocero-authkem-edhoc-02" ipr="trust200902">
  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN" 
     they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->
  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
         full title is longer than 39 characters -->

    <!--<title>Post-Quantum Ephemeral Diffie-Hellman Over COSE (PQ-EDHOC)</title>-->
  <title>KEM-based Authentication for EDHOC</title>
    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->
  <author fullname="Lidia Pocero Fraile" initials="L." surname="Pocero Fraile">
    <organization>ISI, R.C. ATHENA</organization>
    <address>
      <postal>
        <street>Cyber-physical and Networked Embedded Systems</street>
        <!-- Reorder these if your country does things differently -->
        <city>Patras</city>
        <region/>
        <code>26504</code>
        <country>Greece</country>
      </postal>
      <email>pocero@isi.gr</email>
				<!-- uri and facsimile elements may also be added -->
			</address>
	</author>
  <author fullname="Christos Koulamas" initials="C." surname="Koulamas">
    <organization>ISI, R.C. ATHENA</organization>
    <address>
      <postal>
        <street>Cyber-physical and Networked Embedded Systems</street>
        <!-- Reorder these if your country does things differently -->
        <city>Patras</city>
        <region/>
        <code>26504</code>
        <country>Greece</country>
      </postal>
      <email>koulamas@isi.gr</email>
				<!-- uri and facsimile elements may also be added -->
			</address>
	</author>
  <author fullname="Apostolos P. Fournaris" initials="A.P" surname="Fournaris">
    <organization>ISI, R.C. ATHENA</organization>
    <address>
      <postal>
        <street>Security and Protection of Systems, Networks and Infrastructures</street>
        <!-- Reorder these if your country does things differently -->
        <city>Patras</city>
        <region/>
        <code>26504</code>
        <country>Greece</country>
      </postal>
      <email>fournaris@isi.gr</email>
				<!-- uri and facsimile elements may also be added -->
			</address>
	</author>
	<author fullname="Evangelos Haleplidis" initials="E." surname="Haleplidis">
			<organization>ISI, R.C. ATHENA</organization>
			<address>
				<postal>
					<street>Department of Digital Systems</street>
					<!-- Reorder these if your country does things differently -->
					<city>Patras</city>
					<region/>
					<code>26504</code>
					<country>Greece</country>
				</postal>
				<email>haleplidis@isi.gr</email>
				<!-- uri and facsimile elements may also be added -->
			</address>
		</author>

	

    <date year="2026" />

    <area>sec</area>

    <workgroup>individual</workgroup>

    <keyword>EDHOC</keyword>
    <keyword>Post Quantum</keyword>

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
      <t>This document specifies extensions to the Ephemeral Diffie-Hellman over COSE (EDHOC) protocol to provide resistance against quantum computer adversaries by incorporating Post-Quantum Cryptography (PQC) mechanisms for both key exchange and authentication. It defines a Key Encapsulation Mechanism (KEM)-based authentication method to enable signature-free post-quantum authentication when PQC KEMs, such as NIST-standardized ML-KEM, are used. 
      The document further describes scenarios where both parties employ KEM-based authentication, as well as cases where authentication methods are combined, with one party using KEM-based authentication and the other relying on a PQC signature scheme.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
	<t>The purpose of this document is to address the quantum-resistant transition of the Ephemeral Diffie-Hellman over COSE (EDHOC) protocol by extending with a new Key Encapsulation Mechanism (KEM)-based authentication method and Post-Quantum Cryptography cipher suits. </t>  
  <t>The specified protocol is part of a broader analysis of the post-quantum transition for EDHOC <xref target="PQ-EDHOC-Access25"/>.  </t>
  <!--<t>This document follows the keyword use as specified in <xref target="RFC2119">RFC2119</xref>.</t>
  <t>The "t" tag means text paragraph. The list allows you to create lists. There are a couple of options for list styles:</t>
   <t>
   <list style ="letters">
      <t>symbols</t>
      <t>numbers</t>
      <t>letters</t>
      <t>hanging</t>
    </list>
  </t> -->
  <section title="Motivation">
  <t>The emerging Quantum Computing technologies bring new potential risks to the existing cryptographic infrastructures. Security mechanisms that rely on integer factorization or the discrete logarithm problem will be vulnerable to attacks by a Cryptographically Relevant Quantum Computer (CRQC). The European Commission recently issued a roadmap for the transition to Post-Quantum Cryptography (PQC), establishing a 2030 deadline for high-risk use cases and 2035 for medium-risk use cases, in alignment with the 2035 deadline set by the U.S. government for completing the transition to PQC in federal systems.</t>
  <t>The U.S. National Institute of Standards and Technology (NIST) has concluded its PQC standardization process with the release of its first standardized PQC algorithms in three new Federal Information Processing Standards (FIPS): FIPS 203 (ML-KEM, based on CRYSTALS-Kyber), FIPS 204 (ML-DSA, based on CRYSTALS-Dilithium), and FIPS 205 (SLH-DSA, based on SPHINCS+). Additionally, FALCON has been selected for future standardization, and NIST has launched a new initiative to evaluate alternative PQC signature schemes with compact signatures and efficient verification speeds. Complementing these efforts, the Post-Quantum Use in Protocols (PQUIC) IETF Working Group
    (WG) is developing operational and design guidelines to support the transition. For example, <xref target="RFC9794"></xref> defines terminology for post-quantum/traditional Hybrid schemes, while ongoings draft such as <xref target="I-D.ietf-pquip-pqc-engineers"></xref> analyze the impact of CRQCs on existing systems and the challenges involved in transitioning to post-quantum algorithms. </t> 
  <t>The growing urgency to transition to PQC highlights the need to adapt EDHOC, whose current security relies on traditional Elliptic-Curve Cryptography(ECC), based on the discrete logarithm problem that is known to be vulnerable to attacks by CRQCs. The integration of the PQC mechanism into EDHOC raises important considerations around performance, as the protocol is explicitly designed for constrained environments where the number of handshake message rounds, network overhead, processing time, and power consumption are critical factors.  </t>
  <t>PQC algorithms generally have higher computational and memory costs compared to the classical cryptography algorithms they aim to replace because they often involve complex calculations and require larger byte sizes. Notably, the PQC digital signature schemes standardized by NIST, such as ML-DSA and SLH-DSA, use significantly large public keys and signatures, which can be difficult to transmit over constrained networks. It is important to note that while FALCON, also selected for standardization by NIST, provides much shorter signatures than the lattice-based schemes, its current implementations have been shown to be vulnerable to side-channel attacks. The new compact schemes under NIST evaluation should be more suitable for constrained environments. However, the current Cortex-M4 implementations of some of the most compact PQC signature schemes, like SNOVA and MAYO, still demand substantial memory resources, making them impractical for many constrained devices. Additionally, others, such as SQISign, have only recently been supported on such platforms, and performance benchmarks for their signature operations are still unavailable. </t>
  <t>On the other hand, the standardized ML-KEM offers significantly higher computational efficiency compared to all other PQC KEMs (order of magnitude faster) and is at least three times more efficient than the fastest PQC signature schemes. Therefore, extending EDHOC with a new authentication method that enables a signature-free KEM-based EDHOC has the potential to reduce memory and processing requirements when ML-KEM is used. The approach can also result in lower network overhead compared to signature-based EDHOC implementations that rely on standardized PQC signature-based algorithms.</t>
  <t>Some standardization efforts propose adopting the KEM-based authentication mechanism to mitigate the overhead introduced by PQC digital signatures. For example, <xref target="I-D.celi-wiggers-tls-authkem"/> specifies a KEM-based authentication scheme for TLS 1.3, while   <xref target="I-D.uri-lake-pquake"/> aims to define a general Post-Quantum Authentication Key exchange protocoll, which based on the same approach. </t>
  <t>This document describes a KEM-based authentication mechanism specifically for the EDHOC protocol, introducing a new authentication method intended to provide a PQC signature-free variant as the static DH authentication method intends. The static-DH authentication of EDHOC is based on the XX pattern of the Noise framework protocol <xref target="Noise"/>, where channel security guarantees are increasingly established by encrypting transmitted messages with keys derived from chains of shared secrets, as soon as those secrets become available. To align with this model, the KEM-based authentication Method defined in this document follows the approach outlined in <xref target="PQNoise-CCS22"/>, which provides a recipe for transforming classical Noise patterns into PQ variants. This specification defines the necessary modifications to the EDHOC protocol to support the PQ-Noise framework while preserving security properties comparable to those of the static-DH authentication method. </t>
  <t> In addition to the scheme in which both parties use KEM-based authentication, providing a PQC signature-free alternative to static-DH authentication, 
  this document further extends EDHOC with two additional methods that provide combined authentication variants, combining KEM-based authentication with PQC signature-based authentication. 
  Together, these methods enable flexible post-quantum authentication options while maintaining the security properties of the original EDHOC design.
  </t>
  <t>
  This specification defines the simplest approach for extending combined authentication variants, in which the five-message handshake is maintained and authentication is performed in the last two messages, 
  as in the both-parties KEM-based authentication method. A more complex approach, which prioritizes authentication as early as possible,
  is presented in the <xref target="Appendix A"/>  to provide a discussion of alternative strategies and their relative advantages.
  </t>
  </section>
  <!--<section title="Document Structure">
	<t>The remainder of this document SHOULD be organized as follows. <xref target="Terminology"/> explains the terminology used in this document. <xref target="ProtoOverview"/> provides a high-level overview of the protocol. Finally, <xref target="Headers"/> provides the details of each protocol header.</t>
  </section>-->
  <section title="Terminology and Requirements Language">
    <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
  document are to be interpreted as described in <xref target="RFC2119" format="default">RFC2119</xref>.</t>

  <t>Readers are expected to be familiar with the terms and concepts described in EDHOC <xref target="RFC9528"/>, CBOR <xref target="RFC8949"/>, CBOR
 Sequences <xref target="RFC8742"/>, COSE Structures and Processing <xref target="RFC9052"/> and COSE Algorithms <xref target="RFC9053"/>, 
 When referring to CBOR, this specification always refers to Deterministically Encoded CBOR, as specified in 
 <xref target="RFC8949" section="4.2.1 and 4.2.2"/>. The single output from authenticated encryption (including the authentication tag) is called
 "ciphertext", following <xref target="RFC5116"/>. </t>
  
  	<section anchor="KEMs" title="Key Encapsulation Mechanisms (KEMs)">
	<t>The Key Encapsulation Mechanism consists of 3 algorithms:</t>
  <t>
	<list style="symbols">
    <t> <strong>( pk, sk ) &lt;- KEM.KeyGen( ) </strong>: The probabilistic key generation algorithm generates a KEM key pair consisting of a public encapsulation key ( pk ) and secret decapsulation key ( sk ). </t>
    <t> <strong>( ss , ct ) &lt;- KEM.Encapsulate( pk )</strong>: The probabilistic encapsulation algorithm takes as input a public encapsulation key ( pk ) and produces a shared secret ( ss ) and ciphertext ( ct ).  </t>
    <t> <strong>( ss ) &lt;- KEM.Decapsulate( ct, sk )</strong>: The decapsulation algorithm takes as input a secret encacpsulation key ( sk ) and produce a shared secret ( ss ). </t>
  </list></t>
    </section>
</section>
	</section>
	


<section anchor="ProtoOverview" title="Protocol Overview">
<t>This document defines a KEM-based authentication method for EDHOC in a general scenario where both parties may be mutually unknown. 
It aims to provide a free-signature authentication scheme as the static DH authentication EDHOC method 3 does,
which relies on the XX pattern from the Noise framework <xref target="Noise"/>, supporting mutual authentication and the transmission of encrypted public credentials.
The proposed protocol adopts the approach provided by <xref target="PQNoise-CCS22"/>
to transform the classical Noise XX pattern in EDHOC into a PQ Noise XX variant. This results in a quantum-resistant, KEM-only version of EDHOC when a PQC KEM is used.
</t> 
<t>
The PQ translation of the Noise XX pattern requires introducing up to one additional round trip. 
With KEMs, the owner of the static key cannot combine their static private key with the ephemeral public key belonging to the other party to immediately prove their identity in the next message, as is possible with DH. 
Instead, the party must first receive a ciphertext that encapsulates its static public key, generated by the peer, before it can authenticate itself.
This necessitates an additional key-confirmation message from the key owner, using the key derived from the encapsulated value.
</t>

<t>
The KEM-based authentication in EDHOC is extended by defining three new authentication methods:
method 4, in which both parties use KEM-based authentication; 
method 5, in which the Initiator employs KEM-based authentication and the Responder uses a PQC signature scheme;
and method 6, in which the Initiator uses a PQC signature scheme and the Responder employs KEM-based authentication.
To extend KEM-based authentication to support all this combinations of Initiator and Responder authentication, a message-flow-preserving approach is applied and specify in this document. 
This approach provides a unified message flow, maintaining the same number of messages for all KEM-based authentication method keeping a uniform message structure across them.
A second aproach, which prioritizes authenticating a party as soon as it become possible is describe in  <xref target="Appendix A"/> highlighting its advantage and disadvantages compared with the approach presented here.
<!--The message flows for each of these methods differ slightly and are shown in in <xref target="method4"/> , <xref target="method5"/> , and <xref target="method6"/>  for Methods 4, 5, and 6, respectively.
-->
</t>

<t>All three new methods extending KEM-based authentication in EDHOC consist of five mandatory messages (message_1, message_2, message_3, message_4, and message_5). 
<xref target="flow"/> illustrates the EDHOC message flow for these three methods, as well as the content of each message.  
An error message may also be exchanged between the Initiator (I) and the Responder (R).
Error handling and cipher suit negotiation mechanisms are the same as defined in <xref target="RFC9528" section="6"/>. All EDHOC messages are CBOR Sequences as specified in <xref target="RFC9528"></xref>. 
The protocol elements are introduced in this Section and in <xref target="messages"/>. Message formatting and processing are specified in <xref target="messages"/>.</t>



  <figure title="EDHOC Message Flow" anchor="flow"> 
      <artwork align="center"><![CDATA[
Initiator                                                   Responder
|               METHOD, SUITES_I, pk_eph, C_I, EAD_1                |
+------------------------------------------------------------------->
|                             message_1                             |
|                                                                   |
|               ct_eph, Enc( C_R, ID_CRED_R, EAD_2 )                |
<-------------------------------------------------------------------+
|                             message_2                             |
|                                                                   |
|                  AEAD( ID_CRED_I, EAD_3 ), ct_R?                  |
+------------------------------------------------------------------->
|                             message_3                             |
|                                                                   |
|                AEAD( EAD_4, Sig_R_or_MAC_2 ), ct_I?               |
<-------------------------------------------------------------------+
|                             message_4                             |
|                                                                   |
|                     AEAD( EAD_5, Sig_I_or_MAC_3 )                 |
+------------------------------------------------------------------->
|                             message_5                             |

]]></artwork></figure>

<t>
The parties exchange ephemeral keys from a PQC KEM and static public keys, either from the same PQC KEM as the ephemeral keys or from a PQC digital signature scheme, depending on the selected method, along with ciphertexts encapsulating these keys.  
They then compute shared secrets and pseudorandom keys (PRK), from which symmetric session keys are derived to encrypt elements in the intermediate handshake messages.  
All handshake messages include encrypted components protected with these derived session keys, offering varying levels of confidentiality and authenticity, except for the first message, which is sent in plaintext.
</t>
<t>The parties compute a shared secret session key, PRK_out, from which symmetric application keys are derived to protect application data. The Initiator derives these keys after receiving message_4, and the Responder after receiving message_5.</t>
<t>
  <list style="symbols">
  <t> pk_eph is the ephemeral KEM public key generated by the Initiator. </t>
  <t> ct_eph is the ephemeral ciphertext computed by the Responder with the KEM.encapsulation algorithm over the received ephemeral public key (pk_eph). </t>
  <t> ct_R is the responder ciphertext computed by the Initiator with the KEM.encapsulation algorithm over the static KEM public key of the Responder, retrieved from the received ID_CRED_R in message_2. 
  This value is used in authentication Methods 4 and 6, where the Responder employs KEM-based authentication.
  </t> 
  <t> ct_I is the Iniatiator ciphertext computed by the Responder with the KEM.encapsulation algorithm over the static KEM public key of the Initiator, retrieved from the received ID_CRED_I in message_1. 
  This value is used in authentication Methods 4 and 5, where the Initiator employs KEM-based authentication.
  </t> 
  <t> "CRED_I and CRED_R are the authentication credentials containing the public authentication keys of I and R, respectively", as defined in  <xref target="RFC9528" section="2"/>. </t>
  <t> "ID_CRED_I and ID_CRED_R are used to identify and optionally transport the credentials of I and R, respectively", as defined in <xref target="RFC9528" section="2"/>.</t>
  <t> Sig_I and Sig_R denote signatures made with the private authentication key from a PQC digital signature algorithm selected of I and R, respectively. 
  Sig_I is used when the Initiator employs PQC signature-based authentication in the method 6, and Sig_R is used when the Responder employs PQC signature-based authentication in the method 5.</t>
  <t> "Enc(), AEAD(), and MAC() denote encryption, Authenticated Encryption with Associated Data, and Message Authentication Code, crypto algorithms applied with keys derived from one or more shared secrets calculated during the protocol", as defined in <xref target="RFC9528" section="2"/>.</t>
  <t> "SUITES_I contains cipher suites supported by the Initiator and formatted and processed as specified in <xref target="RFC9528" section="3.6 and 6.3.2"/>". </t>
  <t> "METHOD is an integer specifying the authentication method",as defined in <xref target="RFC9528" section="3.2"/>. In this case method 4 5 or 6; see <xref target="Method"/>. </t>
  <t> C_I and C_R are Connection Identifiers chosen by the Initiator and Responder, respectively, as specified in <xref target="RFC9528" section="3.3"/> .</t>
  <t> EAD_1, EAD_2, EAD_3, EAD_4, EAD_5 are External Authorization Data included in message_1, message_2, message_3, message_4 and message_5 respectively. </t>
 </list>
</t>  
<t> This protocol is designed so that it follows the provisions of <xref target="RFC9528"/>, that is, to encrypt and integrity protect as much information as possible and derive symmetric keys and random material using EDHOC_KDF with as much previous information as possible</t> 
<section anchor="ProtoElemnts" title="Protocol Elements">
<t>This section describes the principal protocol elements that differ from the definitions of EDHOC and highlights the most important similarities. For the missing elements, the definitions in <xref target="RFC9528" section="3"/> SHOULD be consulted.</t>
	<section anchor="EphemeralKEM" title="Ephemeral KEM">
  <t>The ephemeral KEM provides forward secrecy for the three authentication methods (Methods 4, 5, and 6) described in this document, for both the mutual KEM-based authentication method and the combined authentication variants.
  The Initiator generates a new ephemeral KEM key pair in every new session to ensure that the compromise of long-term keys does not compromise past communications. 
  The elements of the Ephemeral KEM are:</t>
  <t>
  <list style="symbols">
  <t> The ephemeral KEM key pair ( pk_eph, sk_eph ) is generated by the Initiator using the following function:
  <artwork align="left">
pk_eph, sk_eph &lt;- KEM.KeyGen()
  </artwork>
  </t>
  <t>The ephemeral shared secret ( ss_eph ) and the ephemeral ciphertext ( ct_eph ) are generated using the encapsulation and decapsulation functions:
   in the Responder
  <artwork align="left">
ss_eph, ct_eph &lt;-  KEM.Encapsulate( pk_eph ) 
    </artwork>  
  in the Initiator  
  <artwork align="left">
ss_eph &lt;-  KEM.decapsulation( ct_eph, sk_eph )
    </artwork>    </t>
  </list>
 </t> 

</section> 
<section anchor="Method" title="Method">
<t>
The protocol extends EDHOC by introducing three new authentication methods.
When both parties use static KEM key pairs, authentication method 4 is used. In this case, authentication is achieved using a Message Authentication Code (MAC) 
computed from an ephemeral-static shared secret. This MAC is included in message_4 and message_5 to authenticate the Responder and the Initiator, respectively.
Methods 5 and 6 correspond to combined authentication modes, where one party uses a static KEM key pair and the other uses a PQC signature scheme.
The Initiator and Responder must agree on the authentication method to be used. The selected method is indicated by the Initiator in message_1.</t>
        <table anchor="tab-method-types" align="center" >
          <name slugifiedName="name-authentication-keys-for-met">Authentication Keys for Method Types</name>
          <thead>
            <tr>
              <th align="left">Method Type Value</th>
              <th align="left">Initiator Authentication Key</th>
              <th align="left">Responder Authentication Key</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="right">4</td>
              <td align="left">Static KEM Key</td>
              <td align="left">Static KEM Key</td>
            </tr>
              <tr>
              <td align="right">5</td>
              <td align="left">Static KEM Key</td>
              <td align="left">PQC Signature</td>
            </tr>
              <tr>
              <td align="right">6</td>
              <td align="left">PQC Signature</td>
              <td align="left">Static KEM Key</td>
            </tr>
          </tbody>
        </table>
</section>
<section anchor="AuthneticationPara" title="Authentication Parameters">
<t> The protocol performs the same authentication-related operations as described in <xref target="RFC9528" section="3.5"/> </t>
 <!--<t> The protocol performs the following authentication-related operations: </t>
  <t>
  <list style="symbols">
  <t>The protocol transports information about credentials in ID_CRED_I and ID_CRED_R. 
  Based on this information, the authentication credentials CRED_I and CRED_R can be obtained. 
  It may also transport certain authentication-related information as external authorization data. As in <xref target="RFC9528"/></t>
  <t> The protocol uses the authentication credentials in two ways:
   <list style="symbols">
   <t>The authentication credential is input to the integrity verification using the MAC fields.</t>
   <t> The authentication key of the authentication credential is used with the MAC field to verify proof-of-possession of the private key.</t>
  </list>
  </t>
   </list>
  </t>-->
<t> The protocol transports information about credentials ID_CRED_I and ID_CRED_R in message_2 and message_3, respectively. 
The authentication of these credentials is verified through Sig_R_or_MAC_2 and Sig_I_or_MAC_3, sent by the Responder and the Initiator in message_4 and message_5, respectively.
<list style="symbols">
<t>If the Responder uses KEM-based authentication (methods 4 or 6), it sends MAC_2. If it authenticates using a PQC signature key (method 5), it sends a signature over MAC_2 using the PQC algorithm selected on the cipher suit.</t>
<t>Similarly, if the Initiator uses KEM-based authentication (methods 4 or 5), it sends MAC_3. If it authenticates with a PQC signature key (method 6), it sends a signature over MAC_3 using the PQC signature algorithm selected on the cipher suit</t>
</list>
</t>

<section anchor="Auth-keys" title="Authentication Keys">
<t> The authentication key MUST be a static KEM authentication key or a PQC signature key. 
The Initiator and Responder use KEM authentication keys with method 4, and different types of authentication keys with methods 5 and 6.</t>
<t>
The authentication key algorithm must be compatible with the chosen method and selected cipher suite. When either party uses KEM-based authentication, 
the same KEM algorithm selected for the EDHOC key exchange in the cipher suite MUST be used for both the ephemeral KEM key exchange and the authentication static KEM keys.
When using static KEM keys, the Initiator&rsquo;s and Responder&rsquo;s private and public authentication keys are denoted as follows:
  <list style="symbols">
  <t> The Initiator static KEM authentication key pair: ( pk_I, sk_I )</t>
  <t> The Responder static KEM authentication key pair: ( pk_R, sk_R )</t>
  </list>
  </t>
<t>When PQC signature authentication is used, the authentication key algorithm MUST be compatible with the EDHOC signature algorithm selected in the cipher suite.</t>
</section>
<section anchor="Auth-cred" title="Authentication Credentials">
<t>The authentication credentials, CRED_I and CRED_R, contain the authentication public key of the Initiator and Responder, respectively, as described in <xref target="RFC9528" section="3.5.2"/>. 
 </t>
  <t>
  <list style="symbols">
<t> The authentication credentials can be X.509 certificates seconded as bstr, as defined in <xref target="RFC9528" section="3.5.2"/>, using <xref target="RFC9360"/>.
When static KEM authentication keys are used, <xref target="I-D.ietf-lamps-kyber-certificates"/> specifies the conventions for using ML-KEM wuthin X.509 Public Key Infrastructure (PKI). </t> 
<t> Additionally, the authentication credential may include a COSE_key, formatted as specified in <xref target="RFC8392"/>, to reduce the credential size and avoid the PQC signature verification needed when X.509 certificates are used. New IANA value registries should be defined to extend COSE Algorithms with the corresponding KEMs algorithm values. </t>
  </list>
  </t>
</section>
<section anchor="Ident-cred" title="Identification of Credentials">
<t>The ID_CRED fields are used to identify and optionally transport credentials as defined in  <xref target="RFC9528" section="3.5.3"/>.
The authentication method defined in this document operates within the general EDHOC framework described in <xref target="RFC9528" section="3.5.3"/>, where ID_CRED_X can either contain the full CRED_X credentials or an identifier of those credentials if they have already been provided out-of-band.
</t>
  <t>
  <list style="symbols">
<t> "ID_CRED_R is intended to facilitate for the Initiator retrieving the authentication credential CRED_R and the authentication key of R", as defined in  <xref target="RFC9528" section="3.5.3"/>. </t>
<t> "ID_CRED_I is intended to facilitate for the Responder retrieving the authentication credential CRED_I and the authentication key of I", as defined in  <xref target="RFC9528" section="3.5.3"/>. </t>
  </list>
  </t>
</section>
</section>
<section anchor="Ciphersuit" title="Cipher Suites">
<t>The authentication method specified in this document uses the EDHOC cipher suites element, as defined in <xref target="RFC9528" section="3.6"/>. 
An EDHOC cipher suit consists of an ordered set of algorithms from the "COSE Algorithms" IANA registry <xref target="RFC9053"/>. 
The predefined EDHOC cipher suites are also listed in the IANA registry, as specified in <xref target="RFC9528" section="10.2"/>. </t>
<t>A new predefined cipher suite SHOULD be added to the IANA registry, specifying the supported KEM in the EDHOC Key Exchange Algorithm parameter and the PQC signature algorithm in the EDHOC signature algorithm parameter, as specified in <xref target="I-D.spm-lake-pqsuites" section="5.2"/>.
 An example of this, when ML-KEM is used, is shown in <xref target="IANA" />.
The same KEM algorithm selected for key exchange SHOULD also be used for KEM-based authentication when methods 4, 5 or 6 are selected.
Furthermore, the KEM algorithms used SHOULD also be added to the COSE Algorithms IANA registry to identify them, as is shown in <xref target="IANA" />. 
 </t>
</section>
<section anchor="Trasport" title="Transport">
<t> The KEM-based authentication method for EDHOC is not bound to any specific transport layer, similar to the classical EDHOC methods defined in <xref target="RFC9528" section="3.4"/>.
However, the resulting message sizes are expected to be larger than those of the original EDHOC methods specified in <xref target="RFC9528"/>. 
This is because the currently standardized NIST KEM algorithms use comparatively large public keys and key encapsulation (ciphertext) sizes, 
thereby increasing the overall size of EDHOC messages.
</t>
<t>
In highly constrained networks, larger message sizes MAY necessitate transport support for fragmentation. 
For example, if the network MTU is insufficient to carry a complete message, the messages can be transported over CoAP <xref target="RFC7252"/> using the Block-Wise Transfer 
mechanism to support fragmentation and reassembly, as specified in <xref target="RFC7959"/> or <xref target="RFC9177"/>. 
<xref target="RFC7959"/> defines the Block1 and Block2 options for request/response block-wise transfer in CoAP, while <xref target="RFC9177"/> extends this mechanism with the
Q-Block1 and Q-Block2 options, allowing multiple blocks to be transmitted without waiting for per-block acknowledgments.
</t>
</section>
</section>
</section>
 <section anchor="key-derive" title="Key Derivation" > 
 <t>This section highlights the differences and similarities in the key derivation process when KEM-based authentication is used to authenticate the Initiator (method 5), the Responder (method 6), or both (method 4), compared to <xref target="RFC9528"></xref>. 
 An overview of the EDHOC key schedule for KEM-based authentication methods 4, 5, or 6 is shown in <xref target="key"/>, and each key derivation step is explained in the following subsections.</t>
     <figure title="EDHOC Message Key Derivation using the KEM-based Authentication Methods 4, 5 or 6" anchor="key"> 
      <artwork align="center"><![CDATA[    
          +-------+
          | TH_2  |  
          +-------+
           |                                       
+----+  +--v+  +------+  +------+  +-----+    +-+  +---+                                                                                              
|ss_e|->|Ext|->|PRK_2e|--|Expand|->|KEY_2|--->| |->|C_2|                                                                                              
+----+  +---+  +--+---+  +--+---+  +-----+    |X|  +---+                                                                                              
                  |         |   PLAINTEXT_2-->| | 
               +-----+      |                 +-+                                                                                                                
          T+---|R use|      |
           |   |KEM ?|      |
           |   +-----+      |                                                                                                              
           |     F|     +--+----------------------+                                                                                                                 
           |      |     |TH_2=H(H(Message1),ct_eph|                                                                                                                 
           |      |     +-------------------------+                                                                                                                 
           |      |                                                                                                                                                        
+----+  +--++  +--v-----+  +------+  +---+  +----+  +---+                                                                                             
|ss_R|->|Ext|->|PRK_3e2m|+-|Expand|->|K_3|->|AEAD|->|C_3|                                                                    
+----+  +---+  +----+---+ |+--+---+  +---+  +----+  +---+                                                                                          
                    |     |   |            |                                                                                                              
                    |     |   |        PLAINTEXT_3           
               +----++    |   |                                                                                                               
          T+---|I use|    |   | 
           |   |KEM ?|    |   | 
           |   +--+--+    |   |  
           |      | F     | +-+---------------------+                                                                                                       
           |      |       | |TH_3=                  |
           |      |       | |  H(TH_2,PLAINTEXT_2,  | 
           |      |       | |  CRED_R,ct_R?)        |                                                                                               
           |      |       | +-----------------------+                                                                                                       
           |      |       |                                                                                                                                             
           |      |       |  +------+  +-----+                                                                                                                          
           |      |       +--|Expand|->|MAC_2|                                                                                                                          
           |      |          +-+----+  +-----+                                                                                                                          
           |      |            |                                                                                                                                        
           |      |    +---------------+---------------------+                                                                                                     
           |      |    |TH_4=H(TH_3,PLAINTEXT_3,CRED_I,ct_I?)|                                                                                                     
           |      |    +------------------+------------------+                                                                                                     
           |      |           |                                                                                                                                        
+----+  +--+-+  +-v------+  +-+----+  +---+  +----+  +---+                                                                                           
|ss_I|->|Ext |->|PRK_4e3m|+-|Expand|->|K_4|->|AEAD|->|C_4|                                                                                           
+----+  +----+  +--------+| +------+ |+---+ |+--^-+  +---+                                                                                           
                          |          |      |   |                                                                                                              
                          |          |      | PLAINTEXT_4                                                                                                      
                          |          |      |+----+  +---+                                                                                           
                          |          |      -|AEAD|->|C_5|                                                                                           
+------------------------+|          |       +-^--+  +---+                                                                                                                                                                                    
|TH_5=H(TH_4,PLAINTEXT_4)||          |         |                                                                                                
+--+---------------------+|          |       PLAINTEXT_5                                                                                         
                    |     |          |                                                                                                                                  
      +-----+   +-+----+  |          |                                                                                                                 
      |MAC_3|<--|Expand|--|          |                                                                                                                     
      +-----+   +------+             |   +-------+                                                                                                                         
                                     |-->|PRK_out|                                                                                                                         
                                         +--+----+                                                                                                                         
                                            |
                                         +--v---+                                                                                                            
                                         |Expand|                                                                                                          
                                         +------+  
                                           |
                                           v   
                                      +------------+                                                                                                          
                                      |PRK_exporter|                                                                                                          
                                      +---+--------+                                                                                                      
                                          |                                                        
                                       +--v---+                                                                                                             
                                       |Expand|                                                                                              
                                       +--+---+
                                          |
                                          v
                                    Aplication Key                                                                                                                                                                                                                                                                                  
 ]]></artwork></figure>
 <section title="Keys for EDHOC Message Processing">
 <section title="EDHOC_Extract">
 <t>The pseudorandom keys (PRKs) used for KEM-based authentication methods are derived using the same EDHOC_Extract function defined in <xref target="RFC9528"></xref>, where the input keying material (IKM) and Salt are specified for each
 PRK below. </t>
 <section title="PRK_2e">
 <t> The pseudorandom key PRK_2e is derived with the following input: </t> 
 <t>
  <list style="symbols">
    <t>The salt SHALL be TH_2.</t>
    <t>The IKM SHALL be the ephemeral KEM shared secret (ss_eph)</t>
  </list>
 </t> 
 <t> When SHA-256 is used PRK_2e is produced as follows:</t> 
 <artwork align="left">
PRK_2e = HMAC-SHA-256( TH_2, ss_eph )
    </artwork>
 <t> Where the ephemeral shared secret ss_eph is the output of the following functions in the Initiator and Responder respectively</t>
    <t>Initiator:</t>
    <artwork align="left">
ss_eph &lt;-  KEM.Decapsulate( ct_eph, sk_eph )
    </artwork>
    <t>Responder:</t>
     <artwork align="left">
ss_eph, ct_eph &lt;-  KEM.Encapsulate( pk_eph )
    </artwork>

 </section> 
 <section anchor="prk_3e2m" title="PRK_3e2m">
 <t> If the Responder authenticates using static KEM keys, the pseudorandom key PRK_3e2m is derived using the following input:
</t> 
 <t>
  <list style="symbols">
    <t>The salt SHALL be the SALT_3e2m derived from PRK_2e </t>
    <t>The IKM SHALL be the KEM shared secret ss_R, used to authenticate the Responder</t>
  </list>
 </t>
 <t> PRk_3e2m is derived as follows: </t>
   <artwork align="left">
PRK_3e2m = EDHOC_Extract( SALT_3e2m, ss_R )
    </artwork>
<t>Where the KEM shared secret ss_R used to authenticate the Responder is the output of the following functions in the Initiator and Responder, respectively</t>
  <t>Initiator:</t>
    <artwork align="left">
ss_R, ct_R &lt;-  KEM.Encapsulate( pk_R )
    </artwork>
    <t>Responder:</t>
     <artwork align="left">
ss_R &lt;-  KEM.Decapsulate( ct_R, sk_R )
    </artwork>
<t>
Else, if the Responder authenticates using a PQC signature algorithm, then PRK_3e2m SHALL be set equal to PRK_2e (PRK_3e2m = PRK_2e).
</t>
 </section>
  <section anchor="PRK_4e3m" title="PRK_4e3m">
<t>
 If the Initiator authenticates using static KEM keys, the pseudorandom key PRK_4e3m is derived using the following input:
</t>

  <t>
  <list style="symbols">
    <t>The salt SHALL be the SALT_4e3m, derived from PRK_3e2m </t>
    <t>The IKM SHALL be the KEM shared secret ss_I, used to authenticate the Initiator</t>
  </list>
 </t>
  <t> PRk_4e3m is derived as follows: </t>
   <artwork align="left">
PRK_4e3m = EDHOC_Extract( SALT_4e3m, ss_I )
    </artwork>
<t>  Where the KEM shared secret ss_I used to authenticate the Initiator is the output of the following functions in the Initiator and Responder, respectively</t>
  <t>Initiator:</t>
    <artwork align="left">
ss_I &lt;-  KEM.Decapsulate( ct_I, sk_I )
    </artwork>
    <t>Responder:</t>
     <artwork align="left">
ss_I, ct_I &lt;-  KEM.Encapsulate( pk_I )
    </artwork>
<t>
Else, if the Initiator authenticates using a PQC signature algorithm, then PRK_4e3m SHALL be set equal to PRK_3e2m (PRK_4e3m = PRK_3e2m).
</t>

 </section>
 </section>
 <section anchor="edhoc_kdf" title="EDHOC_Expand and EDHOC_KDF">
 <t> The output key materials (OKMs) are derived from the PRKs in the same way as described in <xref target="RFC9528" section="4.1.2"/>, with modifications in the transcript hashes THs input contraction as specified in  <xref target="messages"/>. </t>
 <t> The same OKMs, including keys, initialization vectors (IV), and salts as those shows in <xref target="RFC9528" section="4.1.2"/>  Figure 6 are derived, just notice that: </t>
<t>
  <list style="symbols">
  <t> K_3 and IV_3 are computed to provide integrity protection and confidentiality for message_3 ensuring that the Initiator&rsquo;s identity is protected against active attacks. However, this does not provide authentication of the Initiator&rsquo;s identity.</t>
   <!--<t> PRK_out is derived from the new transcript hash where:
    <artwork align="left">
TH_5 = H(TH_4,PLAINTEXT_4)
  </artwork>
  </t>-->
  </list>
 </t>
<t> The final key derivations using EDHOC_KDF is shwon in <xref target="key-derivations-kdf"/>. Further details of the key derivation and how the output keying
   material is used are specified in <xref target="messages"/></t>
<figure title="Key Derivations Using EDHOC_KDF for the KEM-based Authentication Methods" anchor="key-derivations-kdf"> 
<artwork align="center" >
KEYSTREAM_2   = EDHOC_KDF( PRK_2e,   0, TH_2,      plaintext_length )
SALT_3e2m     = EDHOC_KDF( PRK_2e,   1, TH_2,      hash_length )
MAC_2         = EDHOC_KDF( PRK_3e2m, 2, context_2, mac_length_2 )
K_3           = EDHOC_KDF( PRK_3e2m, 3, TH_3,      key_length )
IV_3          = EDHOC_KDF( PRK_3e2m, 4, TH_3,      iv_length )
SALT_4e3m     = EDHOC_KDF( PRK_3e2m, 5, TH_4,      hash_length )
MAC_3         = EDHOC_KDF( PRK_4e3m, 6, context_3, mac_length_3 )
PRK_out       = EDHOC_KDF( PRK_4e3m, 7, TH_4,      hash_length )
K_4           = EDHOC_KDF( PRK_4e3m, 8, TH_4,      key_length )
IV_4          = EDHOC_KDF( PRK_4e3m, 9, TH_4,      iv_length )
PRK_exporter  = EDHOC_KDF( PRK_out, 10, h'',       hash_length )
</artwork>
</figure> 
<t> Notice that a new key session (K_5/IV_5) can be derived from the same PRK_4e3m, using TH_5 as the info parameter, to encrypt message_5, if separate keys are shown to enhance security in any way.
The initial version of this protocol adopts a simpler approach by deriving a single session key to protect both messages, which are different from the MAC keys.</t>
 </section>
 <section anchor="PRK_out" title="PRK_out">
<t>The pseudorandom key PRK_out is the output session key of a completed EDHOC session and is derived as follows:</t>
  <artwork align="left">
PRK_out = EDHOC_KDF( PRK_4e3m, TH_4, hash_length )
  </artwork>
<!--<t> The context include the trascription hash TH_5, defined as:</t>
  <artwork align="left">
TH_5 = H( TH_4, PLAINTEXT_4 )
  </artwork>
<t> Insted of reuse the laste key-exchange internal key, the final key derivation depends on both PRK_4e3m and a newly computed TH_5, wchich include PLAINTEXT_4. This aproach aims to ensure robust session keys that are distinct form the MAC keys, and whose confirmation implies the authentictaion of all the handhsake data</t>
 -->
 </section>
 </section>
  <section anchor="key_app" title="Keys for EDHOC Applications">
<t>  Keying material for the application can be derived using the same EDHOC_Exporter interface defined in <xref target="RFC9528" section="4.2.1"/> </t>
 </section> 
 </section>
 <section anchor="messages" title="Message Formatting and Processing">
 <t> This section outlines the message format and the procedures for composing and processing each message. 
 <!--The secction describe the process only for authentication method 4 where Initator and Responder use KEM-based authentication.-->
 </t>
 <section anchor="message1" title="KEM-based Authentication EDHOC Message 1">
 <section anchor="fmessage1" title="Formating of Message 1">
 <t> message_1 retains the same format as defined in  <xref target="RFC9528" section="5.2.1"/>. The same fields are used, except that GX is replaced by the KEM ephemeral public key ( pk_eph ) computed by the Initiator.</t>
   <sourcecode type="cbor" markers="false">
message_1 = (
  METHOD : int,
  SUITES_I : suites,
  pk_eph : bstr,
  C_I : bstr / -24..23,
  ? EAD_1,
)

suites = [ 2* int ] / int
EAD_1 = 1* ead
 </sourcecode>
 <t> The selected authentication method (methods 4, 5 or 6) SHOULD be indicated in the METHOD field.</t>
</section>
<section anchor="icmessage1" title="Initiator Composition of Message 1">
<t>The Initiator SHALL compose message_1 as follows: </t>
 <t>
  <list style="symbols">
    <t>Construct SUITES_I following the <xref target="RFC9528" section="5.2.2"/> specifications </t>
    <t>Generate an ephemeral KEM Key pair (pk_eph) using the KEM algorithm from the selected cipher suit. The ephemeral key pair is computed by the Initiator using the following function: 
 <artwork align="left">
pk_eph, sk_eph &lt;-  KEM.KeyGen()
  </artwork></t>
    <t> Choose a conection identifier as in <xref target="RFC9528" section="5.2.2"/>.</t>
    <t> Encode message_1 as sequence of CBOR-encoded elements, as specified in <xref target="fmessage1"/></t>
  </list>
 </t> 
</section>
<section anchor="rpmessage1" title="Responder Processing of Message 1">
<t>  The Responder SHALL process message_1 in the following order:</t>
 <t>
  <list style="numbers">
  <t> "Decode message_1", as specified in <xref target="RFC9528" section="5.2.3"/></t>
  <t> "Process message_1", as specify in <xref target="RFC9528" section="5.2.3"/> </t>
  <t> "If all processing is completed successfully, and if EAD_1 is present, then make it available to the application", as specified in <xref target="RFC9528" section="5.2.3"/></t>
  </list>
 </t> 
</section>
</section>
<section anchor="message2" title="KEM-based authentication EDHOC Message 2">
<section anchor="fmessage2" title="Formating of Message 2">
<t>message_2 keeps the same formatting as <xref target="RFC9528" section="5.3.1"/>. The same fields are used instead GY is replaced with the ephemeral KEM ciphertext ( ct_eph ) computed on the Responder.</t>
<sourcecode type="cbor" markers="false">
message_2 = (
  ct_eph_CIPHERTEXT_2 : bstr,
)
</sourcecode>
<t>where cc_eph_CIPHERTEXT_2 is the concatenation of ct_eph and CIPHERTEXT_2. </t>
</section>
<section anchor="rcmessage2" title="Responder Composition of Message 2">
<t> The Responder SHALL compose message_2 as follows:</t>
 <t>
  <list style="symbols">
  <t> Encapsulate the ephemeral KEM key received within message_1 using the KEM algorithm in the selected cipher suit. The ephemeral KEM ciphertext and the KEM ephemeral shared secret are computed by the Responder using the following function:
  <artwork align="left">
 ss_eph, ct_eph &lt;-  KEM.Encapsulate(pk_eph)
  </artwork></t>
  <t> Compute the transcript hash TH_2 = H(pk_eph,H(message_1)) as specified in <xref target="RFC9528" section="5.3.2"/></t>
  <t> Compute the PRK_2e pseudorandom key from the ephemeral KEM shared secret ( ss_eph ) </t>
  <t> "Choose a connection identifier C_R", as specified in <xref target="RFC9528" section="5.3.2"/> </t>
  <t> At this point, when the Responder use KEM-based authentication, is not jet able to authenticate itself; therfore MAC_2 is not computed. 
  Although the Responder could, in principle, authenticate itself at this stage when using PQC signature-based authentication, the message-flow-preserving approach restricts Responder authentication to message_4.
  A corresponding message flow that enables a party to authenticate as soon as it becomes possible is shown in <xref target="Appendix A"/></t>
  <t> CIPHERTEXT_2 is calculated, with a binary additive stream cipher as in <xref target="RFC9528" section="5.3.2"/>, using a keystream (KEYSTREAM_2) generated with EDHOC_Expand and the following plaintext:
  <list style="symbols">
   <t> Compute PLAINTEXT_2 as:
   <artwork align="left">
   PLAINTEXT_2 = (C_R,ID_CRED_R,?EAD_2)
   </artwork>
 where C_R, ID_CRED_R and EAD_2 elements corresponds with the ones in <xref target="RFC9528" section="5.3.2"/>. </t>
  <t> Compute KEYSTREAM_2 as in <xref target="edhoc_kdf"/> </t>
  <t> Compute CIPHERTEXT_2 as in  <xref target="RFC9528" section="5.3.2"/>
  <artwork align="left">
CIPHERTEXT_2 = PLAINTEXT_2 XOR KEYSTREAM_2 
   </artwork></t>
  </list>
 </t> 
  <t> Encode message_2 as a sequence of CBOR-encoded data items as specified in <xref target="fmessage2"/></t>
  </list>
 </t> 
</section>
<section anchor="ipmessage2" title="Initiator Processing of Message 2">
<t>The Initiator SHALL process message_2 in the following order:</t>
 <t>
  <list style="numbers">
  <t> Decode message_2 </t>
  <t> "Retrieve the protocol state" as proposed in <xref target="RFC9528" section="5.3.3"/></t>
  <t> Compute the ephemeral KEM shared_secret ( ss_eph ) by decapsulating the KEM ciphertext ( ct_eph ) received in message_2 using the ephemeral secret key ( sk_eph ). The ephemeral KEM shared secret is computed by the Initiator using the following function: 
   <artwork align="left">
 ss_eph &lt;-  KEM.Decapsulate( ct_eph, sk_eph )
  </artwork></t>
  <t> Compute the transcript hash TH_2 = H(pk_eph,H(message_1)) </t>
  <t> Compute the PRK_2e pseudorandom key from the ephemeral KEM shared secret ( ss_eph ) </t>
  <t> Derive KEYSTREAM_2 as in <xref target="edhoc_kdf"/> </t>
  <t> Decrypt CIPHERTEXT_2; see <xref target="rcmessage2"/> </t>
<t>
If all processing is completed successfully, ID_CRED_R and (if present) EAD_2 SHALL be made available to the application, as specified in <xref target="RFC9528" section="5.3.3"/>. 
In this specification, the application MUST authenticate and validate the credentials associated with ID_CRED_R at this point before proceeding.
The Initiator&rsquo;s credentials are transmitted in the subsequent message and are encrypted under a key that can only be derived by a party possessing the private key corresponding to ID_CRED_R. 
Prior to sending its credentials, the Initiator MUST ensure that the credentials associated with ID_CRED_R have been successfully validated and accepted according to local policy. 
This prevents disclosure of the Initiator&rsquo;s credentials to a party presenting credentials that are cryptographically valid but untrusted or unintended.
</t>
  <t> Obtain the authentication credential (CRED_R) from the (ID_CRED_R) as in <xref target="RFC9528" section="5.3.3"/>, and the static authentication key of the Responder</t>
  <t> If the Responder use KEM-based authentication (methods equal 4 or 6) then the Initiator MUST perform the following steps:
  <list style="symbol">
  <t> Encapsulate the retrieved static KEM authentication key of the Responder ( pk_R ) calculating the corresponding ciphertext ( ct_R ) and shared secret ( ss_R ) with the following function: 
     <artwork align="left">
 ss_R, ct_R &lt;-  KEM.Encapsulate(pk_R)
  </artwork></t>
  <t> Compute the new PRK_3e2m from a chain that includes both the ephemeral KEM shared secret ( ss_eph ) and the latest KEM shared secret for the Authentication of the Responder ( ss_R ), as defined in <xref target="prk_3e2m"/></t>
   </list>
Else, if the Responder authenticates using a PQC signature algorithm (method 5), then PRK_3e2m SHALL be set equal to PRK_2e (PRK_3e2m = PRK_2e).
  </t>
  </list>
 </t> 
 </section>
</section>
<section anchor="message3" title="KEM-based authentication EDHOC Message 3">
<section anchor="fmessage3" title="Formating of Message 3">
<t> message_3 SHALL be a CBOR Sequence as defined below:</t>
<sourcecode type="cbor" markers="false" >
message_3 = (
  CIPHERTEXT_3 : bstr,
  ? ct_R : bstr, 
)
</sourcecode>
</section>
<section anchor="icmessage3" title="Initiator Composition of Message 3">
<t> The Initiator SHALL process the composition of message_3 as follows:</t>
 <t>
  <list style="symbols">
  <t> Compute the transcript hash TH_3=H(TH_2,PLAINTEXT_2,CRED_R,? ct_R) as specified in <xref target="RFC9528" section="5.4.2"/>.
  The element ( ct_R ) SHALL be present only when the Responder use KEM-based authentication (methods 4 and 6); otherwise it SHALL be ommited. </t>
  <t> Derive the new session key K_3/IV_3 as defined in <xref target="edhoc_kdf"/>. The Initiator can use this key to compute CIPHERTEXT_3, but it cannot be used to authenticate itself. </t>
  <t> At this point, when the Initiator use KEM-based authentication, is not jet able to authenticate itself; therfore MAC_3 is not computed. 
  Although the Initiator could, in principle, authenticate itself at this stage when using PQC signature-based authentication, the message-flow-preserving approach restricts Responder authentication to message_5.
  A corresponding message flow that enables a party to authenticate as soon as it becomes possible is shown in <xref target="Appendix A"/> </t>
  <t> Compute a COSE_Encrypt0 object as defined in  <xref target="RFC9052"  section="5.2 and 5.3"/>, 
     with the EDHOC AEAD algorithm of the selected cipher suite, using the encryption key K_3, the initialization vector
      IV_3 (if used by the AEAD algorithm), the plaintext PLAINTEXT_3, and the following parameters as input:
      <list style="symbols">
      <t>protected = h''</t>
      <t>external_aad = TH_3 </t>
      <t>K_3 and IV_3 are defined in <xref target="edhoc_kdf"/></t>
      <t>PLAINTEXT_3 = (C_I,ID_CRED_I,?EAD_3)  where C_I, ID_CRED_I and EAD_3 elements corresponds with the ones in <xref target="RFC9528" section="5.3.3"/> </t>  
      </list>
      CIPHERTEXT_3 is the 'ciphertext' of COSE_Encrypt0.
  </t>
<!--<t> Compute the transcript hash TH_4 = H(ct_I,TH_3, PLAINTEXT_3, CRED_I) as specified in <xref target="RFC9528" section="5.4.2"/>  </t>-->
 <t> Encode message_3 as a CBOR data item as specified in  <xref target="fmessage3"/>. 
 The element ( ct_R ) SHALL be present only when the Responder use KEM-based authentication (methods 4 and 6); otherwise it SHALL be ommited. 
 When the Responder use PQC Signature algorithms (method 5) message_3 consists of a single element (CIPHERTEXT_3). 
 ( ct_R ) is defined as the trailing element so it can be omitted when not used; therefore, senders MUST NOT encode ct_R as NULL.</t>
  </list>
 </t> 
</section>
<section anchor="rpmessage3" title="Responder Processing of Message 3">
<t>The Responder SHALL process message_3 in the following order:</t>
 <t>
  <list style="numbers">
  <t> Decode message_3</t>
  <t> "Retrieve the protocol state", as defined in <xref target="RFC9528" section="5.4.3"/></t>
  <t> If the Responder use KEM-based authentication (methods 4 or 6) then it MUST perform the following steps:
  <list style="symbols">
  <t> Compute the KEM shared_secret ( ss_R ) for the authentication of the Responder by decapsulating the KEM ciphertext ( ct_R ) received in message_3 using the Responder static KEM secret key ( sk_R ). The KEM shared secret is computed by the Responder using the following function: 
  <artwork align="left">
 ss_R &lt;-  KEM.Decapsulate( ct_R, sk_R )
  </artwork></t>
  <t> Compute the new PRK_3e2m from a chain that includes both the ephemeral KEM shared secret ( ss_eph ) and the latest KEM shared secret for the Authentication of the Responder ( ss_R ), as defined in <xref target="prk_3e2m"/></t>
   </list>
  Else, if the Responder authenticates using a PQC signature algorithm (method 5), then PRK_3e2m SHALL be set equal to PRK_2e (PRK_3e2m = PRK_2e). 
 </t> 
  <t> Compute the transcript hash TH_3=H(TH_2,PLAINTEXT_2,CRED_R,? ct_R). The element ( ct_R ) SHALL be present only when the Responder use KEM-based authentication (methods 4 and 6); otherwise it SHALL be ommited.  </t>
  <t> Compute K_3/IV_3 as in <xref target="edhoc_kdf"/>, where plaintext_length is the length of PLAINTEXT_3 </t>
  <t> Decrypt CIPHERTEXT_3; see <xref target="icmessage3"/> </t>
  <t> "If all processing is completed successfully, then make ID_CRED_I and (if present) EAD_2 available to the application", as in <xref target="RFC9528" section="5.3.4"/></t>
  <t> "Obtain the authentication credential (CRED_I) from the (ID_CRED_I)" as in  <xref target="RFC9528" section="5.3.4"/> and the static authentication key of the Initiator.</t>
  </list>
 </t> 
</section>
</section>
<section anchor="message4" title="KEM-based authentication EDHOC Message 4">
<section anchor="fmessage4" title="Formating of Message 4">
<t> message_4 SHALL be a CBOR Sequence as defined below:</t>
<sourcecode type="cbor" markers="false" >
message_3 = (
  CIPHERTEXT_4 : bstr,
  ? ct_I : bstr,
)
</sourcecode>
</section>
<section anchor="rcmessage4" title="Responder Composition of Message 4">
<t> The Responder SHALL process the composition of message_4 as follows:</t>
 <t>
  <list style="symbols">
  <t>If the Initiator use KEM-based authentication (methods equal 4 or 5) then the Responder MUST perform the following step:
  <list style="symbols">
    <t> Encapsulate the retrieved static KEM authentication key of the Initiator ( pk_I ) calculating the corresponding ciphertext ( ct_I ) and shared secret ( ss_I ) with the following function:
  <artwork align="left">
 ss_I, ct_I &lt;-  KEM.Encapsulate(pk_I)
  </artwork></t>     
   </list> 
  </t>
  <t> Compute the transcript hash TH_4 = H(TH_3, PLAINTEXT_3, CRED_I,? ct_I). 
  The element ( ct_I ) SHALL be present only when the Initiator use KEM-based authentication (methods 4 and 5); otherwise it SHALL be ommited.  </t> 
  <t> Compute MAC_2 as defined in <xref target="edhoc_kdf"/>, with context_2 =&lt;&lt;  C_R,
      ID_CRED_R, TH_4, CRED_R, ? EAD_4 &gt;&gt; 
  <list style="symbols">
   <t> If the Resonder authenticates with static KEM key (methods equals 4 or 6), then the mac_lenght_2 is equal to the EDHOC MAC length of the selected cipher suit. 
   If the Responder authenticates with PQC Signature algorithms (method equal 5), then the mac_lenght_2 is equal to hash_length. </t>
   <t> The C_R, ID_CRED_R and CRED_R  elements corresponds with the ones in <xref target="RFC9528" section="5.3.2"/> </t>
   <t> The latest transcript hash TH_4 and the External Application Data included in Message 4 (EAD_4) are used.</t>
  </list>
  </t>
  <t>If the Responder use KEM-based authentication (methods equal 4 or 6) then Sig_R_or_MAC_2 is MAC_2. If the Responder authenticates using a PQC signature algorithm (method 5),
  then Sig_R_or_MAC_2 is the 'signature' field of a COSE_Sign1 object, computed as specified in <xref target="RFC9528" section="5.3.2"/> but using the PQC Signature algorithm specify in the selected cipher suite,
  the private PQC authentication key of the Responder,and the following parameteres as input:: 
   <list style="symbols">
   <t> protected = &lt;&lt; ID_CRED_R &gt;&gt;</t>
   <t> external_aad = &lt;&lt; TH_4, CRED_R, ? EAD_4 &gt;&gt;</t>
   <t> payload = MAC_2</t>
  </list>
  </t>
  <t>If the Initiator use KEM-based authentication (methods equal 4 or 5) then the Responder MUST perform the following step:
  <list style="symbols">  
   <t> Compute the new PRK_4e3m from a chain that includes the ephemeral KEM shared secret ( ss_eph ), the KEM shared secret for the Authentication of the Responder ( ss_R ), and the latest KEM shared secret for the Authentication of the Initiator ( ss_I ) as defined in <xref target="PRK_4e3m"/></t> 
    </list>
    Else, if the Initiator authenticates using a PQC signature algorithm (method equal 6), then PRK_4e3m SHALL be set equal to PRK_3e2m (PRK_4e3m = PRK_3e2m). 
  </t>
   <t> Derive the session key K_4/IV4 as in  <xref target="edhoc_kdf"/>.</t>
   <t> Compute a COSE_Encrypt0 object as defined in  <xref target="RFC9052"  section="5.2 and 5.3"/>, with the EDHOC AEAD algorithm of the selected cipher suite, using the encryption key K_4, the initialization vector
      IV_4 (if used by the AEAD algorithm), the plaintext PLAINTEXT_4, and the following parameters as input:
      <list style="symbols">
      <t>protected = h''</t>
      <t>external_aad = TH_4 </t>
      <t>K_4 and IV_4 are defined in <xref target="edhoc_kdf"/></t>
      <t>PLAINTEXT_4 = ( MAC_2, ?EAD_4 ) </t>  
      </list>
      CIPHERTEXT_4 is the 'ciphertext' of COSE_Encrypt0.
    </t>
   <t>Compute the transcript hash TH_5 = H(TH_4, PLAINTEXT_4) </t> 
   <t>Encode message_4 as a CBOR data item as specified in  <xref target="fmessage4"/>.The element ( ct_I ) SHALL be present only when the Initiator use KEM-based authentication (methods 4 and 5); 
   otherwise it SHALL be ommited. When the Initiator use PQC Signature algorithms (method 6) message_4 consists of a single element (CIPHERTEXT_4). 
 ( ct_I ) is defined as the trailing element so it can be omitted when not used; therefore, senders MUST NOT encode ct_I as NULL.</t>
  </list>
 </t> 
</section>
<section anchor="ipmessage4" title="Initaitor Processing of Message 4">
<t> The Initiator SHALL process message_4 in the following order:</t>
 <t>
  <list style="numbers">
  <t> Decode message_4</t>
  <t> "Retrieve the protocol state using available message correlation", as in  <xref target="RFC9528" section="3.4.2"/>.</t>
  <t>If the Initiator use KEM-based authentication (methods equal 4 or 5) then it MUST perform the following steps:
  <list style="symbols">
   <t> Compute the KEM shared secret ( ss_I ) for the authentication of the Initiator by decapsulating the KEM ciphertext ( ct_I ) received in message_4 using the Responder static KEM secret key ( sk_I ).
    The KEM shared secret is computed by the Initiator using the following function:
  <artwork align="left">
 ss_I &lt;-  KEM.Decapsulate( ct_I, sk_I )
  </artwork></t>
  <t> Compute the new PRK_4e3m from a chain that includes the ephemeral KEM shared secret ( ss_eph ), the KEM shared secret for the Authentication of the Responder ( ss_R ), and the latest KEM shared secret for the Authentication of the Initiator ( ss_I ) as defined in <xref target="PRK_4e3m"/></t> 
    </list>
  Else, if the Initiator authenticates using a PQC signature algorithm (method equal 6), then PRK_4e3m SHALL be set equal to PRK_3e2m (PRK_4e3m = PRK_3e2m). 
  </t>
  <t> Compute the transcript hash TH_4 = H(TH_3, PLAINTEXT_3, CRED_I, ? ct_I). 
  The element ( ct_I ) SHALL be present only when the Initiator use KEM-based authentication (methods 4 and 5); otherwise it SHALL be ommited. </t>
  <t> Derive the session key K_4/IV4 as in  <xref target="edhoc_kdf"/>.</t>
  <t> Decrypt and verify the COSE_Encrypt0 (CIPHERTEXT_4) as defined <xref target="RFC9052"  section="5.2 and 5.3"/>], with the EDHOC AEAD algorithm in the selected cipher suite and the parameters defined in <xref target="rcmessage4"/>.</t>
  <t> Verify Sig_R_or_MAC_2 using the algorithm in the selected cipher suite. The verification process depepends on the authentication method used by the Responder
   as defined in <xref target="rcmessage4"/>. "Make the result of the verification available to the application" as in <xref target="RFC9052"  section="5.3.3"/></t>
  </list>
</t> 
</section>
</section>

<section anchor="message5" title="KEM-based authentication EDHOC Message 5">
<section anchor="fmessage5" title="Formating of Message 5">
<t> message_5 SHALL be a CBOR Sequence as defined below:</t>
<sourcecode type="cbor" markers="false" >
message_3 = (
  CIPHERTEXT_5 : bstr,
)
</sourcecode>
</section>
<section anchor="icmessage5" title="Initiator Composition of Message 5">
<t> The Initiator SHALL process the composition of message_5 as follows:</t>
 <t>
  <list style="symbols">
   <t> Compute the transcript hash TH_5 = H(TH_4, PLAINTEXT_4) </t> 
   <t> Compute MAC_3 as defined in <xref target="edhoc_kdf"/>, with context_3 =&lt;&lt;  C_I,
      ID_CRED_I, TH_5, CRED_I, ? EAD_5 &gt;&gt; 
  <list style="symbols">
    <t> If the Initiator authenticates with static KEM key (methods equals 4 or 5), then the mac_lenght_3 is equal to the EDHOC MAC length of the selected cipher suit. 
   If the Initiator authenticates with PQC Signature algorithms (method equal 6), then the mac_lenght_3 is equal to hash_length. </t>
   <t> The C_I, ID_CRED_I and CRED_I elements corresponds with the ones in <xref target="RFC9528" section="5.4.2"/> </t>
   <t> The latest transcript hash TH_5 and the External Application Data included on Message 5 (EAD_5) are used.</t>
  </list>
  </t>
   <t>If the Initiator use KEM-based authentication (methods equal 4 or 5) then Sig_I_or_MAC_3 is MAC_3. If the Initiator authenticates using a PQC signature algorithm (method 6),
  then Sig_I_or_MAC_3 is the 'signature' field of a COSE_Sign1 object, computed as specified in <xref target="RFC9528" section="4.3.2"/> but using the PQC Signature algorithm specify in the selected cipher suite,
  the private PQC authentication key of the Initiator, and the following parameteres as input: 
   <list style="symbols">
   <t> protected = &lt;&lt; ID_CRED_I &gt;&gt;</t>
   <t> external_aad = &lt;&lt; TH_5, CRED_I, ? EAD_5 &gt;&gt;</t>
   <t> payload = MAC_3</t>
  </list>
  </t>
  <t> Compute a COSE_Encrypt0 object as defined in<xref target="RFC9052"  section="5.2 and 5.3"/>, with the EDHOC AEAD algorithm of the selected cipher suite, using the encryption key K_4, the initialization vector
  IV_4 (if used by the AEAD algorithm), the plaintext PLAINTEXT_5, and the following parameters as input:
  <list style="symbols">
  <t>protected = h''</t>
  <t>external_aad = TH_5 </t>
  <t>K_5 and IV_5 are defined in <xref target="edhoc_kdf"/></t>
  <t>PLAINTEXT_5 = ( MAC_3, ? EAD_5 ) </t>  
  </list>
  CIPHERTEXT_5 is the 'ciphertext' of COSE_Encrypt0.
 </t>
 <t>Calculate PRK_out as defined in <xref target="PRK_out"/>. The Initiator can now derive application keys using the EDHOC_Exporter interface; see  <xref target="key_app"/></t>
 <t>Encode message_5 as a CBOR data item as specified in  <xref target="fmessage5"/></t>
 <t>"Make the connection identifiers (C_I and C_R) and the application algorithms in the selected cipher suite available to the application" as in <xref target="RFC9528" section="5.4.2"/>  </t>
  </list>
</t> 
<t> After creating message_5, the Initiator can compute PRK_out and derive application keys using the EDHOC_Exporter interface. 
The Responder SHOULD now persistently store PRK_out or application keys and send protected application data, since it has already verified message_4, which is protected with a derived application key by the Responder, and the application has authenticated the Responder.</t>
</section>
<section anchor="rpmessage5" title="Responder Processing of Message 5">
<t> The Responder SHALL process message_5 in the following order:</t>
 <t>
  <list style="numbers">
  <t> Decode message_5</t>
  <t> "Retrieve the protocol state using available message correlation" as in  <xref target="RFC9528" section="3.4.2"/>.</t>
  <t> Decrypt and verify the COSE_Encrypt0 (CIPHERTEXT_5) as defined in <xref target="RFC9052"  section="5.2 and 5.3"/>, with the EDHOC AEAD algorithm in the selected cipher suite and the parameters defined in <xref target="icmessage5"/>.</t>
  <t> Verify Sig_I_or_MAC_3 using the algorithm in the selected cipher suite. The verification process depepends on the authentication method used by the Initiator
   as defined in <xref target="icmessage5"/>. "Make the result of the verification available to the application" as in <xref target="RFC9052"  section="5.3.3"/></t>
  <t> Calculate PRK_out as defined in <xref target="PRK_out"/>. The Initiator can now derive application keys using the EDHOC_Exporter interface; see  <xref target="key_app"/></t>
  </list>
</t> 
<t> After verifying message_5, the Responder can compute PRK_out and derive application keys using the EDHOC_Exporter interface. 
The Responder SHOULD now persistently store PRK_out or application keys and send protected application data, since it has already verified message_5, which is protected with a derived application key by the Initiator, and the application has authenticated the Initiator. </t>
</section>
</section>
</section>
<!--	<section anchor="Headers" title="Protocol Header Format" >
    <t>The following headers are required in order to satisfy all the requirements</t>
    <t>Each header SHOULD be in a different subsection</t>
	
   <section title="First header">
    <t>This is the first message sent by the Client to initiate the communication process... </t>
    <t>The following figure shows the message format.</t>
    <t>Headers SHOULD be defined in ascii and each field explained in detail as follows:</t>
    <figure title="A Header Format" anchor="RSHF"> <artwork align="center"><![CDATA[
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |        Message Type           |              AM               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                            Length                             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      ]]></artwork></figure>
    <t>
      <list style="symbols">
        <t>Message Type - 16 bits unsigned integer: The message type. For this message, the message type MUST be 0.</t>
        <t>AM - 16 bits unsigned integer: The ID of the client.</t>
        <t>Length - 32 bits unsigned integer. The value for this message MUST be 8.</t>
      </list>
    </t>
  </section>

  </section>-->
  <!--
  <section anchor="Acknowledgements" title="Acknowledgements">
    <t>The authors would like to acknowledge all the students who will attempt to define their own specification.</t>
    <t>The authors would also like to thank all the students for their patients and their participation.</t>
  </section>

-->
    <!-- Possibly a 'Contributors' section ... -->

    <section anchor="IANA" title="IANA Considerations">
   <section anchor="COSE Algorithms Registry" title="COSE Algorithms Registry">
    <t> The "COSE Algorithms" Registry from "CBOR Object Signing and Encryption (COSE)" group SHOULD be extended with new values to include PQC KEM algorithms. 
     The extension of values from the "Standards Action with Expert Review" range for ML-KEM algorithms at NIST security levels 1 and 3, is proposed in  <xref target="cose-table"/> </t>
  
    <dl>
          <dt >Registry Name:</dt>
          <dd >COSE Algorithms</dd>
          <dt >Reference:</dt>
          <dd >draft-pocero-authkem-edhoc-02</dd>
        </dl>
        <t>The columns of the registry are Name, Value and Description, where Value is an integer and the other columns are text strings. 
        For both new registrations, the change controller is the IETF, and the reference field should point to this document.
        The new values proposed are:</t>
      
  <table anchor="cose-table" align="center">
  <name slugifiedName="cose-alg">COSE Algorithms</name>
  <thead>
    <tr>
      <th align="left">Name</th>
      <th align="left">Value</th>
      <th align="left">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td align="left">ML-KEM-512</td>
      <td align="left">-54 (suggested)</td>
      <td align="left"> CBOR object KEM Algorithm for ML-KEM-512</td>
    </tr>
    <tr>
      <td align="left">ML-KEM-1024</td>
      <td align="left">-55 (suggested)</td>
      <td align="left"> CBOR object KEM Algorithm for ML-KEM-1024</td>
    </tr>
  </tbody>
</table>
 

    </section>
   <section anchor="EDHOC Cipher Suites Registry" title="EDHOC Cipher Suites Registry">
   <t> The "EDHOC Cipher Suites" Registry from group "Ephemeral Diffie-Hellman Over COSE (EDHOC)" SHOULD be extended with new values to include the cipher suits with the KEM algorithm used. While the KEM-based authentication protocol specified in this document can support different KEM algorithms, the NIST-standardized ML-KEM is RECOMMENDED. 
    The extension of values from the "Standards Action with Expert Review" range, when the ML-KEM algorithm is used at NIST security levels 1 and 3, is proposed in <xref target="cipher-table"/> </t>
 <dl>
          <dt>Registry Name:</dt>
          <dd>EDHOC Cipher Suites</dd>
          <dt>Reference:</dt>
          <dd>draft-pocero-authkem-edhoc-02</dd>
        </dl>
        <t>The columns of the registry are Value, Array, Description, and Reference, where Value is an integer and the other columns are text strings. The new values proposed are:</t>
      
    <table anchor="cipher-table" align="center">
  <name slugifiedName="name-edhoc-cipher-suites">EDHOC Cipher Suites</name>
  <thead>
    <tr>
      <th align="left">Value</th>
      <th align="left">Array</th>
      <th align="left">Description</th>
      <th align="left">Reference</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td align="left">7 (suggested)</td>
      <td align="left">30, -16, 16, -54, -48 , 10, -16</td>
      <td align="left">AES-CCM-16-128-128, SHA-256, 16, ML-KEM-512, ML-DSA-44, AES-CCM-16-64-128, SHA-256</td>
      <td align="left">draft-pocero-authkem-edhoc-02</td>
    </tr>
    <tr>
      <td align="left">8 (suggested)</td>
      <td align="left">10, -16, 8, 1, -55, -49 , -16</td>
      <td align="left">A256GCM, SHA-384, 16, ML-KEM-1024, ML-DSA-65, A256GCM, SHA-384</td>
      <td align="left">draft-pocero-authkem-edhoc-02</td>
    </tr>
  </tbody>
</table>
<t> The PQC ML-DSA signature algorithms are selected as the EDHOC signature algorithm parameter to verify X.509 certificate signatures when the X.509 credential type is used. </t>
   </section>

   <section anchor="EDHOC Method Types Registry" title="EDHOC  Method Types Registry">
   <t> The "EDHOC Method Types" Registry from group "Ephemeral Diffie-Hellman Over COSE (EDHOC)" SHOULD be extended with a new value that identifies the KEM-based authentication method.
    The extension value from the "Standards Action with Expert Review" range, is proposed in <xref target="method-table"/> </t>
<dl>
          <dt>Registry Name:</dt>
          <dd>EDHOC Method Types</dd>
          <dt>Reference:</dt>
          <dd>draft-pocero-authkem-edhoc-02</dd>
        </dl>
        <t>The columns of the registry are Value, Initiator Authentication Key, Responder Authentication Key and Reference, where Value is an integer and the other columns are text strings. The new value proposed is:</t>
   <table anchor="method-table" align="center">
  <name slugifiedName="method">EDHOC Method Types</name>
  <thead>
    <tr>
      <th>Value</th>
      <th>Initiator Authentication Key</th>
      <th>Responder Authentication Key</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>4 (suggested)</td>
      <td>Static KEM Key</td>
      <td>Static KEM Key</td>
      <td>[draft-pocero-authkem-edhoc-02]</td>
    </tr>
    <tr>
      <td>5 (suggested)</td>
      <td>Static KEM Key</td>
      <td>PQC Signature key</td>
      <td>[draft-pocero-authkem-edhoc-02]</td>
    </tr>
      <tr>
      <td>6 (suggested)</td>
      <td>PQC Signature key</td>
      <td>Static KEM Key</td>
      <td>[draft-pocero-authkem-edhoc-02]</td>
    </tr>
  </tbody>
</table>

   
    </section>
    </section>
    <section anchor="Security" title="Security Considerations">
    <section anchor="SecurityP" title="Security Properties">    
<t>EDHOC protocol with static DH keys enables the Initiator and Responder to generate an ephemeral-static shared secret using the other party's ephemeral public keys and their own credentials. 
This shared secret is then used to derive a session key for authentication. Messages 2 and 3 provide explicit authentication through MACs, which also bind the exchanged credentials to prevent misbinding attacks, 
as is described in  <xref target="RFC9528" section="9.1"/> </t>
<t>In contrast, the KEM-based authentication mechanism requires an initial action from the other party. 
The Responder must first receive the encapsulation of its static public key generated by the Initiator to authenticate itself. 
To perform this encapsulation, the Initiator must retrieve the static KEM public key of the Responder from the ID_CRED_R sent in Message 2. 
As a result, the Responder cannot authenticate itself until Message 3 is processed, which contains the ct_R ciphertext necessary to derive the ss_R shared secret. 
Then it cannot generate MAC_2 or authenticate itself until then. 
Similarly, the Initiator cannot generate MAC_3 or authenticate itself before sending Message 3. 
This highlights the main challenge in integrating KEM-based authentication method within the EDHOC handshake.</t>
<t> To address this issue and maintain the same level of identity protection than EDHOC, against active attacks on the Initiator and passive attacks on the Responder,
the credentials continue to be encrypted in Messages 2 and 3.
In message_2, the Responder&rsquo;s credentials are included in a plaintext that is XORed with a key derived from the ephemeral shared secrets, as defined in <xref target="RFC9528" section="5.3"/>.
By employing the same construction, this specification provides equivalent identity protection for the Responder against passive attackers.
The credentials of the Initiator ( ID_CRED_I ) are encrypted using an AEAD algorithm to provide integrity protection and confidentiality, but not authentication, because the Initator&rsquo;s shared secret is not yet available to prove its identity. 
The encryption key is derived from a combination of both ephemeral KEM shared secret (ss_eph) and the Responder static KEM shared secret ( ss_R ), used to authenticate the Responder.
At this stage in the protocol, the specific encryption provided a form of weak forward secrecy, as the Initiator has not yet verify the static KEM public key of the Responder. 
However, the credentials are still protected against active attacks, as only the legitimate Responder, who possesses the corresponding private key ( sk_R ) is capable of deriving the session key and decrypting message_3.</t> 
 <t>Furthermore, the protocol is extended with two additional messages (Messages 4 and 5) to enable both parties to:</t>
 <t>
  <list style="symbols">
  <t>Prove possession of the final session key, ensuring key confirmation to the other party</t>
  <t>Ensure mutual authentication by explicitly authenticating themselves using the final session key, which incorporates all three shared secrets:
   the ephemeral KEM shared secret ( ss_eph ) and the KEM shared secrets ss_I  and  ss_R  used to authenticate the Initiator and Responder, respectively.</t>
  <t>Provide credential binding by including MAC_2 and MAC_3, ensuring the integrity and authenticity of the credentials exchanged in messages 2 and 3.</t> 
  </list>
 </t> 
 <t>In <xref target="RFC9528"/>, the transcript hashes (THs) are constructed as an accumulative hash, combining previous TH values with the current plain-text message. 
 Each new plain-text message in the handshake is concatenated with the previous TH value, and the resulting hash forms the new TH. 
 This process links each message in the sequence to all prior messages, creating a verifiable and continuous chain. 
 As a result, any changes to the message content are detected during subsequent integrity verification using the transcript hashes.
 The KEM-based authentication method described in this document extends this approach. Both parties only need to verify the integrity and authenticity of the latest TH_4 and TH_5,
 which encompass all previous messages in the handshake. To facilitate this, the MAC-protected data in Messages 4 and 5 is modified to include TH_4 and TH_5 respectively.
 At the end of the handshake, both the Initiator and Responder can verify the integrity and authenticity of the entire handshake by checking the received MACs.
 </t>
 <t> The payload security properties for the static DH authentication method and the KEM-based authentication method differ during the handshake. 
 Unlike the static DH authentication method, the KEM-based method exhibits no authentication until the final two messages. 
 It provides the same level of destination confidentiality for the first two and the last two messages, while message_3 offers weaker forward secrecy. 
 The Initiator&rsquo;s credentials are encrypted within message_3 using a key derived from the Responder&rsquo;s static public key and the ephemeral key, 
 ensuring that only the intended Responder can decrypt the credential, and protect them against active attacks.</t>
 
<t>Full forward secrecy and explicit mutual authentication are achieved once the KEM-based method handshake is completed, similar to the static-DH method handshake (described in <xref target="RFC9528" section="9.1"/>). 
 Additionally, a potential misbinding attack will not be detected until the handshake concludes, specifically when the Initiator verifies Message 4 and the Responder verifies Message 5. 
 Therefore, EAD data should be treated as unprotected, and keying materials should not be persistently stored until the protocol is complete, as with the static-DH method (described in <xref target="RFC9528" section="9.1"/>).
 The final Application Session Key should only be derived at the end of the handshake, after ensuring mutual authentication, message handshake integrity, credentials authenticity, and proof of key possession.
</t>

 <t> The KEM-based authentication method does not provide non-repudiation, but only implicit proof of participation, similar to EDHOC with static DH keys.
 It also maintains an equivalent level of downgrade protection, as the negotiation base of the protocol is unchanged. </t>

  </section>
   <section anchor="KEMsec" title="KEM Security Considerations">   
 <t>
<xref target="KEMBinding-CCS24"/> demonstrates that IND-CCA2 security alone does not preclude re-encapsulation attacks in KEM-based key exchange protocols. 
Such attacks can lead to unknown key-share conditions, in which two honest parties derive the same shared secret while associating it with different peer identities.
Therefore, any KEM used in this specification MUST achieve IND-CCA2 security and MUST ensure that the derived shared secret is cryptographically bound to the recipient&rsquo;s public key.
This requirement prevents re-encapsulation and related key-substitution attacks.
 </t>  
 </section>
 <section anchor="Four" title="Four-Message Variant">  
    
 <t> The proposed KEM-based authentication method with a 5-message handshake is designed to meet the same security requirements as static-DH method. 
 However, it can be adapted to reduce the number of round trips while remaining suitable for scenarios where neither party knows the other beforehand.
 This is achieved by transmitting the ID_CRED_I credentials of the Initiator in plain-text within the message_1, similar to the Noise IX pattern, 
 where the Initiator's static key is immediately transmitted to the Responder, despite or absent identity protection. 
 This modification allows the Initiator to authenticate itself in Message 2, eliminating the need for Message 5. 
 Since the Responder includes its credentials in the first message, Message 4 remains necessary to ensure explicit authentication of the Responder.
This adaptation reduces the message exchange to four but sacrifices identity protection for the Initiator's credentials.
 </t>
 </section>
  </section>

   
  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

     Both are cited textually in the same manner: by using xref elements.
     If you use the PI option, xml2rfc will, by default, try to find included files in the same
     directory as the including file. You can also define the XML_LIBRARY environment variable
     with a value containing a set of directories to search.  These can be either in the local
     filing system or remote ones accessed by http (http://domain/dir/... ).-->

      <references title="Normative References">
      &RFC9528;
      &RFC9052;
      &I-D.ietf-lamps-kyber-certificates;
      &RFC8392;
      &RFC9360;
      &RFC8949;
      &RFC8742;
      &RFC5116;
      &I-D.spm-lake-pqsuites;
      

    </references>
    <references title="Informative References">
      &RFC2119;
      &RFC9794;
      &RFC9053;
      &RFC7252;
      &RFC7959;
      &RFC9177;
      &I-D.uri-lake-pquake;
      &I-D.celi-wiggers-tls-authkem;
      &I-D.ietf-pquip-pqc-engineers;
       <reference anchor="Noise" target="https://noiseprotocol.org/noise.html" quoteTitle="true" derivedAnchor="Noise">
          <front>
            <title>The Noise Protocol Framework</title>
            <author initials="T." surname="Perrin">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2018" month="July"/>
          </front>
          <refcontent>Revision 34</refcontent>
        </reference>
<reference anchor="PQNoise-CCS22" target="https://doi.org/10.1145/3548606.3560577" quoteTitle="true" derivedAnchor="PQNoise-CCS22">
  <front>
    <title>Post Quantum Noise</title>
    <author initials="Y." surname="Angel">
      <organization showOnFrontPage="true"/>
    </author>
    <author initials="B." surname="Dowling"/>
    <author initials="A." surname="Hulsing"/>
    <author initials="P." surname="Schwabe"/>
    <author initials="F." surname="Weber"/>
    <date year="2022"/>
  </front>
  <refcontent>
    Proceedings of the 2022 ACM SIGSAC Conference on Computer and Communications Security (CCS '22), pages 97&#8211;109. Association for Computing Machinery, New York, NY, USA.
    DOI: https://doi.org/10.1145/3548606.3560577
  </refcontent>
</reference>
<reference anchor="KEMBinding-CCS24"
           target="https://doi.org/10.1145/3658644.3670283"
           quoteTitle="true"
           derivedAnchor="KEMBinding-CCS24">
  <front>
    <title>Keeping Up with the KEMs: Stronger Security Notions for KEMs and Automated Analysis of KEM-based Protocols</title>
    <author initials="C." surname="Cremers">
      <organization showOnFrontPage="true"/>
    </author>
    <author initials="K." surname="Kohlweiss"/>
    <author initials="B." surname="Dowling"/>
    <author initials="D." surname="Jackson"/>
    <date year="2024"/>
  </front>
  <refcontent>
    Proceedings of the 2024 ACM SIGSAC Conference on Computer and Communications Security (CCS '24).
    Association for Computing Machinery, New York, NY, USA.
    DOI: https://doi.org/10.1145/3658644.3670283
  </refcontent>
</reference>
<reference anchor="PQ-EDHOC-Access25"
           target="https://doi.org/10.1109/ACCESS.2025.3633843"
           quoteTitle="true"
           derivedAnchor="PQ-EDHOC-Access25">
  <front>
    <title>Reinventing EDHOC for the Post-Quantum Era</title>
    <author initials="L. " surname="Pocero Fraile">
      <organization showOnFrontPage="true"/>
    </author>
    <author initials="C." surname="Koulamas"/>
    <author initials="A. P." surname="Fournaris"/>
    <date year="2025"/>
  </front>
  <refcontent>
    IEEE Access, Volume 13, pages 196622&#8211;196640, 2025.
    DOI: https://doi.org/10.1109/ACCESS.2025.3633843
  </refcontent>
</reference>
    </references>
    <section anchor="Appendix A" title="Early Authentication Approach for Combined PQC KEM and Signature Authentication Methods">
<t>To extend the pure KEM-based authentication between both parties with support for combinations where the Initiator and Responder use different mechanisms,
combining KEM-based and signature-based authentication, an alternative approach can be considered. 
In this early authentication approach, authentication is prioritized, and each party authenticates in the first message in which it is able to do so. 
This enables authentication to occur as early as possible, in contrast to the message-flow-preserving approach defined in this document.</t>
<t>When KEM-based authentication is used by both parties, the two approaches share the same message flow, as shown in <xref target="method4"/>. 
When the Initiator uses PQC signature-based authentication, it is able to authenticate its identity within message 3.
By using the early authentication approach, this avoids the need for message_5 and reduces the message flow to four mandatory messages, as shown in <xref target="method6"/>.
On the other hand, when the Responder uses PQC signature-based authentication, the authentication trough signatures within message 2 does not reduce the 
number of mandatory messages, as shown in <xref target="method5"/>. 
However, both Method 5 and Method 6 can benefit from the early authentication approach, which allows the protocol to terminate early if authentication fails,
enables early detection of misbinding attacks, and increases the level of authentication assurance provided by intermediate messages. </t>
<t>The main drawback of the early authentication approach is the increased
complexity associated with using different message formats and numbers of
messages across the various authentication methods, which complicates protocol
specifications and implementations.</t>
<t>Priority has been given in this document to maintaining a simpler protocol specification with the
same number of messages and a consistent format across the three authentication
methods, since the benefits of lower complexity are considered more important
than the marginal advantages provided by the early authentication approach. 
However, the advantages and disadvantages of both
approaches should be further discussed within the LAKE Working Group to evaluate
the pros and cons of each approach.</t>

  <figure title="EDHOC Message Flow for KEM-based Authentication on both Initiator and Responder (Method 4) " anchor="method4"> 
      <artwork align="center"><![CDATA[
Initiator                                                   Responder
|               METHOD, SUITES_I, pk_eph, C_I, EAD_1                |
+------------------------------------------------------------------->
|                             message_1                             |
|                                                                   |
|               ct_eph, Enc( C_R, ID_CRED_R, EAD_2 )                |
<-------------------------------------------------------------------+
|                             message_2                             |
|                                                                   |
|                   ct_R, AEAD( ID_CRED_I, EAD_3 )                  |
+------------------------------------------------------------------->
|                             message_3                             |
|                                                                   |
|                     ct_I, AEAD( EAD_4, MAC_2 )                    |
<-------------------------------------------------------------------+
|                             message_4                             |
|                                                                   |
|                         AEAD( EAD_5, MAC_3 )                      |
+------------------------------------------------------------------->
|                             message_5                             |

]]></artwork></figure>

<figure title="EDHOC Message flow for KEM-based authentication on the Initiator and PQC signature-based authentication on the Responder (Method 5) " anchor="method5"> 
      <artwork align="center"><![CDATA[


Initiator                                                   Responder
|               METHOD, SUITES_I, pk_eph, C_I, EAD_1                |
+------------------------------------------------------------------->
|                             message_1                             |
|                                                                   |
|               ct_eph, Enc( C_R, ID_CRED_R, sig, EAD_2 )           |
<-------------------------------------------------------------------+
|                             message_2                             |
|                                                                   |
|                     AEAD( ID_CRED_I, EAD_3 )                      |
+------------------------------------------------------------------->
|                             message_3                             |
|                                                                   |
|                          ct_I, AEAD( EAD_4)                       |
<-------------------------------------------------------------------+
|                             message_4                             |
|                                                                   |
|                         AEAD( EAD_5, MAC_3 )                      |
+------------------------------------------------------------------->
|                             message_5                             |

]]></artwork></figure>
<figure title="EDHOC Message flow for PQC signature-based authentication on the Initiator and KEM-based authentication on the Responder (Method 6) " anchor="method6"> 
      <artwork align="center"><![CDATA[

Initiator                                                   Responder
|               METHOD, SUITES_I, pk_eph, C_I, EAD_1                |
+------------------------------------------------------------------->
|                             message_1                             |
|                                                                   |
|               ct_eph, Enc( C_R, ID_CRED_R, EAD_2 )                |
<-------------------------------------------------------------------+
|                             message_2                             |
|                                                                   |
|                   ct_R, AEAD( ID_CRED_I, sig, EAD_3 )              |
+------------------------------------------------------------------->
|                             message_3                             |
|                                                                   |
|                      AEAD( EAD_4, MAC_2 )                         |
<-------------------------------------------------------------------+
|                             message_4                             |


]]></artwork></figure>
</section>
  </back>
</rfc>
