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 | |
| 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')
| -rw-r--r-- | embassy-stm32/CHANGELOG.md | 1 | ||||
| -rw-r--r-- | embassy-stm32/src/hash/mod.rs | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/embassy-stm32/CHANGELOG.md b/embassy-stm32/CHANGELOG.md index 0c2d23246..9ad117312 100644 --- a/embassy-stm32/CHANGELOG.md +++ b/embassy-stm32/CHANGELOG.md | |||
| @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
| 9 | ## Unreleased - ReleaseDate | 9 | ## Unreleased - ReleaseDate |
| 10 | 10 | ||
| 11 | - fix: Fix vrefbuf building with log feature | 11 | - fix: Fix vrefbuf building with log feature |
| 12 | - fix: Fix performing a hash after performing a hmac | ||
| 12 | 13 | ||
| 13 | ## 0.3.0 - 2025-08-12 | 14 | ## 0.3.0 - 2025-08-12 |
| 14 | 15 | ||
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)); |
