pub struct DecryptionKey { /* private fields */ }
Expand description
A FrodoKEM secret key
Implementations§
Source§impl DecryptionKey
impl DecryptionKey
Sourcepub fn from_bytes<B: AsRef<[u8]>>(
algorithm: Algorithm,
value: B,
) -> FrodoResult<Self>
pub fn from_bytes<B: AsRef<[u8]>>( algorithm: Algorithm, value: B, ) -> FrodoResult<Self>
Convert a slice of bytes into a DecryptionKey
according to the specified Algorithm
.
Sourcepub fn decapsulate<B: AsRef<[u8]>>(
&self,
ciphertext: &Ciphertext,
) -> FrodoResult<(SharedSecret, Vec<u8>)>
pub fn decapsulate<B: AsRef<[u8]>>( &self, ciphertext: &Ciphertext, ) -> FrodoResult<(SharedSecret, Vec<u8>)>
Decapsulate the Ciphertext
to return the SharedSecret
and
message generated during encapsulation.
Trait Implementations§
Source§impl AsRef<[u8]> for DecryptionKey
impl AsRef<[u8]> for DecryptionKey
Source§impl Clone for DecryptionKey
impl Clone for DecryptionKey
Source§fn clone(&self) -> DecryptionKey
fn clone(&self) -> DecryptionKey
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 ConstantTimeEq for DecryptionKey
impl ConstantTimeEq for DecryptionKey
Source§impl Debug for DecryptionKey
impl Debug for DecryptionKey
Source§impl Default for DecryptionKey
impl Default for DecryptionKey
Source§fn default() -> DecryptionKey
fn default() -> DecryptionKey
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DecryptionKey
Available on crate feature serde
only.
impl<'de> Deserialize<'de> for DecryptionKey
Available on crate feature
serde
only.Source§fn deserialize<D>(d: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&DecryptionKey> for EncryptionKey
impl From<&DecryptionKey> for EncryptionKey
Source§fn from(secret_key: &DecryptionKey) -> Self
fn from(secret_key: &DecryptionKey) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DecryptionKey
impl PartialEq for DecryptionKey
Source§impl Serialize for DecryptionKey
Available on crate feature serde
only.
impl Serialize for DecryptionKey
Available on crate feature
serde
only.Source§impl Zeroize for DecryptionKey
impl Zeroize for DecryptionKey
impl Eq for DecryptionKey
impl ZeroizeOnDrop for DecryptionKey
Auto Trait Implementations§
impl Freeze for DecryptionKey
impl RefUnwindSafe for DecryptionKey
impl Send for DecryptionKey
impl Sync for DecryptionKey
impl Unpin for DecryptionKey
impl UnwindSafe for DecryptionKey
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<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)