package hpke
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=31903fa28f87008bc54ed69aa6067f9f
sha512=0421f20c0a6a3767f0af428dc8ba458a8a660b1a23cedf0d8c4b0cd22d54533f4cd38f513f55c7b1e22d7e8d76df625feceb0bbf88db4f8bacc1c2cada5878cf
doc/hpke.for_testing/Hpke_for_testing/index.html
Module Hpke_for_testingSource
Deterministic RFC 9180 entry points for known-answer testing only.
RFC 9180 requires the sender's ephemeral key to be fresh and secret for every context. The functions here let the caller choose it instead, so that published test vectors which fix skE can be reproduced byte for byte, including those of protocols layered on HPKE such as RFC 9458. Reusing or disclosing an ephemeral key breaks the confidentiality of every message sealed under it, so this library must not be used by production protocols. Use Hpke.Rfc9180 instead.
val setup_base_sender :
'capability Hpke.Suite.t ->
ephemeral:Hpke.Private_key.t ->
recipient:Hpke.Public_key.t ->
info:string ->
('capability Hpke.Rfc9180.sender_setup, Hpke.Error.t) resultsetup_base_sender suite ~ephemeral ~recipient ~info is Hpke.Rfc9180.setup_base_sender with ephemeral as skE in place of a freshly generated key. The encapsulated key is the public key of ephemeral. Returns Hpke.Error.t.Key_mismatch unless the suite, the ephemeral key, and the recipient key share one KEM.
val setup_psk_sender :
'capability Hpke.Suite.t ->
ephemeral:Hpke.Private_key.t ->
recipient:Hpke.Public_key.t ->
psk:Hpke.Psk.t ->
info:string ->
('capability Hpke.Rfc9180.sender_setup, Hpke.Error.t) resultThe PSK-mode counterpart of setup_base_sender.