<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.19 (Ruby 3.3.3) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-bastian-jose-dvs-00" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.23.2 -->
  <front>
    <title abbrev="DVS for JOSE">Designated Verifier Signatures for JOSE</title>
    <seriesInfo name="Internet-Draft" value="draft-bastian-jose-dvs-00"/>
    <author fullname="Paul Bastian">
      <organization/>
      <address>
        <email>bastianpaul@googlemail.com</email>
      </address>
    </author>
    <author fullname="Micha Kraus">
      <organization/>
      <address>
        <email>kraus.micha@gmail.com</email>
      </address>
    </author>
    <date year="2024" month="October" day="18"/>
    <area>Security</area>
    <workgroup>Javascript Object Signing and Encryption</workgroup>
    <keyword>JOSE</keyword>
    <keyword>JWS</keyword>
    <keyword>designated verifier signature</keyword>
    <keyword>HPKE</keyword>
    <abstract>
      <?line 66?>

<t>This specification defines structures and algorithm descriptions for the use of designated verifier signatures, based on a combination of Key Agreement and Message Authentication Code, with JOSE.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://paulbastian.github.io/draft-bastian-jose-dvs/draft-bastian-jose-dvs.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-bastian-jose-dvs/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        Javascript Object Signing and Encryption Working Group mailing list (<eref target="mailto:jose@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/jose/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/jose/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/paulbastian/draft-bastian-jose-dvs"/>.</t>
    </note>
  </front>
  <middle>
    <?line 70?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>Designated verifier signatures (DVS) are signature schemes in which signatures are generated, that can only be verified by a particular party. Unlike conventional digital signature schemes like ECDSA, this enables repudiable signatures.</t>
      <t>This specification describes a general structure for designated verifier signature schemes and specified a set of instantiations that use a combination of an KA-DH (Diffie-Hellman key aggrement) with an MAC (Message Authentication Code algorithm).</t>
      <t>The combination of ECKA-DH and MAC is a established mechanism and used, for example, in the mobile driving licence (mDL) application, specified in <xref target="ISO-18013-5"/>.</t>
      <t>This specification and all described algorithms should respect the efforts for <eref target="https://www.ietf.org/archive/id/draft-jones-jose-fully-specified-algorithms-00.html">Fully Specified Algorithms</eref>.</t>
      <t>This algorithm is intended for use with digital credentials ecosystems, including the Issuer-Holder-Verifier model described by W3C VCDM or IETF SD-JWT-VC.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      <?line -18?>

