File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ byteorder = { version = "1", default-features = false }
1616
1717rayon = { version = " 1" , optional = true }
1818base64 = { version = " 0.9" , optional = true }
19- rand = { version = " 0.5 " , optional = true }
19+ rand = { version = " 0.7 " , optional = true }
2020hmac = { version = " 0.8" , optional = true }
2121sha2 = { version = " 0.9" , optional = true }
2222subtle = { version = " 2" , default-features = false , optional = true }
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ use std::string::ToString;
66use crate :: errors:: CheckError ;
77use base64;
88use hmac:: Hmac ;
9- use rand:: { OsRng , RngCore } ;
9+ use rand:: RngCore ;
10+ use rand:: rngs:: OsRng ;
1011use sha2:: Sha256 ;
1112use subtle:: ConstantTimeEq ;
1213
@@ -35,11 +36,9 @@ use byteorder::{BigEndian, ByteOrder};
3536/// * `password` - The password to process
3637/// * `c` - The iteration count
3738pub fn pbkdf2_simple ( password : & str , c : u32 ) -> io:: Result < String > {
38- let mut rng = OsRng :: new ( ) ?;
39-
4039 // 128-bit salt
4140 let mut salt = [ 0u8 ; 16 ] ;
42- rng . try_fill_bytes ( & mut salt) ?;
41+ OsRng . try_fill_bytes ( & mut salt) ?;
4342
4443 // 256-bit derived key
4544 let mut dk = [ 0u8 ; 32 ] ;
You can’t perform that action at this time.
0 commit comments