[][src]Crate hpke

Re-exports

pub use digest::generic_array;

Modules

aead
kdf
kem
kex
op_mode
setup
single_shot

Structs

AeadCtxR

The HPKE receiver's context. This is what you use to open ciphertexts.

AeadCtxS

The HPKE senders's context. This is what you use to seal plaintexts.

EncappedKey

This holds the content of an encapsulated secret. It is output by the encap and encap_auth functions.

PskBundle

Contains preshared key bytes and an identifier

Enums

HpkeError

Describes things that can go wrong when trying to seal or open a ciphertext

OpModeR

The operation mode of the receiver's side of HPKE. This determines what information is folded into the encryption context derived in the setup_receiver functions. You can include a preshared key, the identity key of the sender, both, or neither.

OpModeS

The operation mode of the sender's side of HPKE. This determines what information is folded into the encryption context derived in the setup_sender functions. You can include a preshared key, the identity key of the sender, both, or neither.

Traits

Kem

Defines a combination of key exchange mechanism and a KDF, which together form a KEM

KeyExchange

This trait captures the requirements of a key exchange mechanism. It must have a way to generate keypairs, perform the KEX computation, and marshal/umarshal KEX pubkeys

Marshallable

Implemented by types that have a fixed-length byte representation

Unmarshallable

Implemented by types that can be deserialized from byte representation

Functions

setup_receiver

Initiates an encryption context given a private key sk and an encapsulated key which was encapsulated to sk's corresponding public key

setup_sender

Initiates an encryption context to the given recipient. Does an "authenticated" encapsulation if sk_sender_id is set. This ties the sender identity to the shared secret.

single_shot_open

Does a setup_receiver and AeadCtx::open in one shot. That is, it does a key decapsulation for the specified recipient and decrypts the provided plaintext in place. See setup::setup_reciever and AeadCtx::open for more detail.

single_shot_seal

Does a setup_sender and AeadCtx::seal in one shot. That is, it does a key encapsulation to the specified recipient and encrypts the provided plaintext in place. See setup::setup_sender and AeadCtx::seal for more detail.