From f352b6d68b17fee886af58494b7e793cea3ea383 Mon Sep 17 00:00:00 2001 From: Caleb Garrett <47389035+caleb-garrett@users.noreply.github.com> Date: Sat, 24 Feb 2024 16:14:44 -0500 Subject: Address CI build issues. --- examples/stm32f7/src/bin/cryp.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/stm32f7/src/bin/cryp.rs b/examples/stm32f7/src/bin/cryp.rs index be41955c5..04927841a 100644 --- a/examples/stm32f7/src/bin/cryp.rs +++ b/examples/stm32f7/src/bin/cryp.rs @@ -1,10 +1,9 @@ #![no_std] #![no_main] -use aes_gcm::{ - aead::{heapless::Vec, AeadInPlace, KeyInit}, - Aes128Gcm, -}; +use aes_gcm::aead::heapless::Vec; +use aes_gcm::aead::{AeadInPlace, KeyInit}; +use aes_gcm::Aes128Gcm; use defmt::info; use embassy_executor::Spawner; use embassy_stm32::cryp::*; @@ -55,9 +54,12 @@ async fn main(_spawner: Spawner) -> ! { let mut payload_vec: Vec = Vec::from_slice(&payload).unwrap(); let cipher = Aes128Gcm::new(&key.into()); let _ = cipher.encrypt_in_place(&iv.into(), aad.into(), &mut payload_vec); - + assert_eq!(ciphertext, payload_vec[0..ciphertext.len()]); - assert_eq!(encrypt_tag, payload_vec[ciphertext.len()..ciphertext.len() + encrypt_tag.len()]); + assert_eq!( + encrypt_tag, + payload_vec[ciphertext.len()..ciphertext.len() + encrypt_tag.len()] + ); // Decrypt in software using AES-GCM 128-bit let _ = cipher.decrypt_in_place(&iv.into(), aad.into(), &mut payload_vec); -- cgit