pub struct KeySchedule { /* private fields */ }
Implementations§
Source§impl KeySchedule
impl KeySchedule
pub fn derive(ikm: &[u8], salt: &[u8]) -> Result<Self>
Sourcepub fn seal(&self, aad: &[u8], plaintext: &[u8]) -> Result<(Vec<u8>, [u8; 24])>
pub fn seal(&self, aad: &[u8], plaintext: &[u8]) -> Result<(Vec<u8>, [u8; 24])>
Случайный nonce (24B) + шифрование всего буфера.
Sourcepub fn seal_with_nonce(
&self,
aad: &[u8],
nonce: &[u8; 24],
plaintext: &[u8],
) -> Result<Vec<u8>>
pub fn seal_with_nonce( &self, aad: &[u8], nonce: &[u8; 24], plaintext: &[u8], ) -> Result<Vec<u8>>
Шифрование с переданным nonce (для стриминга/счётчика).
pub fn open( &self, aad: &[u8], nonce: &[u8; 24], ciphertext: &[u8], ) -> Result<Vec<u8>>
Auto Trait Implementations§
impl Freeze for KeySchedule
impl RefUnwindSafe for KeySchedule
impl Send for KeySchedule
impl Sync for KeySchedule
impl Unpin for KeySchedule
impl UnwindSafe for KeySchedule
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