From 11241c579aeda5051c2cbfcc7d3264437decb230 Mon Sep 17 00:00:00 2001 From: Anton Lazarev Date: Wed, 2 Apr 2025 22:40:32 -0700 Subject: [PATCH] derive `Clone` for `hash::Context` The HASH accelerator can be used for HMAC if a key is provided. One significant use case of HMAC is as a PRF for the PBKDF2 algorithm, but this requires that the hashing state can be recursively "branched" multiple times. --- embassy-stm32/src/hash/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/embassy-stm32/src/hash/mod.rs b/embassy-stm32/src/hash/mod.rs index 1258e8923..e62151bb5 100644 --- a/embassy-stm32/src/hash/mod.rs +++ b/embassy-stm32/src/hash/mod.rs @@ -101,6 +101,7 @@ pub enum DataType { /// Stores the state of the HASH peripheral for suspending/resuming /// digest calculation. +#[derive(Clone)] pub struct Context<'c> { first_word_sent: bool, key_sent: bool,