From 14c2c28e068d6e506c372611800e6dded8d8f440 Mon Sep 17 00:00:00 2001
From: Caleb Garrett <47389035+caleb-garrett@users.noreply.github.com>
Date: Tue, 20 Feb 2024 18:05:35 -0500
Subject: [PATCH] Corrected additional associated data operation.

---
 embassy-stm32/src/cryp/mod.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/embassy-stm32/src/cryp/mod.rs b/embassy-stm32/src/cryp/mod.rs
index 634c85883..d53252a6a 100644
--- a/embassy-stm32/src/cryp/mod.rs
+++ b/embassy-stm32/src/cryp/mod.rs
@@ -703,7 +703,7 @@ impl<'d, T: Instance> Cryp<'d, T> {
                 // Write block in
                 while index < end_index {
                     let mut in_word: [u8; 4] = [0; 4];
-                    in_word.copy_from_slice(&aad[index..index + 4]);
+                    in_word.copy_from_slice(&ctx.aad_buffer[index..index + 4]);
                     T::regs().din().write_value(u32::from_ne_bytes(in_word));
                     index += 4;
                 }