Closed as not planned
Description
the source code:
line 143~156
let mut sha = sha2::Sha256::default();
let mut extra = [0u8; 8];
for _ in 0..(1u32 << num_cycles_power) {
sha.update(&salt);
sha.update(password);
sha.update(extra);
for item in &mut extra {
*item = item.wrapping_add(1);
if *item != 0 {
break;
}
}
}
sha.finalize().into()
slow than use crate ring
let mut sha = Context::new(&SHA256);
let mut extra = [0u8; 8];
for _ in 0..(1u32 << num_cycles_power) {
sha.update(&salt);
sha.update(password);
sha.update(&extra);
for item in &mut extra {
*item = item.wrapping_add(1);
if *item != 0 {
break;
}
}
}
sha.finish().as_ref().try_into()
.map_err(|_| crate::Error::other("AES256 sha256 hashing failed"))?
Metadata
Metadata
Assignees
Labels
No labels