Encap

abstract fun Encap(pkR: PublicKey, ikm: ByteArray? = null): HPKE.EncapResult(source)

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.