pub struct StreamXChaCha20Poly1305 { /* private fields */ }
Expand description
Streaming XChaCha20Poly1305 state.
Implementations§
source§impl StreamXChaCha20Poly1305
impl StreamXChaCha20Poly1305
sourcepub fn new(secret_key: &SecretKey, nonce: &Nonce) -> Self
pub fn new(secret_key: &SecretKey, nonce: &Nonce) -> Self
Initialize a StreamXChaCha20Poly1305
struct with a given secret key and nonce.
sourcepub fn rekey(&mut self) -> Result<(), UnknownCryptoError>
pub fn rekey(&mut self) -> Result<(), UnknownCryptoError>
Derives a new secret key used for encryption and decryption.
sourcepub fn seal_chunk(
&mut self,
plaintext: &[u8],
ad: Option<&[u8]>,
dst_out: &mut [u8],
tag: &StreamTag
) -> Result<(), UnknownCryptoError>
pub fn seal_chunk( &mut self, plaintext: &[u8], ad: Option<&[u8]>, dst_out: &mut [u8], tag: &StreamTag ) -> Result<(), UnknownCryptoError>
Encrypt and authenticate a single message and tag.
sourcepub fn open_chunk(
&mut self,
ciphertext: &[u8],
ad: Option<&[u8]>,
dst_out: &mut [u8]
) -> Result<StreamTag, UnknownCryptoError>
pub fn open_chunk( &mut self, ciphertext: &[u8], ad: Option<&[u8]>, dst_out: &mut [u8] ) -> Result<StreamTag, UnknownCryptoError>
Authenticate and decrypt a single message and tag.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for StreamXChaCha20Poly1305
impl Send for StreamXChaCha20Poly1305
impl Sync for StreamXChaCha20Poly1305
impl Unpin for StreamXChaCha20Poly1305
impl UnwindSafe for StreamXChaCha20Poly1305
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