<?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 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 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.pocero-authkem-edhoc SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-pocero-authkem-edhoc-01.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-ikr-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 in Initiator-Known Responder (IKR) Scenarios</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 <xref target="RFC9528"></xref> 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. </t>
    -->
    <t>This document specifies a more efficient variant of a Key Encapsulation Mechanism (KEM)-based authentication method for the Ephemeral Diffie-Hellman Over COSE (EDHOC) lightweight protocol, designed for the specific scenario in which the Initiator has prior knowledge of the Responder&rsquo;s credentials, a case commonly found in constrained environments. 
    Improving upon the approach described in KEM-based Authentication for EDHOC, this method uses only a mandatory three-message handshake to enable signature-free post-quantum authentication when PQC KEMs, such as the NIST-standardized ML-KEM, are employed, while still providing mutual authentication, forward secrecy, and a degree of identity protection.
    </t>
    </abstract>
    
  </front>

  <middle>
    <section title="Introduction">
	<t>The purpose of this document is to address a more efficient quantum-resistant transition of the Ephemeral Diffie-Hellman over COSE (EDHOC) protocol by extending with a new Key Encapsulation Mechanism (KEM)-based authentication method that uses a mandatory three-message handshake in Initiator-Known Responder (IKR) Scenarios. </t>
	<t>The specified protocol is part of a broader analysis of the post-quantum transition for EDHOC <xref target="PQ-EDHOC-Access25"/></t>

  <section title="Motivation">
  <t>
  The KEM-based authentication method for EDHOC, specified in <xref target="I-D.pocero-authkem-edhoc"/>, addresses the general mutually unknown peer scenario, similar to the original EDHOC protocol. In this case, the Initiator and Responder, if do not have prior knowledge of each other's credentials can exchange them in the form of X.509 certificate. 
  To maintain this generality an additional round trip is required, resulting in a mandatory five-message handshake.
  </t>
  <t>
  This document explores the possibility of reducing this overhead in the specific scenario where the Initiator already possesses the credentials of the Responder it wishes to connect in advance. 
This applies to cases where the Initiator is a constrained device equipped with credentials for the Responder,
obtained through pre-provisioning or out-of-band methods. 
A typical example is during onboarding, where a remote or local server (acting as the Responder) is configured on the device in advance.
Such settings are particularly relevant for EDHOC, which targets constrained environments where transmitting credentials can be costly.

  </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, tailored for a specific scenario where the Initiator knows the credentials of the Responder it intends to communicate with beforehand. 
In such cases, the method, specified in this document, reduces the standard five-message handshake defined in <xref target="I-D.pocero-authkem-edhoc"/> to a three-message exchange.
</t>
<t>
This variant, referred to as Initiator Knows Responder (IKR), converts the Noise-XX pattern, used in both static-DH and KEM-based authentication EDHOC methods, into a Noise-IK pattern.
The Noise-IK pattern enables a mutual authentication handshake when
the Initiator has prior knowledge of the Responder&rsquo;s static public key, and the Initiator&rsquo;s static keys are sent in the first message. 
The mechanism provided in <xref target="PQNoise-CCS22"/> for transforming this pattern into the PQ Noise-IK version is integrated into this protocol.
</t>
<t>
The KEM-based IKR variant provides a more efficient handshake with only three mandatory messages while maintaining mutual authentication, forward secrecy, and a level of identity protection. 
Notably, the Responder does not require prior knowledge of the Initiator&rsquo;s credentials. 
Instead, the Initiator encrypts its credentials, or an identifier, within message_1 using a key derived from a shared secret, computed over the Responder&rsquo;s static KEM public key, 
which the Initiator already possesses. 
Consequently, only the legitimate Responder, holding the corresponding static KEM private key, can decrypt this information, ensuring that the Initiator&rsquo;s identity remains protected against both passive and active attackers.</t>

