Trait kem::EncappedKey
source · [−]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
type EncappedKeySize: ArrayLength<u8>
type EncappedKeySize: ArrayLength<u8>
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
fn from_bytes(
bytes: &GenericArray<u8, Self::EncappedKeySize>
) -> Result<Self, Error>
fn from_bytes(
bytes: &GenericArray<u8, Self::EncappedKeySize>
) -> Result<Self, Error>
Parses an encapsulated key from its byte representation.
Provided Methods
fn as_bytes(&self) -> &GenericArray<u8, Self::EncappedKeySize>
fn as_bytes(&self) -> &GenericArray<u8, Self::EncappedKeySize>
Borrows a byte slice representing the serialized form of this encapsulated key.