pub struct Crypto {
pub cipher: Cipher,
pub ciphertext: Vec<u8>,
pub kdf: Kdf,
pub mac: [u8; 32],
}
Expand description
Encrypted data
Fields§
§cipher: Cipher
Encryption parameters
ciphertext: Vec<u8>
Encrypted data buffer
kdf: Kdf
Key derivation function parameters
mac: [u8; 32]
Message authentication code
Implementations§
source§impl Crypto
impl Crypto
sourcepub fn with_secret(
secret: &Secret,
password: &Password,
iterations: u32
) -> Result<Self, Error>
pub fn with_secret( secret: &Secret, password: &Password, iterations: u32 ) -> Result<Self, Error>
Encrypt account secret
sourcepub fn with_plain(
plain: &[u8],
password: &Password,
iterations: u32
) -> Result<Self, Error>
pub fn with_plain( plain: &[u8], password: &Password, iterations: u32 ) -> Result<Self, Error>
Encrypt custom plain data
Trait Implementations§
source§impl PartialEq for Crypto
impl PartialEq for Crypto
impl StructuralPartialEq for Crypto
Auto Trait Implementations§
impl RefUnwindSafe for Crypto
impl Send for Crypto
impl Sync for Crypto
impl Unpin for Crypto
impl UnwindSafe for Crypto
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