<t>The KEM-based EDHOC protocol consists of three mandatory messages (message_1, message_2, message_3), an optional message_4, and an error message, between an Initiator (I) and a Responder (R). 
Figure 2 illustrates a KEM-based ikr authentication EDHOC message flow as well as the content of each message. 
The protocol elements in <xref target="Exchange"/> 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 using the KEM-based IKR Authentication Method " anchor="Exchange"> 
      <artwork align="center"><![CDATA[
Initiator                                                Responder
|  pk_eph, ct_R, AEAD( METHOD, SUITES_I, ID_CRED_I, C_I, EAD_1)  |
+---------------------------------------------------------------->
|                       message_1                                |
|                                                                |
|       ct_eph, ct_I, AEAD( C_R, ID_CRED_R, MAC_2, EAD_2 )       |
<----------------------------------------------------------------+
|                       message_2                                |
|                                                                |
|                  AEAD( MAC_3, EAD_3 )                          |
+---------------------------------------------------------------->
|                       message_3                                |
|                                                                |
|                      AEAD( EAD_4 )?                             |
<----- - - -- - - - - - - - - - - - - - - - - - - - - - - - - - -+
|                         message_4                              |


]]></artwork></figure>
<t>The Initiator can derive symmetric application keys after receiving message_2 and Responder after receiving message_3.</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. </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. </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> AEAD(), and MAC() denote 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 5; 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 are External Authorization Data included in message_1, message_2, message_3 and message_4, 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> 
<t>
Furthermore, key derivation and message protection are based on the strongest shared secrets available at each stage of the handshake. 
Accordingly, this specification modifies the original EDHOC key schedule to incorporate each shared secret as soon as it is established. 
Consequently, every message is confidentiality- and integrity-protected using keying material derived from all shared secrets available at that point in the protocol execution.
</t>
<section anchor="ProtoElemnts" title="Protocol Elements">
<t>This section describes the principal protocol elements that differ from the ones defined in EDHOC. 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 is used to provide forward secrecy. 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="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 encrypted in message_1 and message_2, respectively. </t>
<section anchor="Method" title="Method">
<t>The protocol extends EDHOC with a new KEM-based authentication method for IKR scenarios, where both parties use static KEM key pairs. 
The authentication is provided by a Message Authentication Code (MAC) included in message_2 and message_3 to authenticate the Responder and  Initiator, respectively. 
The Initiator and Responder need to have agreed on a method 5. </t>
        <table anchor="tab-method-types" align="center" pn="table-2">
          <name slugifiedName="name-authentication-keys-for-met">Authentication Keys for Method Types</name>
          <thead>
            <tr>
              <th align="left" colspan="1" rowspan="1">Method Type Value</th>
              <th align="left" colspan="1" rowspan="1">Initiator Authentication Key</th>
              <th align="left" colspan="1" rowspan="1">Responder Authentication Key</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="right" colspan="1" rowspan="1">5</td>
              <td align="left" colspan="1" rowspan="1">Static KEM Key (IKR scenario)</td>
              <td align="left" colspan="1" rowspan="1">Static KEM Key (IKR scenario)</td>
            </tr>
          </tbody>
        </table>
</section>
<section anchor="Auth-keys" title="Authentication Keys">
<t> The authentication key MUST be a static KEM authentication key pair.</t>
  <t>
  <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>
</section>
<section anchor="Auth-cred" title="Authentication Credentials">
<t>The authentication credentials, CRED_I and CRED_R, contain the static KEM 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"/>.
 <xref target="I-D.ietf-lamps-kyber-certificates"/> describes the conventions for using the ML-KEM in X.509 Public Key Infrastructure. </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"/>.
