pub struct DecapsulationKey { /* private fields */ }Expand description
X-Wing decapsulation key or private key.
Implementations§
Source§impl DecapsulationKey
impl DecapsulationKey
Sourcepub fn generate_from_os_rng() -> DecapsulationKey
Available on crate feature os_rng only.
pub fn generate_from_os_rng() -> DecapsulationKey
os_rng only.Generate a new DecapsulationKey using OsRng.
Sourcepub fn generate<R: CryptoRng + ?Sized>(rng: &mut R) -> DecapsulationKey
pub fn generate<R: CryptoRng + ?Sized>(rng: &mut R) -> DecapsulationKey
Generate a new DecapsulationKey using the provided RNG.
Sourcepub fn encapsulation_key(&self) -> EncapsulationKey
pub fn encapsulation_key(&self) -> EncapsulationKey
Provide the matching EncapsulationKey.
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<Ciphertext, [u8; 32]> for DecapsulationKey
impl Decapsulate<Ciphertext, [u8; 32]> for DecapsulationKey
Source§type Encapsulator = EncapsulationKey
type Encapsulator = EncapsulationKey
Encapsulator which corresponds to this decapsulator.
Source§type Error = Infallible
type Error = Infallible
Decapsulation error
Source§fn decapsulate(&self, ct: &Ciphertext) -> Result<SharedSecret, Self::Error>
fn decapsulate(&self, ct: &Ciphertext) -> Result<SharedSecret, Self::Error>
Decapsulates the given encapsulated key
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 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§fn generate_key_with_rng<R>(rng: &mut R) -> Array<u8, Self::KeySize>
fn generate_key_with_rng<R>(rng: &mut R) -> Array<u8, Self::KeySize>
Generate random key using the provided
CryptoRng.Source§fn try_generate_key_with_rng<R>(
rng: &mut R,
) -> Result<Array<u8, Self::KeySize>, <R as TryRngCore>::Error>where
R: TryCryptoRng + ?Sized,
fn try_generate_key_with_rng<R>(
rng: &mut R,
) -> Result<Array<u8, Self::KeySize>, <R as TryRngCore>::Error>where
R: TryCryptoRng + ?Sized,
Generate random key using the provided
TryCryptoRng.Source§impl KeySizeUser for DecapsulationKey
impl KeySizeUser for DecapsulationKey
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