</section>
    <section anchor="terminology">
      <name>Terminology</name>
      <t>The draft uses "JSON Web Signature", "JOSE Header", "JWS Signature", "JWS Signing Input" as defined by <xref target="RFC7515"/>.</t>
      <dl>
        <dt>Signing Party:</dt>
        <dd>
          <t>The Party that performs the key agreement first and generates the MAC. Similar to a Signer.</t>
        </dd>
        <dt>Verifying Party:</dt>
        <dd>
          <t>The Party that performs the key agreement second, generates the MAC and compares it to a given value. Similar to a Verifier.</t>
        </dd>
      </dl>
    </section>
    <section anchor="cryptographic-dependencies">
      <name>Cryptographic Dependencies</name>
      <t>DVS rely on the following primitives:</t>
      <ul spacing="normal">
        <li>
          <t>A Diffie-Hellman Key Agreement (KA-DH), for example ECKA-DH defined in <xref target="BSI-TR-03111"/>:
          </t>
          <ul spacing="normal">
            <li>
              <t><tt>DH(skX, pkY)</tt>: Perform a non-interactive Diffie-Hellman exchange using the private key <tt>skX</tt> and public key <tt>pkY</tt> to produce a Diffie-Hellman shared secret of length Ndh. This function can raise a ValidationError.</t>
            </li>
            <li>
              <t><tt>Ndh</tt>: The length in bytes of a Diffie-Hellman shared secret produced by <tt>DH()</tt>.</t>
            </li>
            <li>
              <t><tt>Nsk</tt>: The length in bytes of a Diffie-Hellman private key.</t>
            </li>
          </ul>
        </li>
        <li>
          <t>A key derivation function (KDF), for example HKDF defined in <xref target="RFC5869"/>:
          </t>
          <ul spacing="normal">
            <li>
              <t><tt>Extract(salt, ikm)</tt>: Extract a pseudorandom key of fixed length Nh bytes from input keying material <tt>ikm</tt> and an optional byte string <tt>salt</tt>.</t>
            </li>
            <li>
              <t><tt>Expand(prk, info, L)</tt>: Expand a pseudorandom key <tt>prk</tt> using optional string <tt>info</tt> into <tt>L</tt> bytes of output keying material.</t>
            </li>
            <li>
              <t><tt>Nh</tt>: The output size of the Extract() function in bytes.</t>
            </li>
          </ul>
        </li>
        <li>
          <t>A Message Authentication Code algorithm (MAC), for example HMAC defined in <xref target="RFC2104"/>:
          </t>
          <ul spacing="normal">
            <li>
              <t><tt>MacSign(k, i)</tt>: Returns an authenticated tag for the given input <tt>i</tt> and key <tt>k</tt>.</t>
            </li>
            <li>
              <t><tt>Nk</tt>: The length in bytes of key <tt>k</tt>.</t>
            </li>
          </ul>
        </li>
      </ul>
    </section>
    <section anchor="designated-verifier-signatures">
      <name>Designated Verifier Signatures</name>
      <t>A designated verifier signature requires three components for an algorithm:</t>
      <ol spacing="normal" type="1"><li>
          <t>a Diffie-Hellman Key Agreement (DHKA)</t>
        </li>
        <li>
          <t>a Key Derivation Function (KDF)</t>
        </li>
        <li>
          <t>a Message Authentication Code algorithm (MAC)</t>
        </li>
      </ol>
      <t>In general, these parameters are chosen by the Signing Party. These parameters need to be communicated to the Verifying Party before the generation of a Designated Verifier Signature.</t>
      <section anchor="signature-generation">
        <name>Signature Generation</name>
        <t>The generation of the Designated Verifier Signature takes the private key of the Signing Party, the public key of the Verifying Party and the message as inputs. The retrieval and communication of the Verifying Party's public key is out of scope of this specification and subject to the implementing protocols.</t>
        <t>Input:</t>
        <ul spacing="normal">
          <li>
            <t><tt>skS</tt>: private key of the Signing Party</t>
          </li>
          <li>
            <t><tt>pkR</tt>: public key of the Verifying Party</t>
          </li>
          <li>
            <t><tt>msg</tt>: JWS Signing Input</t>
          </li>
          <li>
            <t><tt>salt</tt> : Salt for key derivation</t>
          </li>
          <li>
            <t><tt>info</tt> : optional info for key derivation</t>
          </li>
        </ul>
        <t>Function:</t>
        <artwork><![CDATA[
def dvsSign(skS, pkR, msg, salt= "", info = "DVS-1")

    dh =  DH(skS, pkR)
    prk = Extract(salt, dh)
    k = Expand(prk, info, Nk)
    signature = MacSign(k, msg)
    return signature
]]></artwork>
      </section>
      <section anchor="signature-verification">
        <name>Signature Verification</name>
        <t>The generation of the Designated Verifier Signature takes the private key of the Signing Party, the public key of the Verifying Party and the message as inputs. The retrieval and communication of the Verifying Party's public key is out of scope of this specification and subject to the implementing protocols.</t>
        <t>Input:</t>
        <ul spacing="normal">
          <li>
            <t><tt>skR</tt>: private key of the Verifying Party</t>
          </li>
          <li>
            <t><tt>pkS</tt>: public key of the Signing Party</t>
          </li>
          <li>
            <t><tt>msg</tt>: JWS Signing Input</t>
          </li>
          <li>
            <t><tt>salt</tt> : Salt for key derivation</t>
          </li>
          <li>
            <t><tt>info</tt> : optional info for key derivation</t>
          </li>
          <li>
            <t><tt>signature</tt> : the Message Authentication Code</t>
          </li>
        </ul>
        <t>Function:</t>
        <artwork><![CDATA[
def dvsVerify(skR, pkS, msg, salt = "", info = "DVS-1", signature)

    dh =  DH(skR, pkS)
    prk = Extract(salt, dh)
    k = Expand(prk, info, Nk)
    signature' = MacSign(k, msg)
    if signature != signature':
    raise Exception("Designated Verifier Signature invalid")
    return
]]></artwork>
      </section>
      <section anchor="generic_suites">
        <name>Signature Suites</name>
        <t>Algorithms <bcp14>MUST</bcp14> follow the naming <tt>DVS-&lt;DHKA&gt;-&lt;KDF&gt;-&lt;MAC&gt;</tt>.</t>
      </section>
    </section>
    <section anchor="designated-verifier-signatures-for-jose">
      <name>Designated Verifier Signatures for JOSE</name>
      <t>Designated Verifier Signatures behave like a digital signature as described in Section 3 of <xref target="RFC7518"/> and are intended for use in JSON Web Signatures (JWS) as described in <xref target="RFC7515"/>. The Generating Party performs the <tt>Message Signature or MAC Computation</tt> as defined by Section 5.1 of <xref target="RFC7515"/>. The Verifying Party performs the <tt>Message Signature or MAC Validation</tt> as defined by Section 5.2 of <xref target="RFC7515"/>.</t>
      <t>The following JWS headers are used to convey Designated Verifier Signatures for JOSE:</t>
      <ul spacing="normal">
        <li>
          <t><tt>alg</tt> : <bcp14>REQUIRED</bcp14>. The algorithm parameter describes the chosen signature suite, for example the ones described in (#generic_suites) and (#hpke_suites).</t>
        </li>
        <li>
          <t><tt>rpk</tt> : <bcp14>REQUIRED</bcp14>. The <tt>rpk</tt> (recipient public key) parameter represents the encoded public key of the Verifying Party that was used in the DHKA algorithm as a JSON Web Key according to <xref target="RFC7517"/>. This parameter <bcp14>MUST</bcp14> be present.</t>
        </li>
        <li>
          <t><tt>nonce</tt> : <bcp14>OPTIONAL</bcp14>. The <tt>nonce</tt> may be provided by the Verifying Party additional to it's public key and ensure additional freshness of the signature. If provided, the Signing Party <bcp14>SHOULD</bcp14> add the <tt>nonce</tt> to the header.</t>
        </li>
      </ul>
      <t>The Signing Party may use existing JWS header parameters like <tt>x5c</tt>, <tt>jwk</tt> or <tt>kid</tt> to represent or reference it's public key according to <xref target="RFC7517"/>.</t>
      <section anchor="example-jwt">
        <name>Example JWT</name>
        <t>The JWT/JWS header:</t>
        <artwork><![CDATA[
{
    "typ" : "JWT",
    "alg" : "DVS-P256-SHA256-HS256",
    "jwk" : <JWK of the Signing Party>,
    "rpk" : <JWK of Verifying Party>
}
]]></artwork>
        <t>The JWT/JWS payload:</t>
        <artwork><![CDATA[
{
    "iss" : "https://example.as.com",
    "iat" : "1701870613",
    "given_name" : "Erika",
    "family_name" : "Mustermann"
}
]]></artwork>
        <t>The JWT/JWS signature:</t>
        <artwork><![CDATA[
base64-encoded MAC
]]></artwork>
        <t>This specification described instantiations of Designated Verifier Signatures using specific algorithm combinations:</t>
        <artwork type="ascii-art"><![CDATA[
+-----------------------+-----------------------------+----------------+
| Algorithm Name        | Algorithm Description       |                |
|                       |                             | Requirements   |
+-----------------------+-----------------------------+----------------+
| DVS-P256-SHA256-HS256 | ECDH using NIST P-256,      |   Optional     |
|                       | HKDF using SHA-256 and      |                |
|                       | HMAC using SHA-256          |                |
+-----------------------+-----------------------------+----------------+
| DVS-HPKE-Auth-X25519  | DVS based on HPKE using     |                |
| -SHA256               | DHKEM(X25519, HKDF-SHA256)  |  Optional      |
| -ChaCha20Poly1305     | HKDF-SHA256 KDF and         |  (Appendix A)  |
|                       | ChaCha20Poly1305 AEAD       |                |
+-----------------------+-----------------------------+----------------+
| DVS-HPKE-Auth-P256    | DVS based on HPKE using     |                |
| -SHA256-AES128GCM     | DHKEM(P-256, HKDF-SHA256)   |   Optional     |
|                       | HKDF-SHA256 KDF and         |   (Appendix A) |
|                       | AES-128-GCM AEAD            |                |
+-----------------------+-----------------------------+----------------+
]]></artwork>
      </section>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <section anchor="replay-attack-detection">
        <name>Replay Attack Detection</name>
        <t>Verifying party <bcp14>MUST</bcp14> ensure the freshness of signatures by utilizing ephemeral keys in <tt>rpk</tt> or by providing a nonce for <tt>nonce</tt>.</t>
      </section>
      <section anchor="limited-repudiability">
        <name>Limited Repudiability</name>
        <t>A malicious verifiying party can weaken the repudiability property by involving certain third parties in the protocol steps.</t>
        <ul spacing="normal">
          <li>
            <t>One method is to have a third party observe all protocol steps so that third party can be sure that the signature originates by the signer.</t>
          </li>
          <li>
            <t>Another method requires that the verifying party's public key is a shared key that has previously been calculated with the keys of certain specific third parties so that the proof of authenticity can be done with Multi Party Computation involving all parties (see <xref target="TLS-NOTARY"/>).</t>
          </li>
        </ul>
      </section>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>Define:</t>
      <ul spacing="normal">
        <li>
          <t>define new <tt>rpk</tt> header parameter</t>
        </li>
        <li>
          <t>alg values for DVS-P256-SHA256-HS256 and some more</t>
        </li>
      </ul>
    </section>
  </middle>
  <back>
    <references anchor="sec-combined-references">
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="RFC7515">
          <front>
            <title>JSON Web Signature (JWS)</title>
            <author fullname="M. Jones" initials="M." surname="Jones"/>
            <author fullname="J. Bradley" initials="J." surname="Bradley"/>
            <author fullname="N. Sakimura" initials="N." surname="Sakimura"/>
            <date month="May" year="2015"/>
            <abstract>
              <t>JSON Web Signature (JWS) represents content secured with digital signatures or Message Authentication Codes (MACs) using JSON-based data structures. Cryptographic algorithms and identifiers for use with this specification are described in the separate JSON Web Algorithms (JWA) specification and an IANA registry defined by that specification. Related encryption capabilities are described in the separate JSON Web Encryption (JWE) specification.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7515"/>
          <seriesInfo name="DOI" value="10.17487/RFC7515"/>
        </reference>
        <reference anchor="RFC7517">
          <front>
            <title>JSON Web Key (JWK)</title>
            <author fullname="M. Jones" initials="M." surname="Jones"/>
            <date month="May" year="2015"/>
            <abstract>
              <t>A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. This specification also defines a JWK Set JSON data structure that represents a set of JWKs. Cryptographic algorithms and identifiers for use with this specification are described in the separate JSON Web Algorithms (JWA) specification and IANA registries established by that specification.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7517"/>
          <seriesInfo name="DOI" value="10.17487/RFC7517"/>
        </reference>
        <reference anchor="RFC7518">
          <front>
            <title>JSON Web Algorithms (JWA)</title>
            <author fullname="M. Jones" initials="M." surname="Jones"/>
            <date month="May" year="2015"/>
            <abstract>
              <t>This specification registers cryptographic algorithms and identifiers to be used with the JSON Web Signature (JWS), JSON Web Encryption (JWE), and JSON Web Key (JWK) specifications. It defines several IANA registries for these identifiers.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7518"/>
          <seriesInfo name="DOI" value="10.17487/RFC7518"/>
        </reference>
        <reference anchor="RFC9180">
          <front>
            <title>Hybrid Public Key Encryption</title>
            <author fullname="R. Barnes" initials="R." surname="Barnes"/>
            <author fullname="K. Bhargavan" initials="K." surname="Bhargavan"/>
            <author fullname="B. Lipp" initials="B." surname="Lipp"/>
            <author fullname="C. Wood" initials="C." surname="Wood"/>
            <date month="February" year="2022"/>
            <abstract>
              <t>This document describes a scheme for hybrid public key encryption (HPKE). This scheme provides a variant of public key encryption of arbitrary-sized plaintexts for a recipient public key. It also includes three authenticated variants, including one that authenticates possession of a pre-shared key and two optional ones that authenticate possession of a key encapsulation mechanism (KEM) private key. HPKE works for any combination of an asymmetric KEM, key derivation function (KDF), and authenticated encryption with additional data (AEAD) encryption function. Some authenticated variants may not be supported by all KEMs. We provide instantiations of the scheme using widely used and efficient primitives, such as Elliptic Curve Diffie-Hellman (ECDH) key agreement, HMAC-based key derivation function (HKDF), and SHA2.</t>
              <t>This document is a product of the Crypto Forum Research Group (CFRG) in the IRTF.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9180"/>
          <seriesInfo name="DOI" value="10.17487/RFC9180"/>
        </reference>
        <reference anchor="RFC5869">
          <front>
            <title>HMAC-based Extract-and-Expand Key Derivation Function (HKDF)</title>
            <author fullname="H. Krawczyk" initials="H." surname="Krawczyk"/>
            <author fullname="P. Eronen" initials="P." surname="Eronen"/>
            <date month="May" year="2010"/>
            <abstract>
              <t>This document specifies a simple Hashed Message Authentication Code (HMAC)-based key derivation function (HKDF), which can be used as a building block in various protocols and applications. The key derivation function (KDF) is intended to support a wide range of applications and requirements, and is conservative in its use of cryptographic hash functions. This document is not an Internet Standards Track specification; it is published for informational purposes.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5869"/>
          <seriesInfo name="DOI" value="10.17487/RFC5869"/>
        </reference>
        <reference anchor="RFC2104">
          <front>
            <title>HMAC: Keyed-Hashing for Message Authentication</title>
            <author fullname="H. Krawczyk" initials="H." surname="Krawczyk"/>
            <author fullname="M. Bellare" initials="M." surname="Bellare"/>
            <author fullname="R. Canetti" initials="R." surname="Canetti"/>
            <date month="February" year="1997"/>
            <abstract>
              <t>This document describes HMAC, a mechanism for message authentication using cryptographic hash functions. HMAC can be used with any iterative cryptographic hash function, e.g., MD5, SHA-1, in combination with a secret shared key. The cryptographic strength of HMAC depends on the properties of the underlying hash function. This memo provides information for the Internet community. This memo does not specify an Internet standard of any kind</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="2104"/>
          <seriesInfo name="DOI" value="10.17487/RFC2104"/>
        </reference>
        <reference anchor="BSI-TR-03111" target="https://www.bsi.bund.de/dok/TR-03111-en">
          <front>
            <title>Technical Guideline BSI TR-03111: Elliptic Curve Cryptography, Version 2.10</title>
            <author>
              <organization/>
            </author>
            <date year="2018" month="June"/>
          </front>
        </reference>
        <reference anchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <reference anchor="HPKE-IANA" target="https://www.iana.org/assignments/hpke/hpke.xhtml">
          <front>
            <title>Hybrid Public Key Encryption (HPKE) IANA Registry</title>
            <author>
              <organization/>
            </author>
            <date year="2023" month="October"/>
          </front>
        </reference>
        <reference anchor="ISO-18013-5" target="https://www.iso.org/standard/69084.html">
          <front>
            <title>ISO/IEC 18013-5:2021, Personal identification — ISO-compliant driving licence, Part 5: Mobile driving licence (mDL) application</title>
            <author>
              <organization/>
            </author>
            <date year="2021" month="September"/>
          </front>
        </reference>
        <reference anchor="TLS-NOTARY" target="https://tlsnotary.org/">
          <front>
            <title>TLSNotary project</title>
            <author>
              <organization/>
            </author>
            <date year="2024" month="October"/>
          </front>
        </reference>
      </references>
    </references>
    <?line 283?>

<section anchor="designated-verifier-signatures-using-hpke">
      <name>Designated Verifier Signatures using HPKE</name>
      <t>This section describes a simple designated verifier signature scheme based on Hybrid Public Key Encryption (HPKE) <xref target="RFC9180"/> in auth mode.
It reuses the authentication scheme underlying the AEAD algorithm in use, while using the KEM to establish a one-time authentication key from a pair of KEM public keys.
This scheme was described in early specification drafts of HPKE <xref target="RFC9180"/></t>
      <section anchor="cryptographic-dependencies-1">
        <name>Cryptographic Dependencies</name>
        <ul spacing="normal">
          <li>
            <t>An HPKE algorithm (for the HPKE variants):</t>
          </li>
          <li>
            <t><tt>SealAuth(pkR, info, aad, pt, skS)</tt>: encrypts and authenticates single plaintext <tt>pt</tt> with associated data <tt>aad</tt> and context <tt>info</tt> using a private sender key <tt>skS</tt> and public receiver key <tt>pkR</tt>.</t>
          </li>
          <li>
            <t><tt>OpenAuth(enc, skR, info, aad, ct, pkS)</tt>: decrypts ciphertext and tag <tt>ct</tt> with associated data <tt>aad</tt> and context <tt>info</tt> using a private receiver key <tt>skR</tt> and public sender key <tt>pkS</tt>.</t>
          </li>
        </ul>
      </section>
      <section anchor="signature-generation-1">
        <name>Signature Generation</name>
        <t>To create a signature, the sender simply calls the single-shot <tt>Seal()</tt> method with an empty plaintext value and the message to be signed as AAD.
This produces an encoded key enc and a ciphertext value that contains only the AAD tag. The signature value is the concatenation of the encoded key and the AAD tag.</t>
        <t>Input:</t>
        <ul spacing="normal">
          <li>
            <t><tt>skS</tt>: private key of the Signing Party</t>
          </li>
          <li>
            <t><tt>pkR</tt>: public key of the Verifying Party</t>
          </li>
          <li>
            <t><tt>msg</tt>: JWS Signing Input</t>
          </li>
          <li>
            <t><tt>info</tt> : optional info for key derivation</t>
          </li>
        </ul>
        <t>Steps:</t>
        <ol spacing="normal" type="1"><li>
            <t>Call <tt>enc</tt>, <tt>ct</tt> = <tt>SealAuth(pkR, info, aad, pt, skS)</tt> with
* <tt>aad</tt> = <tt>msg</tt>
* <tt>pt</tt> = ""</t>
          </li>
          <li>
            <t>JWS Signature is the octet string concatenation of (<tt>enc</tt> || <tt>ct</tt>)</t>
          </li>
        </ol>
      </section>
      <section anchor="signature-verification-1">
        <name>Signature Verification</name>
        <t>To verify a signature, the recipient extracts encoded key and the AAD tag from the signature value and calls the single-shor <tt>Open()</tt> with the provided ciphertext.
If the AEAD authentication passes, then the signature is valid.</t>
        <t>Input:</t>
        <ul spacing="normal">
          <li>
            <t><tt>skR</tt>: private key of the Verifying Party</t>
          </li>
          <li>
            <t><tt>pkS</tt>: public key of the Signing Party</t>
          </li>
          <li>
            <t><tt>msg</tt>: JWS Signing Input</t>
          </li>
          <li>
            <t><tt>info</tt> : optional info for key derivation</t>
          </li>
          <li>
            <t><tt>signature</tt>: JWS Signature octet string</t>
          </li>
        </ul>
        <t>Steps:</t>
        <ol spacing="normal" type="1"><li>
            <t>Decode <tt>enc</tt> || <tt>ct</tt> = <tt>signature</tt> by length of <tt>enc</tt> and <tt>ct</tt>. See <xref target="HPKE-IANA"/> for length of ct and enc.</t>
          </li>
          <li>
            <t>Call <tt>pt</tt> = <tt>OpenAuth(enc, skR, info, aad, ct, pkS)</tt> with
* <tt>aad</tt> = msg</t>
          </li>
          <li>
            <t>the signature is valid, when <tt>OpenAuth()</tt> returns <tt>pt</tt> = "" with no authentication exception</t>
          </li>
        </ol>
        <t>NOTE: <tt>ct</tt> contains only a tag. It's length depends on the AEAD algorithm (see Nt values in RFC9180 chapter 7.3.)</t>
      </section>
      <section anchor="hpke_suites">
        <name>Signature Suites</name>
        <t>Algorithms <bcp14>MUST</bcp14> follow the naming <tt>DVS-HPKE-&lt;Mode&gt;-&lt;KEM&gt;-&lt;KDF&gt;-&lt;AEAD&gt;</tt>.
"Mode" is Auth (PSKAuth could also be used).
The "KEM", "KDF", and "AEAD" values are chosen from the HPKE IANA registry <xref target="HPKE-IANA"/>.</t>
      </section>
    </section>
    <section anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>Thanks to:</t>
      <ul spacing="normal">
        <li>
          <t>Brian Campbell</t>
        </li>
        <li>
          <t>John Bradley</t>
        </li>
      </ul>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA+1b63bbyJH+j6fo0D9CJgIl+j48tjO0SI9kW5cVNePMSXLC
JtAkewgCCBqUxHg0Zx9iHyDPkkfZJ9mvqhsEQFKynJ3d/bM6OiLY6K6ue1VX
tXzf93KdR6orGn1l9DSWuQrFDyrTE60y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