keyfork-mnemonic-generate: clean up

This commit is contained in:
Ryan Heywood 2023-08-16 05:47:46 -05:00
parent 754fdc10e5
commit 067a373993
Signed by: ryan
GPG Key ID: 8E401478A3FBEF72
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ use std::{
use sha2::{Digest, Sha256}; use sha2::{Digest, Sha256};
/// Usage: keyfork-mnemonic-generate /// Usage: keyfork-mnemonic-generate [bitsize: 128 or 256]
/// CHECKS: /// CHECKS:
/// * If the system is online /// * If the system is online
/// * If a kernel is running post-BLAKE2 /// * If a kernel is running post-BLAKE2
@ -99,7 +99,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let entropy = &mut [0u8; 256 / 8]; let entropy = &mut [0u8; 256 / 8];
random_handle.read_exact(&mut entropy[..])?; random_handle.read_exact(&mut entropy[..])?;
let mut hasher = sha2::Sha256::new(); let mut hasher = Sha256::new();
hasher.update(&entropy); hasher.update(&entropy);
let hash = hasher.finalize(); let hash = hasher.finalize();
let checksum = &hash[..bit_size / 32 / 8]; let checksum = &hash[..bit_size / 32 / 8];