Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val kemId: Int

RFC 9180 kem_id

Link copied to clipboard
abstract val Nenc: BitLength

The length in bytes of an encapsulated key produced by this KEM.

Link copied to clipboard
abstract val Npk: BitLength

The length in bytes of an encoded public key for this KEM.

Link copied to clipboard
abstract val Nsecret: BitLength

The length in bytes of a KEM shared secret produced by this KEM.

Functions

Link copied to clipboard
abstract fun Decap(enc: ByteArray, skR: SecretKey): ByteArray

Deterministic algorithm using the private key skR to recover the ephemeral symmetric key (the KEM shared secret) from its encapsulated representation enc. This function can raise a DecapError on decapsulation failure.

Link copied to clipboard

Deterministic algorithm to derive a key pair (skX, pkX) from the byte string ikm, where ikm SHOULD have at least Nsk bytes of entropy.

Link copied to clipboard

Parse a byte string of length Npk to recover a public key. This function can raise a DeserializeError error upon pkXm deserialization failure.

Link copied to clipboard
abstract fun Encap(pkR: PublicKey, ikm: ByteArray? = null): HPKE.EncapResult

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. This function can raise an EncapError on encapsulation failure.

Link copied to clipboard

Randomized algorithm to generate a key pair (skX, pkX).

Link copied to clipboard

Produce a byte string of length Npk encoding the public key pkX.