logo
pub trait EncappedKey: AsRef<[u8]> + Debug + Sized {
    type EncappedKeySize: ArrayLength<u8>;
    type SharedSecretSize: ArrayLength<u8>;
    type SenderPublicKey;
    type RecipientPublicKey;

    fn from_bytes(
        bytes: &GenericArray<u8, Self::EncappedKeySize>
    ) -> Result<Self, Error>; fn as_bytes(&self) -> &GenericArray<u8, Self::EncappedKeySize> { ... } }
Expand description

Trait impl’d by concrete types that represent an encapsulated key. This is intended to be, in essence, a bag of bytes.

Required Associated Types

The size, in bytes, of an encapsulated key.

The size, in bytes, of the shared secret that this KEM produces.

Represents the identity key of an encapsulator. This is used in authenticated decapsulation.

The public key of a decapsulator. This is used in encapsulation.

Required Methods

Parses an encapsulated key from its byte representation.

Provided Methods

Borrows a byte slice representing the serialized form of this encapsulated key.

Implementors