pub struct Ciphertext(/* private fields */);
Expand description
The ciphertext computed by the encapsulator.
Implementations§
Trait Implementations§
Source§impl AsRef<[u8]> for Ciphertext
impl AsRef<[u8]> for Ciphertext
Source§impl Debug for Ciphertext
impl Debug for Ciphertext
Source§impl<'sk> Decapsulator<Ciphertext> for SecretKey<'sk>
Available on crate feature kem
only.
impl<'sk> Decapsulator<Ciphertext> for SecretKey<'sk>
Available on crate feature
kem
only.Source§fn try_decap(
&self,
ciphertext: &Ciphertext,
) -> Result<SharedSecret<Ciphertext>, Error>
fn try_decap( &self, ciphertext: &Ciphertext, ) -> Result<SharedSecret<Ciphertext>, Error>
Attempt to decapsulate the given encapsulated key. Returns the shared secret on success, or
an error if something went wrong.
Source§impl EncappedKey for Ciphertext
Available on crate feature kem
only.
impl EncappedKey for Ciphertext
Available on crate feature
kem
only.Source§type EncappedKeySize = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>, B0>
type EncappedKeySize = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>, B0>
The size, in bytes, of an encapsulated key.
The size, in bytes, of the shared secret that this KEM produces.
Source§type SenderPublicKey = ()
type SenderPublicKey = ()
Represents the identity key of an encapsulator. This is used in authenticated
decapsulation.
Source§type RecipientPublicKey = PublicKey<'static>
type RecipientPublicKey = PublicKey<'static>
The public key of a decapsulator. This is used in encapsulation.
Source§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.
Source§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.
Source§impl Encapsulator<Ciphertext> for ClassicMcEliece
impl Encapsulator<Ciphertext> for ClassicMcEliece
Source§fn try_encap<R: CryptoRng + RngCore>(
&self,
csprng: &mut R,
recip_pubkey: &<Ciphertext as EncappedKey>::RecipientPublicKey,
) -> Result<(Ciphertext, SharedSecret<Ciphertext>), Error>
fn try_encap<R: CryptoRng + RngCore>( &self, csprng: &mut R, recip_pubkey: &<Ciphertext as EncappedKey>::RecipientPublicKey, ) -> Result<(Ciphertext, SharedSecret<Ciphertext>), Error>
Attempts to encapsulate a fresh shared secret with the given recipient. The resulting
shared secret is bound to the identity encoded in
Self
(i.e., authenticated wrt Self
).
If Self
is empty, then this is equivalent to unauthenticated encapsulation. Returns the
shared secret and encapsulated key on success, or an error if something went wrong.Auto Trait Implementations§
impl Freeze for Ciphertext
impl RefUnwindSafe for Ciphertext
impl Send for Ciphertext
impl Sync for Ciphertext
impl Unpin for Ciphertext
impl UnwindSafe for Ciphertext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more