Struct noise::CipherState
source · pub struct CipherState { /* private fields */ }
Implementations§
source§impl CipherState
impl CipherState
pub fn new() -> Self
pub fn initialize_key(&mut self, key: [u8; 32])
pub fn has_key(&self) -> bool
pub fn nonce(&self) -> NoiseNonce
pub fn set_nonce(&mut self, nonce: NoiseNonce)
pub fn encrypt_with_ad( &mut self, ad: &[u8], plaintext: &[u8] ) -> Result<Vec<u8>, EncryptionError>
pub fn decrypt_with_ad( &mut self, ad: &[u8], ciphertext: &[u8] ) -> Result<Vec<u8>, EncryptionError>
pub fn rekey(&mut self)
Trait Implementations§
source§impl Clone for CipherState
impl Clone for CipherState
source§fn clone(&self) -> CipherState
fn clone(&self) -> CipherState
Returns a copy 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 Debug for CipherState
impl Debug for CipherState
source§impl Default for CipherState
impl Default for CipherState
source§fn default() -> CipherState
fn default() -> CipherState
Returns the “default value” for a type. Read more
source§impl PartialEq for CipherState
impl PartialEq for CipherState
source§fn eq(&self, other: &CipherState) -> bool
fn eq(&self, other: &CipherState) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for CipherState
impl StructuralPartialEq for CipherState
Auto Trait Implementations§
impl Freeze for CipherState
impl RefUnwindSafe for CipherState
impl Send for CipherState
impl Sync for CipherState
impl Unpin for CipherState
impl UnwindSafe for CipherState
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