diff options
| author | Matt Johnston <[email protected]> | 2025-08-12 17:09:52 +0800 |
|---|---|---|
| committer | Matt Johnston <[email protected]> | 2025-08-15 17:16:52 +0800 |
| commit | 410a18b536e73c005285b458eaeb8b6c3a71c1af (patch) | |
| tree | 02fa2c644c75513160bc34eef696c335bfd3a370 /embassy-stm32/src/hash | |
| parent | bfe4395b3b9792bb79363e2f32a9ab7bf69bb78d (diff) | |
stm32/hash: Clear HMAC mode bit when hashing
Running a hash after a hmac would hang, the CR.MODE bit isn't cleared by
INIT.
Test it by running the test twice.
Diffstat (limited to 'embassy-stm32/src/hash')
| -rw-r--r-- | embassy-stm32/src/hash/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/embassy-stm32/src/hash/mod.rs b/embassy-stm32/src/hash/mod.rs index e62151bb5..a4c275242 100644 --- a/embassy-stm32/src/hash/mod.rs +++ b/embassy-stm32/src/hash/mod.rs | |||
| @@ -198,6 +198,8 @@ impl<'d, T: Instance, M: Mode> Hash<'d, T, M> { | |||
| 198 | if key.len() > 64 { | 198 | if key.len() > 64 { |
| 199 | T::regs().cr().modify(|w| w.set_lkey(true)); | 199 | T::regs().cr().modify(|w| w.set_lkey(true)); |
| 200 | } | 200 | } |
| 201 | } else { | ||
| 202 | T::regs().cr().modify(|w| w.set_mode(false)); | ||
| 201 | } | 203 | } |
| 202 | 204 | ||
| 203 | T::regs().cr().modify(|w| w.set_init(true)); | 205 | T::regs().cr().modify(|w| w.set_init(true)); |
