pub struct DecapsulationKey { /* private fields */ }Expand description
X-Wing decapsulation key or private key.
Implementations§
Trait Implementations§
Source§impl Clone for DecapsulationKey
impl Clone for DecapsulationKey
Source§fn clone(&self) -> DecapsulationKey
fn clone(&self) -> DecapsulationKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Decapsulate for DecapsulationKey
impl Decapsulate for DecapsulationKey
Source§fn decapsulate(&self, ct: &Ciphertext) -> SharedSecret
fn decapsulate(&self, ct: &Ciphertext) -> SharedSecret
Decapsulates the given
Ciphertext a.k.a. “encapsulated key”.Source§fn decapsulate_slice(
&self,
ct: &[u8],
) -> Result<Array<u8, Self::SharedSecretSize>, TryFromSliceError>
fn decapsulate_slice( &self, ct: &[u8], ) -> Result<Array<u8, Self::SharedSecretSize>, TryFromSliceError>
Decapsulate the given byte slice containing a
Ciphertext a.k.a. “encapsulated key”. Read moreSource§impl Decapsulator for DecapsulationKey
impl Decapsulator for DecapsulationKey
Source§type Encapsulator = EncapsulationKey
type Encapsulator = EncapsulationKey
Encapsulator which corresponds to this decapsulator.
Source§fn encapsulator(&self) -> &EncapsulationKey
fn encapsulator(&self) -> &EncapsulationKey
Retrieve the encapsulator associated with this decapsulator.
Source§impl Drop for DecapsulationKey
impl Drop for DecapsulationKey
Source§impl Generate for DecapsulationKey
impl Generate for DecapsulationKey
Source§fn try_generate_from_rng<R>(
rng: &mut R,
) -> Result<Self, <R as TryRngCore>::Error>where
R: TryCryptoRng + ?Sized,
fn try_generate_from_rng<R>(
rng: &mut R,
) -> Result<Self, <R as TryRngCore>::Error>where
R: TryCryptoRng + ?Sized,
Generate random key using the provided
TryCryptoRng.Source§fn generate_from_rng<R>(rng: &mut R) -> Self
fn generate_from_rng<R>(rng: &mut R) -> Self
Generate random key using the provided
CryptoRng.Source§impl KeyInit for DecapsulationKey
impl KeyInit for DecapsulationKey
Source§fn weak_key_test(_key: &Array<u8, Self::KeySize>) -> Result<(), WeakKeyError>
fn weak_key_test(_key: &Array<u8, Self::KeySize>) -> Result<(), WeakKeyError>
Check if the key might be considered weak.
Source§fn new_checked(key: &Array<u8, Self::KeySize>) -> Result<Self, WeakKeyError>
fn new_checked(key: &Array<u8, Self::KeySize>) -> Result<Self, WeakKeyError>
Create new value from fixed size key after checking it for weakness.
Source§fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
Create new value from variable size key.
Source§impl KeySizeUser for DecapsulationKey
impl KeySizeUser for DecapsulationKey
impl ZeroizeOnDrop for DecapsulationKey
Available on crate feature
zeroize only.Auto Trait Implementations§
impl Freeze for DecapsulationKey
impl RefUnwindSafe for DecapsulationKey
impl Send for DecapsulationKey
impl Sync for DecapsulationKey
impl Unpin for DecapsulationKey
impl UnwindSafe for DecapsulationKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<K> KemParams for Kwhere
K: Decapsulator,
impl<K> KemParams for Kwhere
K: Decapsulator,
Source§type CiphertextSize = <<K as Decapsulator>::Encapsulator as KemParams>::CiphertextSize
type CiphertextSize = <<K as Decapsulator>::Encapsulator as KemParams>::CiphertextSize
Size of the ciphertext (a.k.a. “encapsulated key”) produced by
Encapsulate::encapsulate.Size of the shared secret after decapsulation by
Decapsulate::decapsulate.Source§impl<D> TryDecapsulate for Dwhere
D: Decapsulate,
impl<D> TryDecapsulate for Dwhere
D: Decapsulate,
Source§type Error = Infallible
type Error = Infallible
Decapsulation error
Source§fn try_decapsulate(
&self,
ct: &Array<u8, <D as KemParams>::CiphertextSize>,
) -> Result<Array<u8, <D as KemParams>::SharedSecretSize>, Infallible>
fn try_decapsulate( &self, ct: &Array<u8, <D as KemParams>::CiphertextSize>, ) -> Result<Array<u8, <D as KemParams>::SharedSecretSize>, Infallible>
Decapsulates the given
Ciphertext a.k.a. “encapsulated key”.Source§fn try_decapsulate_slice(
&self,
ct: &[u8],
) -> Result<Array<u8, Self::SharedSecretSize>, Self::Error>
fn try_decapsulate_slice( &self, ct: &[u8], ) -> Result<Array<u8, Self::SharedSecretSize>, Self::Error>
Decapsulate the given byte slice containing a
Ciphertext a.k.a. “encapsulated key”. Read more