Struct classic_mceliece_rust::Ciphertext
source · [−]pub struct Ciphertext(_);
Expand description
The ciphertext computed by the encapsulator.
Implementations
Trait Implementations
sourceimpl AsRef<[u8]> for Ciphertext
impl AsRef<[u8]> for Ciphertext
sourceimpl Debug for Ciphertext
impl Debug for Ciphertext
sourceimpl<'sk> Decapsulator<Ciphertext> for SecretKey<'sk>
Available on crate feature kem
only.
impl<'sk> Decapsulator<Ciphertext> for SecretKey<'sk>
kem
only.sourcefn 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. Read more
sourceimpl EncappedKey for Ciphertext
Available on crate feature kem
only.
impl EncappedKey for Ciphertext
kem
only.type EncappedKeySize = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>
type EncappedKeySize = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, 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.
type SenderPublicKey = ()
type SenderPublicKey = ()
Represents the identity key of an encapsulator. This is used in authenticated decapsulation. Read more
type RecipientPublicKey = PublicKey<'static>
type RecipientPublicKey = PublicKey<'static>
The public key of a decapsulator. This is used in encapsulation.
sourcefn 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.
sourcefn 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.
sourceimpl Encapsulator<Ciphertext> for ClassicMcEliece
impl Encapsulator<Ciphertext> for ClassicMcEliece
sourcefn 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. Read more
Auto Trait Implementations
impl RefUnwindSafe for Ciphertext
impl Send for Ciphertext
impl Sync for Ciphertext
impl Unpin for Ciphertext
impl UnwindSafe for Ciphertext
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more