diff --git a/services/pddb/src/backend/hw.rs b/services/pddb/src/backend/hw.rs index fef866747..8f8954d34 100644 --- a/services/pddb/src/backend/hw.rs +++ b/services/pddb/src/backend/hw.rs @@ -18,7 +18,7 @@ use backend::bcrypt::*; use modals::Modals; use root_keys::api::AesRootkeyType; use root_keys::api::KeywrapError; -use sha2::{Digest, Sha512_256, Sha512_256Sw}; +use sha2::{Digest, Sha512_256Hw, Sha512_256Sw}; use spinor::SPINOR_BULK_ERASE_SIZE; use subtle::ConstantTimeEq; @@ -2956,8 +2956,7 @@ impl PddbOs { region.len() == root_keys::api::CHECKSUM_BLOCKLEN_PAGE as usize * PAGE_SIZE, "CHECKSUM_BLOCKLEN_PAGE is not an even divisor of the PDDB size" ); - // FIXME: should be "wait for hardware" strategy but this does not exist in 0.10 API - let mut hasher = Sha512_256::new(); + let mut hasher = Sha512_256Hw::new(); hasher.update(region); // reserve the first 32 bytes of salt for the HKDF let digest = hasher.finalize(); // copy only the first 128 bits of the hash into the checksum array diff --git a/services/root-keys/src/implementation.rs b/services/root-keys/src/implementation.rs index 8f0c933c6..01938db37 100644 --- a/services/root-keys/src/implementation.rs +++ b/services/root-keys/src/implementation.rs @@ -21,7 +21,7 @@ pub use oracle::FpgaKeySource; use rand_core::RngCore; use root_keys::key2bits::*; use sha2::Digest; -use sha2::{Sha256, Sha512, Sha512_256Sw}; +use sha2::{Sha256, Sha512Hw, Sha512_256Sw}; use utralib::generated::*; use xous::KERNEL_BACKUP_OFFSET; use xous_semver::SemVer; @@ -2681,8 +2681,7 @@ impl<'a> RootKeys { + 8; // two u32 words are appended to the end, which repeat the "version" and "length" fields encoded in the signature block // this is a huge hash, so, get a hardware hasher, even if it means waiting for it - // FIXME: should be "wait for hardware" strategy but this does not exist in 0.10 API - let mut hasher = Sha512::new(); + let mut hasher = Sha512Hw::new(); // extract the secret key so we can prime the hash let expanded_key = ExpandedSecretKey::from(&signing_key.secret); @@ -2732,8 +2731,7 @@ impl<'a> RootKeys { let r = Scalar::from_bytes_mod_order_wide(&output); let R = (&r * &constants::ED25519_BASEPOINT_TABLE).compress(); - // FIXME: should be "wait for hardware" strategy but this does not exist in 0.10 API - let mut hasher = Sha512::new(); + let mut hasher = Sha512Hw::new(); hasher.update(R.as_bytes()); hasher.update(signing_key.public.as_bytes()); diff --git a/services/status/src/ecup.rs b/services/status/src/ecup.rs index 750ec880b..f32a7d39b 100644 --- a/services/status/src/ecup.rs +++ b/services/status/src/ecup.rs @@ -650,8 +650,7 @@ fn do_update( } fn validate_package(pkg: &[u8], pkg_type: PackageType) -> bool { - // FIXME: should be "wait for hardware" strategy but this does not exist in 0.10 API - let mut hasher = sha2::Sha512_256::new(); + let mut hasher = sha2::Sha512_256Hw::new(); let mut temp: [u8; 4] = Default::default(); temp.copy_from_slice(&pkg[0x20..0x24]); if pkg_type == PackageType::Ec {