</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"/>.
For the authentication method defined in this document, the authentication key is the static KEM public key, and ID_CRED_R SHOULD contain an identifier of the credentials, since in the specific IKR scenario, the Responder&rsquo;s credentials have been pre-provisioned or acquired out-of-band. </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"/>. 
For the authentication method defined in this document, the authentication key is the static KEM public key, and ID_CRED_I may contain the authentication credential CRED_I or an identifier of the credentials if these have been pre-provisioned or acquired out-of-band.</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 each supported KEM in the EDHOC Key Exchange Algorithm parameter. 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 method 5 is 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>
</section>
 <section anchor="key-derive" title="Key Derivation" > 
 <t>This section highlights the differences and similarities in the key derivation process of the KEM-based authentication method for IKR scenarios compared to the KEM-based authentication method on the general case <xref target="I-D.pocero-authkem-edhoc"/> and with the original EDHOC authentication methods described in <xref target="RFC9528"></xref>. 
  An overview of the EDHOC key schedule when using the KEM-based authentication in the IKR scenarios method is shown in <xref target="key"/>, and each key derivation step is defined in the following subsections.</t>
     <figure title="EDHOC Message Key Derivation using the KEM-based IKR Authentication Method " anchor="key"> 
      <artwork align="center"><![CDATA[                                                    
          +----+                                                                                                                                                                
          |TH_1|                                                                                                                                                                
          +--+-+                                                                                                                                                                
             |                                                                                                                                                                  
+----+  +--++  +------+  +---+  +---+  +----+  +---+                                                                                                   
|ss_R|->|Ext|->|PRK_1e|--|Exp|->|K_1|->|AEAD|->|C_1|                                                                                                   
+----+  +---+  +--+---+  +--++  +---+  +--^-+  +---+                                                                                                 
                  |         |             |                                                                                                         
              +---+         |         PLAINTEXT_1                                                                                                                           
              |           +-------+-----------+                                                                                                                                 
              |           |TH_1=H(pk_eph,ct_R)|                                                                                                                                 
              |           +---------+---------+                                                                                                                                 
              |                     |                                                                                                                                           
+------+  +---+---+  +-------+   +--+---+  +-----+                                                                                                                              
|ss_eph|->|Extract|->|PRK_2m |---|Expand|->|MAC_2|                                                                                                                              
+------+  +-------+  +--+----+   +------+  +-----+                                                                                                                              
                        |                                                                                                                                                       
          +-------------+
          |                                                                                                                                                       
+----+  +-+-+  +----------+  +---+   +---+   +----+  +---+                                                                                                 
|ss_I|->|Ext|->|PRK_2e3e3m|+-|Exp|-->|K_2|-->|AEAD|->|C_2|                                                                                                 
+----+  +---+  +----------+ |+--++   +---+   +-^--+  +---+                                                                                                 
                            |   |              |                                                                                                                    
                            |   |         PLAINTEXT_2                                                                                                            
                            | +--+---------------------------+                                                                                                               
                            | |TH_2=H(H(Message1),ct_eph,ct_I|                                                                                                               
                            | +--+---------------------------+                                                                                                               
                            | +--+---+   +-----+                                                                                                                             
                            +-|Expand|-->|MAC_3|                                                                                                                             
                            | +------+   +-----+                                                                                                                             
                            | +-------------------------------+                                                                                                              
                            | |TH_3=H(TH_2,PLAINTEXT_2,CRED_R)|                                                                                                              
                            | +--+----------------------------+     
                            |    |                                                                                                     
                            | +--++    +---+   +----+  +---+                                                                                                
                            +-|Exp|--->|K_3|-->|AEAD|->|C_3|                                                                                                
                            | +---+    +---+   +-^--+  +---+                                                                                                
                            |                    |                                                                                                                   
                            |             PLAINTEXT_3                                                                                                           
                            |      +---+  +---+   +----+  +---+                                                                                          
                            +-m_4?-|Exp|->|K_4|-->|AEAD|->|C_4|                                                                                          
                            |      +--++  +---+   +-^--+  +---+                                                                                          
                            |         |             |                                                                                                             
                            |         |         PLAINTEXT_4                                                                                                     
                            | +----------+--------------------+                                                                                                              
                            | |TH_4=H(TH_3,PLAINTEXT_3,CRED_I)|                                                                                                              
                            | +----+--------------------------+                                                                                                              
                            |      |                                                                                                                                           
                            |  +--+--+  +-------+                                                                                                                            
                            +--|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 IKR authentication 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. The usage of PRKs differs from the definitions in both <xref target="I-D.pocero-authkem-edhoc"/> and <xref target="RFC9528"/>, and their names have been updated to reflect their new roles.</t>
<section title="PRK_1e">
 <t> The pseudorandom key PRK_1e is derived with the following input: </t> 
 <t>
  <list style="symbols">
    <t>The salt SHALL be TH_1.</t>
    <t>The IKM SHALL be the KEM shared secret (ss_R), used to authenticate the Responder.</t>
  </list>
 </t> 
 <t> When SHA-256 is used PRK_1e is produced as follows:</t> 
 <artwork align="left">
PRK_1e = HMAC-SHA-256( TH_1, ss_R )
    </artwork>
 <t> Where the ss_R shared secret is the output of the following functions in the Initiator and the 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>
 </section> 
 <section anchor="prk_2m" title="PRK_2m">
 <t> The pseudorandom key PRK_2m is derived with the following input:</t> 
 <t>
  <list style="symbols">
    <t>The salt SHALL be the SALT_2m  derived from PRK_1e </t>
    <t>The IKM SHALL be the ephemeral KEM shared secret ss_eph</t>
  </list>
 </t>
 <t> PRk_2m is derived as follows: </t>
   <artwork align="left">
PRK_2m = EDHOC_Extract( SALT_2m, ss_eph )
    </artwork>
<t>Where the ephemeral KEM 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_2e3e3m" title="PRK_2e3e3m">
 <t> The pseudorandom key PRK_2e3e3m is derived with the following input:</t>
  <t>
  <list style="symbols">
    <t>The salt SHALL be the SALT_2e3m, derived from PRK_2m </t>
    <t>The IKM SHALL be the KEM shared secret ss_I, used to authenticate the Initiator</t>
  </list>
 </t>
  <t> PRK_2e3e3m is derived as follows: </t>
   <artwork align="left">
PRK_2e3e3m = EDHOC_Extract( SALT_2e3m, 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>
 </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 some of the transcription hashes THs input contraction as specified in <xref target="messages"/>.  </t>
 <t> The OKMs, including keys, initialization vectors (IV), and salts derivations using EDHOC_KDF are shown in <xref target="key-derivations-kdf"/>. </t>
<t>
The main differences from the original EDHOC key schedule, as shown in <xref target="RFC9528" section="4.1.2"/> (Figure 6), 
reflect the design principle of incorporating all available shared secrets into the key schedule as soon as they are established, and are:
</t>

<t>
  <list style="symbols">
  <t> A new K_1/IV_1 is computed to encrypt the message_1 which includes the ID_CRED_I initiator credentials, using a new transcrit hash (TH_1) defined as follows:
    <artwork align="left">
TH_1 = H( pk_eph, ct_I )
  </artwork>
  The AEAD encrption of message_1 with K_1/IV_1 provide integrity protection and confidentiality 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> K_2/IV_2 are computed to encrypt and authenticate message_2, derived from the PRK computed over the three shared secrets ( ss_eph, ss_I, and ss_R ) </t>
  <t> K_2/IV_2, K_3/IV_3 and K_4/IV_4 are derived from the same PRK_2e3e3m with different THs as Info.</t>
  <t> The usage of the pseudorandom keys (PRKs) has changed, and the salt names have been selected to reflect their new roles accordingly.</t>
  </list>
 </t>
<t> 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 IKR Authentication Method" anchor="key-derivations-kdf"> 
<artwork align="center" >
K_1         = EDHOC_KDF(PRK_1e,      0,  TH_1,      plaintext_length)
IV_1        = EDHOC_KDF(PRK_1e,      1,  TH_1,      plaintext_length)
SALT_2m     = EDHOC_KDF(PRK_1e,      2,  TH_1,      hash_length)
MAC_2       = EDHOC_KDF(PRK_2m,      3,  context_2, mac_length_2)
SALT_2e3e3m = EDHOC_KDF(PRK_2m,      4,  TH_2,      hash_length)
K_2         = EDHOC_KDF(PRK_2e3e3m,  5,  TH_2,      key_length)
IV_2        = EDHOC_KDF(PRK_2e3e3m,  6,  TH_2,      key_length)
MAC_3       = EDHOC_KDF(PRK_2e3e3m,  7,  context_3, mac_length_3)
K_3         = EDHOC_KDF(PRK_2e3e3m,  8,  TH_3,      key_length)
IV_3        = EDHOC_KDF(PRK_2e3e3m,  9,  TH_3,      key_length)
PRK_out     = EDHOC_KDF(PRK_2e3e3m,  10,  TH_4,      hash_length)
K_4         = EDHOC_KDF(PRK_2e3e3m,  11,  TH_4,      key_length)
IV_4        = EDHOC_KDF(PRK_2e3e3m,  12, TH_4,      iv_length)
PRK_exporter= EDHOC_KDF(PRK_out,     13, h'',       hash_length)
</artwork>
</figure> 

 </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_2e3e3m, TH_4, hash_length )
  </artwork>
<t> The context include the trascription hash TH_4, defined as:</t>
  <artwork align="left">
TH_4 = H( TH_3, PLAINTEXT_3, CRED_I )
  </artwork>
<t> Instead of reusing the last key-exchange internal key, the final key derivation depends on both PRK_2e3e3m and a newly computed TH_4, which include PLAINTEXT_3. This approach aims to ensure robust session keys that are distinct from the MAC keys and whose confirmation implies the authentication of all the handshake 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.</t>
 <section anchor="message1" title="KEM-based Authentication EDHOC Message 1">
 <section anchor="fmessage1" title="Formating of Message 1">
 <t>The message_1 SHALL be a CBOR Sequence as defined below.</t>
   <sourcecode type="cbor" markers="false">
message_1 = (
  pk_eph : bstr,
  ct_R : bstr,
  CIPHERTEXT_1: bstr,
)
 </sourcecode>
</section>
<section anchor="icmessage1" title="Initiator Composition of Message 1">
<t>The Initiator SHALL compose message_1 as following: </t>
 <t>
  <list style="symbols">
    <t> Construct the following elements of PLAINTEX_1:
    <list style="symbols">
    <t> Chose KEM-based ikr authentication method 5.</t>
    <t> Construct SUITES_I following the <xref target="RFC9528" section="5.2.2"/> specifications </t>
    <t> Chose a connection identifier C_I and store it during the EDHOC session, as in <xref target="RFC9528" section="5.2.2"/>  </t>
    </list>
    </t> 
   <t> Encode PLAINTEXT_1 as a sequence of CBOR-encoded data items, as specified below:
    <sourcecode type="cbor" markers="false">
PLAINTEX_1 = (
  METHOD : int,
  SUITES_I : suites,
  ID_CRED_I : bstr/ -24..23, C_I,
  C_I : bstr / -24..23,
  ? EAD_1,
)
 </sourcecode></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> Encapsulate the known beforehand static KEM public key of the Responder (pk_R) by 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 transcript hash TH_1 = H(pk_eph,ct_R) </t>
  <t> Compute the PRK_1e pseudorandom key from the static KEM shared secret ( ss_R ) used to authenticate the Responder.</t>
  <t> Compute K_1/IV1 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_1, the initialization vector
      IV_1 (if used by the AEAD algorithm), the plaintext PLAINTEXT_1, and the following parameters as input:
      <list style="symbols">
      <t>protected = h''</t>
      <t>external_aad = TH_1 </t>
      <t>K_1 and IV_1 are defined in <xref target="edhoc_kdf"/></t>
      <t>PLAINTEXT_1 = ( METHOD, SUITES_I, ID_CRED_I, C_I, ?EAD_2 ) </t>  
      </list>
      CIPHERTEXT_1 is the 'ciphertext' of COSE_Encrypt0.
    </t>
  <t> Encode message_1 as a sequence of CBOR-encoded data items 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 </t>
  <t> Compute the KEM shared_secret ( ss_R ) for the authentication of the Responder by decapsulating the KEM ciphertext (ct_R) received in message_1 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 transcript hash TH_1 = H(pk_eph,ct_R) </t> 
  <t> Compute the PRK_1e pseudorandom key from the static KEM shared secret ( ss_R ) used to authenticate the Responder.</t>
  <t> Compute K_1/IV1 as in <xref target="edhoc_kdf"/> </t>
  <t> Decrypt the COSE_Encrypt0 (CIPHERTEXT_1) 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="icmessage1"/>.</t>
  <t> Process PLAINTEXT_1 as specify in <xref target="RFC9528" section="5.2.3"/> </t>
  <t> If all processing is completed successfully, then make ID_CRED_I and (if present) EAD_1 available to the application.</t>
  <t> Obtain the authentication credential (CRED_I) from the (ID_CRED_I) and the static KEM authentication key (pk_I) of the Initiator</t>
  </list>
 </t> 
</section>
</section>
<section anchor="message2" title="KEM-based authentication EDHOC Message 2">
<section anchor="fmessage2" title="Formating of Message 2">
<t>The Initiator SHALL compose message_2 as following: </t><sourcecode type="cbor" markers="false">
message_2 = (
  ct_eph : bstr,
  ct_I : bstr,
  CIPHERTEXT_2: bstr,
)
</sourcecode>
</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> Choose a connection identifier C_R and store it for the length of the EDHOC session. </t>
  <t> Compute the PRK_2m pseudorandom key from both the static KEM shared secret ( ss_R ) and the latest 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> Compute the transcript hash TH_2 = H( ct_eph, ct_I, H(message_1) ). </t>
  <t> Compute MAC_2 as defined in <xref target="edhoc_kdf"/>, with context_2 =&lt;&lt;  C_R,
      ID_CRED_R, TH_2, CRED_R, ? EAD_2 &gt;&gt; 
  <list style="symbols">
   <t> The Responder authenticates with a PRK_2m derived from the KEM ephemeral shared secret and with the shared secret computed over its static KEM public key. </t>
   <t> The mac_lenght_2 is equal to the EDHOC MAC length of the selected cipher suit. </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_2 and the External Application Data included in message_2 (EAD_2) are used.</t>
  </list> </t>
  <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>
   <t> Compute the new PRK_2e3e3m from a chain that includes the KEM shared secret for the Authentication of the Responder ( ss_R ), the ephemeral KEM shared secret ( ss_eph ), and, the latest KEM shared secret for the Authentication of the Initiator ( ss_I ) as defined in <xref target="PRK_2e3e3m"/></t> 
   <t> Derive the session key K_2/IV2 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_2, the initialization vector
      IV_2 (if used by the AEAD algorithm), the plaintext PLAINTEXT_2, and the following parameters as input:
      <list style="symbols">
      <t>protected = h''</t>
      <t>external_aad = TH_2 </t>
      <t>K_2 and IV_2 are defined in <xref target="edhoc_kdf"/></t>
      <t>PLAINTEXT_2 = ( C_R, ID_CRED_R, MAC_2, ?EAD_2 ) </t>  
      </list>
      CIPHERTEXT_2 is the 'ciphertext' of COSE_Encrypt0.
    </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 PRK_2m pseudorandom key from both the static KEM shared secret ( ss_R ) and the latest ephemeral KEM shared secret ( ss_eph ) </t>
  <t> Compute the transcript hash TH_2 = H(ct_eph,ct_I,H(message_1)) </t> 
  <t> Compute the KEM shared_secret ( ss_I ) for the authentication of the Initiator by decapsulating the KEM ciphertext (ct_I) received in message_2 using the Initiator 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_2e3e3m from a chain that includes the KEM shared secret for the Authentication of the Responder ( ss_R ), the ephemeral KEM shared secret ( ss_eph ), and the latest KEM shared secret for the Authentication of the Initiator ( ss_I ) as defined in <xref target="PRK_2e3e3m"/></t> 
  <t> Derive the session key K_2/IV2 as in  <xref target="edhoc_kdf"/>.</t>
  <t> Decrypt and verify the COSE_Encrypt0 (CIPHERTEXT_2) 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 MAC_2 as defined in <xref target="rcmessage4"/>, and make the result of the verification available to the application.</t>
  <t> If all processing is completed successfully, then make ID_CRED_R and (if present) EAD_2 available to the application as in <xref target="RFC9528" section="5.3.3"/></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,
)
</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 MAC_3 as defined in <xref target="edhoc_kdf"/>, with context_3 =&lt;&lt;  C_I,
      ID_CRED_I, TH_2, CRED_I, ? EAD_3 &gt;&gt; 
  <list style="symbols">
   <t> The Initaiator authenticate with a PRK_2e3e3m derived from the three shared secrets, including the shared secret computed over its static KEM key ( ss_I ). </t>
   <t> The mac_lenght_3 is equal to the EDHOC MAC lenght of the selected cipher suit. </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 trascript hash TH_3 and the External Aplication Data include it on Message 3 (EAD_3) are used it.</t>
  </list>
  </t> 
  <t> Compute the transcript hash TH_3=H(TH_2,PLAINTEXT_2,CRED_R) as specified in <xref target="RFC9528" section="5.4.2"/> </t>
  <t> Derive the new session key K_3/IV_3 as defined 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_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 = ( MAC_3, ?EAD_5 ) </t>  
  </list>
  CIPHERTEXT_3 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_3 as a CBOR data item as specified in  <xref target="fmessage3"/></t>
 <t>Make the connection identifiers (C_I and C_R) and the application algorithms in the selected cipher suite available to the application. </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 using available message correlation; see  <xref target="RFC9528" section="3.4.2"/>.</t>
  <t> Decrypt and verify the COSE_Encrypt0 (CIPHERTEXT_3) 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="icmessage3"/>.</t>
  <t> Verify MAC_3 as defined in <xref target="icmessage3"/>, and make the result of the verification available to the application.</t>
  <t> Compute the transcript hash TH_4 = H(TH_3,PLAINTEXT_3,CRED_I) </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> 
</section>
</section>
<section anchor="message4" title="KEM-based authentication EDHOC Message 4">
<t> This section specifies message_4, which is OPTIONAL to support. Confirmation of the latest pseudorandom key (PRK_2e3e3m) is already provided by message_2 and message_3, which are encrypted with K_2/IV_2 and K_3/IV_3, respectively.
Explicit confirmation of all prior handshake data can be achieved, if necessary, either by exchanging message_4 or by protecting the first application message from the Responder to the Initiator using a key derived from the EDHOC_Exporter. 
In both cases, authenticity is ensured through the use of keying material derived from PRK_2e3e3m and the latest transcript hash TH_4.</t>
<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_4 = (
  CIPHERTEXT_4 : 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> Derive the new session key K_4/IV_4 as defined 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 = ( EAD_4 ) </t>  
      </list>
      CIPHERTEXT_4 is the 'ciphertext' of COSE_Encrypt0.
    </t>
   <t>Encode message_4 as a CBOR data item as specified in  <xref target="fmessage4"/></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; see  <xref target="RFC9528" section="3.4.2"/>.</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> Make (if present) EAD_4 available to the application for EAD processing</t>
  </list>
</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 likr to acknowledge all the students who will attempt to define their own specification.</t>
    <t>The authors would also likr 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="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 newline="false" spacing="normal" indent="3">
          <dt>Registry Name:</dt>
          <dd>EDHOC Method Types</dd>
          <dt>Reference:</dt>
          <dd>draft-pocero-authkem-ikr-edhoc-02</dd>
        </dl>
        <t indent="0">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>7 (suggested)</td>
      <td>Static KEM Key (IKR)</td>
      <td>Static KEM Key (IKR)</td>
      <td>[draft-pocero-authkem-ikr-edhoc-02]</td>
    </tr>
  </tbody>
</table>

   
    </section>
    </section>
    <section anchor="Security" title="Security Considerations">
<t> The protocol design aligns with the fundamental PQNoise process described in <xref target="PQNoise-CCS22"/>. Specifically, the Initiator transmits its ephemeral public key in the first message, along with a key encapsulation targeting the Responder&rsquo;s known static public key.
The Initiator also includes its own credentials, unknown to the Responder, in the first message using ID_CRED_I. As defined in the I pattern of the Noise framework <xref target="Noise"/>, this approach exposes the Initiator&rsquo;s identity to a passive attacker. 
To mitigate this, the Initiator&rsquo;s credentials are encrypted using a key derived from the Responder&rsquo;s static public key, ensuring that only the intended Responder can decrypt the credentials. </t>
<t> Full forward secrecy and explicit mutual authentication are achieved once the KEM-based ikr EDHOC handshake is completed, as in the static-DH EDHOC handshake.
While this mechanism preserves the Initiator&rsquo;s anonymity against active attackers, the identity is protected only by the Responder public key, which makes it vulnerable if the Responder&rsquo;s static key is later compromised, and vulnerable to be replayed. </t> 
 <t> This KEM-based authnetication method does not provide non-repudiation, but only implicit proof of participation as 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>

   
  </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;
      

    </references>
    <references title="Informative References">
      &RFC2119;
      &RFC9053;
      &I-D.pocero-authkem-edhoc;
       <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="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>
    
  </back>
</rfc>
