pub struct QuantumEncryptor { /* private fields */ }Expand description
Key encapsulation via ML-KEM-768 (FIPS 203). Used to establish a shared secret over an untrusted channel.
Implementations§
Source§impl QuantumEncryptor
impl QuantumEncryptor
pub fn new() -> Result<Self>
Sourcepub fn encapsulate(&self) -> Result<(Vec<u8>, Vec<u8>)>
pub fn encapsulate(&self) -> Result<(Vec<u8>, Vec<u8>)>
Returns (ciphertext, shared_secret). Send the ciphertext to the other party;
they call decapsulate to recover the same shared secret.
pub fn decapsulate(&self, ciphertext_bytes: &[u8]) -> Result<Zeroizing<Vec<u8>>>
pub fn public_key_bytes(&self) -> Vec<u8> ⓘ
Auto Trait Implementations§
impl Freeze for QuantumEncryptor
impl RefUnwindSafe for QuantumEncryptor
impl Send for QuantumEncryptor
impl Sync for QuantumEncryptor
impl Unpin for QuantumEncryptor
impl UnsafeUnpin for QuantumEncryptor
impl UnwindSafe for QuantumEncryptor
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