pub struct Decryptor { /* private fields */ }
Expand description
Decryptor for the scrypt encrypted data format.
Implementations
sourceimpl Decryptor
impl Decryptor
sourcepub fn new(
data: impl AsRef<[u8]>,
password: impl AsRef<[u8]>
) -> Result<Self, Error>
pub fn new(
data: impl AsRef<[u8]>,
password: impl AsRef<[u8]>
) -> Result<Self, Error>
Creates a new Decryptor
.
Errors
This function will return an error in the following situations:
data
is less than 128 bytes.- The magic number is not “scrypt”.
- The version number other than
0
. - The scrypt parameters are invalid.
- SHA-256 checksum of the header mismatch.
- HMAC-SHA-256 signature of the header mismatch.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Decryptor
impl Send for Decryptor
impl Sync for Decryptor
impl Unpin for Decryptor
impl UnwindSafe for Decryptor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more