pub struct MockCryptoBackend { /* private fields */ }Expand description
XOR-based mock crypto backend for testing.
NOT SECURE. This backend XORs plaintext with the key (cycling the key bytes). It exists solely for unit tests where real crypto is unnecessary.
Implementations§
Trait Implementations§
Source§impl CryptoBackend for MockCryptoBackend
impl CryptoBackend for MockCryptoBackend
Source§fn encrypt(
&self,
key: &[u8],
_nonce: &[u8],
_aad: &[u8],
plaintext: &[u8],
) -> Result<Vec<u8>, CryptoError>
fn encrypt( &self, key: &[u8], _nonce: &[u8], _aad: &[u8], plaintext: &[u8], ) -> Result<Vec<u8>, CryptoError>
Encrypt
plaintext using key, nonce, and aad.Auto Trait Implementations§
impl !Freeze for MockCryptoBackend
impl !RefUnwindSafe for MockCryptoBackend
impl Send for MockCryptoBackend
impl !Sync for MockCryptoBackend
impl Unpin for MockCryptoBackend
impl UnwindSafe for MockCryptoBackend
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