pub struct SecretKey { /* private fields */ }Expand description
X-Wing hybrid KEM decapsulation (secret) key.
Combines an ML-KEM-768 and an X25519 secret key as specified in the X-Wing draft. The shared secret is derived via a combiner that hashes both component secrets together.
§Example
ⓘ
use crypto::xwing::{generate_keypair, SecretKey, PublicKey};
let (secret_key, public_key) = generate_keypair();
let (shared_secret, ciphertext) = public_key.encapsulate();
let decapsulated = secret_key.decapsulate(&ciphertext).unwrap();
assert_eq!(shared_secret, decapsulated);Implementations§
Trait Implementations§
impl Eq for SecretKey
impl StructuralPartialEq for SecretKey
Auto Trait Implementations§
impl Freeze for SecretKey
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnsafeUnpin for SecretKey
impl UnwindSafe for SecretKey
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