pub struct Scrypt { /* private fields */ }Expand description
Main scrypt structure.
Usage:
extern crate dumb_crypto;
use::dumb_crypto::scrypt::Scrypt;
let scrypt = Scrypt::new(1, 128, 1);
let mut out: [u8; 8] = [0; 8];
scrypt.derive(b"passphrase", b"salt", &mut out).unwrap();
assert_eq!(out.to_vec(), vec![
79, 35, 225, 99, 145, 145, 172, 245,
]);Implementations§
Source§impl Scrypt
impl Scrypt
Sourcepub fn new(r: usize, n: usize, p: usize) -> Self
pub fn new(r: usize, n: usize, p: usize) -> Self
Create new instance of Scrypt.
Arguments:
rBlock size parameter, must be larger than 1nCPU/Memory cost parameter, must be larger than 1, a power of 2 and less than 2 ^ (16 * r)pParallelization parameter, a positive integer less than or equal to (2^32-1) / (4 * r) where hLen is 32 and MFlen is 128 * r.
Auto Trait Implementations§
impl Freeze for Scrypt
impl RefUnwindSafe for Scrypt
impl Send for Scrypt
impl Sync for Scrypt
impl Unpin for Scrypt
impl UnwindSafe for Scrypt
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