Package com.yahoo.security.hpke
Interface Kem
public interface Kem
Key encapsulation mechanism (KEM)
- Author:
- vekterli
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordstatic final record -
Method Summary
Modifier and TypeMethodDescriptionbyte[]authDecap(byte[] enc, XECPrivateKey skR, XECPublicKey pkS) Section 4 Cryptographic Dependencies: "Same asDecap(), and the recipient is assured that the KEM shared secret was generated by the holder of the private keyskS."authEncap(XECPublicKey pkR, XECPrivateKey skS) Section 4: Cryptographic Dependencies: "Same asEncap(), and the outputs encode an assurance that the KEM shared secret was generated by the holder of the private keyskS."byte[]decap(byte[] enc, XECPrivateKey skR) Section 4 Cryptographic Dependencies: "Deterministic algorithm using the private keyskRto recover the ephemeral symmetric key (the KEM shared secret) from its encapsulated representationenc."static Kemstatic KemReturns an unsafe test KEM that returns a single fixed, deterministic key pair.encap(XECPublicKey pkR) Section 4 Cryptographic Dependencies: "Randomized algorithm to generate an ephemeral, fixed-length symmetric key (the KEM shared secret) and a fixed-length encapsulation of that key that can be decapsulated by the holder of the private key corresponding topkR"shortkemId()Predefined KEM ID, as given in RFC 9180 section 7.1shortnEnc()The length in bytes of an encapsulated key produced by this KEM.shortnPk()The length in bytes of an encoded public key for this KEM.shortnSecret()The length in bytes of a KEM shared secret produced by this KEM.shortnSk()The length in bytes of an encoded private key for this KEM.
-
Method Details
-
encap
Section 4 Cryptographic Dependencies:"Randomized algorithm to generate an ephemeral, fixed-length symmetric key (the KEM shared secret) and a fixed-length encapsulation of that key that can be decapsulated by the holder of the private key corresponding to
pkR" -
authEncap
Section 4: Cryptographic Dependencies:"Same as
Encap(), and the outputs encode an assurance that the KEM shared secret was generated by the holder of the private keyskS." -
decap
Section 4 Cryptographic Dependencies:"Deterministic algorithm using the private key
skRto recover the ephemeral symmetric key (the KEM shared secret) from its encapsulated representationenc." -
authDecap
Section 4 Cryptographic Dependencies:"Same as
Decap(), and the recipient is assured that the KEM shared secret was generated by the holder of the private keyskS." -
nSecret
short nSecret()The length in bytes of a KEM shared secret produced by this KEM. -
nEnc
short nEnc()The length in bytes of an encapsulated key produced by this KEM. -
nPk
short nPk()The length in bytes of an encoded public key for this KEM. -
nSk
short nSk()The length in bytes of an encoded private key for this KEM. -
kemId
short kemId()Predefined KEM ID, as given in RFC 9180 section 7.1 -
dHKemX25519HkdfSha256
- Returns:
- a
HKEM(X25519, HKDF-SHA256)instance that generates new ephemeral X25519 key pairs from a secure random source perencap(XECPublicKey)invocation.
-
dHKemX25519HkdfSha256
Returns an unsafe test KEM that returns a single fixed, deterministic key pair. As the name implies, this must only ever be used in the context of testing. If anyone tries to be clever and use this anywhere else, I will find them and bite them in the ankles!
-