pub struct Encryption { /* private fields */ }Implementations§
Source§impl Encryption
impl Encryption
pub fn new(master_key: &SecretVec<u8>) -> Encryption
pub fn encrypt( &mut self, plaintext: Vec<u8>, algorithm: u8, ) -> Result<EncryptionPayload, Box<dyn Error>>
pub fn decrypt( &mut self, nonce: [u8; 12], ciphertext: Vec<u8>, algorithm: u8, ) -> Result<EncryptionPayload, Box<dyn Error>>
Auto Trait Implementations§
impl Freeze for Encryption
impl RefUnwindSafe for Encryption
impl Send for Encryption
impl Sync for Encryption
impl Unpin for Encryption
impl UnwindSafe for Encryption
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