Struct melodies::CipherState
source · [−]pub struct CipherState<Nonce = u64> {
pub nonce: Nonce,
/* private fields */
}Fields
nonce: NonceNote that a nonce of u64::MAX will cause an error on every call to encrypt
Implementations
sourceimpl<T> CipherState<T>
impl<T> CipherState<T>
sourcepub fn encrypt_with_nonce(&self, n: u64, ad: &[u8], buf: &mut [u8])
pub fn encrypt_with_nonce(&self, n: u64, ad: &[u8], buf: &mut [u8])
Encrypt, with a provided nonce (must prevent reuse). This occurs in place. The last TAG_SIZE bytes of buf will be replaced with the AEAD tag.
pub fn decrypt_with_nonce(
&self,
n: u64,
ad: &[u8],
buf: &'a mut [u8]
) -> Option<&'a [u8]>
pub fn rekey(&mut self)
sourceimpl CipherState<u64>
impl CipherState<u64>
pub fn into_stateless(self) -> CipherState<()>
Trait Implementations
sourceimpl<Nonce> Drop for CipherState<Nonce>
impl<Nonce> Drop for CipherState<Nonce>
sourceimpl<Nonce> Zeroize for CipherState<Nonce>
impl<Nonce> Zeroize for CipherState<Nonce>
impl<Nonce> ZeroizeOnDrop for CipherState<Nonce>
Auto Trait Implementations
impl<Nonce = u64> !RefUnwindSafe for CipherState<Nonce>
impl<Nonce = u64> !Send for CipherState<Nonce>
impl<Nonce = u64> !Sync for CipherState<Nonce>
impl<Nonce> Unpin for CipherState<Nonce>where
Nonce: Unpin,
impl<Nonce = u64> !UnwindSafe for CipherState<Nonce>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more