From 1dbfa5ab72e3596932ccb6bd258fac70d2efa563 Mon Sep 17 00:00:00 2001 From: Caleb Garrett <47389035+caleb-garrett@users.noreply.github.com> Date: Thu, 1 Feb 2024 10:28:12 -0500 Subject: [PATCH] Added hash v1/v2 configs. --- embassy-stm32/src/hash/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/embassy-stm32/src/hash/mod.rs b/embassy-stm32/src/hash/mod.rs index e3d2d7b16..622777b02 100644 --- a/embassy-stm32/src/hash/mod.rs +++ b/embassy-stm32/src/hash/mod.rs @@ -9,7 +9,11 @@ use crate::peripherals::HASH; use crate::rcc::sealed::RccPeripheral; use crate::Peripheral; +#[cfg(hash_v1)] +const NUM_CONTEXT_REGS: usize = 51; +#[cfg(hash_v2)] const NUM_CONTEXT_REGS: usize = 54; + const HASH_BUFFER_LEN: usize = 68; const DIGEST_BLOCK_SIZE: usize = 64; @@ -20,8 +24,10 @@ pub enum Algorithm { SHA1 = 0, /// MD5 Algorithm MD5 = 1, + #[cfg(hash_v2)] /// SHA-224 Algorithm SHA224 = 2, + #[cfg(hash_v2)] /// SHA-256 Algorithm SHA256 = 3, }