File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ repository = "https://github.com/Techie-Pi/firebase-scrypt-rust"
55homepage = " https://github.com/Techie-Pi/firebase-scrypt-rust"
66documentation = " https://github.com/Techie-Pi/firebase-scrypt-rust"
77readme = " README.md"
8- version = " 0.1.0 "
8+ version = " 0.1.1 "
99edition = " 2021"
1010license = " MIT"
1111
Original file line number Diff line number Diff line change 2626//! assert!(firebase_scrypt.verify_password(password, salt, password_hash).unwrap())
2727//! ```
2828
29- #![ feature( int_log) ]
30-
3129use aes:: { Aes256 } ;
3230use aes:: cipher:: { KeyIvInit , StreamCipher } ;
3331use constant_time_eq:: constant_time_eq;
@@ -51,7 +49,7 @@ fn generate_derived_key<'a>(
5149 rounds : u32 ,
5250 mem_cost : u32 ,
5351) -> Result < [ u8 ; 64 ] , DerivedKeyError > {
54- let log2_n = 2_u32 . pow ( mem_cost) . log ( 2 ) ;
52+ let log2_n = 2_f32 . powf ( mem_cost as f32 ) . log2 ( ) . floor ( ) as u32 ;
5553 let p: u32 = 1 ;
5654
5755 debug_assert ! ( log2_n < 64 , "log2 of n must not be larger than 64" ) ;
You can’t perform that action at this time.
0 commit comments