pub struct SecretBox { /* private fields */ }Available on crate features
crypto and native_crypto only.Trait Implementations§
Source§impl SimplexSecretBox for SecretBox
impl SimplexSecretBox for SecretBox
Source§fn init(key: &XSalsa20Key, nonce: &XSalsa20Nonce) -> Self
fn init(key: &XSalsa20Key, nonce: &XSalsa20Nonce) -> Self
Return a properly initialized SimpleX
secretbox. Read moreSource§fn encrypt_chunk(&mut self, chunk: impl AsRef<[u8]>, output: impl AsMut<[u8]>)
fn encrypt_chunk(&mut self, chunk: impl AsRef<[u8]>, output: impl AsMut<[u8]>)
Write a ciphertext into a
buf. Update poly1305 but do not authenticate the chunk, the
auth tag must be put only at the end of the whole message.Source§fn decrypt_chunk(&mut self, chunk: impl AsRef<[u8]>, output: impl AsMut<[u8]>)
fn decrypt_chunk(&mut self, chunk: impl AsRef<[u8]>, output: impl AsMut<[u8]>)
Write a plaintext into a
buf. chunk is always pure ciphertext, simploxide utilities
guarantee that auth_tag won’t appear in the input chunk.fn auth_tag(&mut self) -> Poly1305Tag
fn verify_tag(&mut self, in_tag: &Poly1305Tag) -> bool
Auto Trait Implementations§
impl Freeze for SecretBox
impl RefUnwindSafe for SecretBox
impl Send for SecretBox
impl Sync for SecretBox
impl Unpin for SecretBox
impl UnsafeUnpin for SecretBox
impl UnwindSafe for SecretBox
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more