mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
specify use of sw-only hasher in bip39
the hash is tiny, hw overhead not worth it
This commit is contained in:
parent
577646288a
commit
ee95bc1306
1 changed files with 2 additions and 2 deletions
|
|
@ -31,7 +31,7 @@ pub(crate) fn bytes_to_bip39(bytes: &Vec<u8>) -> Result<Vec<String>, Bip39Error>
|
|||
16 | 20 | 24 | 28 | 32 => (),
|
||||
_ => return Err(Bip39Error::InvalidLength),
|
||||
}
|
||||
let mut hasher = sha2::Sha256::new();
|
||||
let mut hasher = sha2::Sha256Sw::new();
|
||||
hasher.update(bytes);
|
||||
let digest = hasher.finalize();
|
||||
let checksum_bits = bytes.len() / 4;
|
||||
|
|
@ -112,7 +112,7 @@ pub(crate) fn bip39_to_bytes(bip39: &Vec<String>) -> Result<Vec<u8>, Bip39Error>
|
|||
bucket as u8
|
||||
};
|
||||
|
||||
let mut hasher = sha2::Sha256::new();
|
||||
let mut hasher = sha2::Sha256Sw::new();
|
||||
hasher.update(&data);
|
||||
let digest = hasher.finalize();
|
||||
let checksum_bits = data.len() / 4;
|
||||
|
|
|
|||
Loading…
Reference in a new issue