Address CI build issues.
This commit is contained in:
parent
25ec838af5
commit
f352b6d68b
3 changed files with 13 additions and 12 deletions
|
@ -70,7 +70,7 @@ rand_core = "0.6.3"
|
||||||
sdio-host = "0.5.0"
|
sdio-host = "0.5.0"
|
||||||
critical-section = "1.1"
|
critical-section = "1.1"
|
||||||
#stm32-metapac = { version = "15" }
|
#stm32-metapac = { version = "15" }
|
||||||
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-6097928f720646c73d6483a3245f922bd5faee2f" }
|
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ca48d946840840c5b311c96ff17cf4f8a865f9fb" }
|
||||||
vcell = "0.1.3"
|
vcell = "0.1.3"
|
||||||
bxcan = "0.7.0"
|
bxcan = "0.7.0"
|
||||||
nb = "1.0.0"
|
nb = "1.0.0"
|
||||||
|
@ -94,7 +94,7 @@ critical-section = { version = "1.1", features = ["std"] }
|
||||||
proc-macro2 = "1.0.36"
|
proc-macro2 = "1.0.36"
|
||||||
quote = "1.0.15"
|
quote = "1.0.15"
|
||||||
#stm32-metapac = { version = "15", default-features = false, features = ["metadata"]}
|
#stm32-metapac = { version = "15", default-features = false, features = ["metadata"]}
|
||||||
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-6097928f720646c73d6483a3245f922bd5faee2f", default-features = false, features = ["metadata"]}
|
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ca48d946840840c5b311c96ff17cf4f8a865f9fb", default-features = false, features = ["metadata"]}
|
||||||
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|
|
@ -2,12 +2,11 @@
|
||||||
#[cfg(cryp_v2)]
|
#[cfg(cryp_v2)]
|
||||||
use core::cmp::min;
|
use core::cmp::min;
|
||||||
use core::marker::PhantomData;
|
use core::marker::PhantomData;
|
||||||
|
|
||||||
use embassy_hal_internal::{into_ref, PeripheralRef};
|
use embassy_hal_internal::{into_ref, PeripheralRef};
|
||||||
|
|
||||||
use crate::pac;
|
|
||||||
use crate::peripherals::CRYP;
|
|
||||||
use crate::rcc::sealed::RccPeripheral;
|
use crate::rcc::sealed::RccPeripheral;
|
||||||
use crate::{interrupt, peripherals, Peripheral};
|
use crate::{interrupt, pac, peripherals, Peripheral};
|
||||||
|
|
||||||
const DES_BLOCK_SIZE: usize = 8; // 64 bits
|
const DES_BLOCK_SIZE: usize = 8; // 64 bits
|
||||||
const AES_BLOCK_SIZE: usize = 16; // 128 bits
|
const AES_BLOCK_SIZE: usize = 16; // 128 bits
|
||||||
|
@ -827,7 +826,7 @@ pub struct Cryp<'d, T: Instance> {
|
||||||
impl<'d, T: Instance> Cryp<'d, T> {
|
impl<'d, T: Instance> Cryp<'d, T> {
|
||||||
/// Create a new CRYP driver.
|
/// Create a new CRYP driver.
|
||||||
pub fn new(peri: impl Peripheral<P = T> + 'd) -> Self {
|
pub fn new(peri: impl Peripheral<P = T> + 'd) -> Self {
|
||||||
CRYP::enable_and_reset();
|
T::enable_and_reset();
|
||||||
into_ref!(peri);
|
into_ref!(peri);
|
||||||
let instance = Self { _peripheral: peri };
|
let instance = Self { _peripheral: peri };
|
||||||
instance
|
instance
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
use aes_gcm::{
|
use aes_gcm::aead::heapless::Vec;
|
||||||
aead::{heapless::Vec, AeadInPlace, KeyInit},
|
use aes_gcm::aead::{AeadInPlace, KeyInit};
|
||||||
Aes128Gcm,
|
use aes_gcm::Aes128Gcm;
|
||||||
};
|
|
||||||
use defmt::info;
|
use defmt::info;
|
||||||
use embassy_executor::Spawner;
|
use embassy_executor::Spawner;
|
||||||
use embassy_stm32::cryp::*;
|
use embassy_stm32::cryp::*;
|
||||||
|
@ -57,7 +56,10 @@ async fn main(_spawner: Spawner) -> ! {
|
||||||
let _ = cipher.encrypt_in_place(&iv.into(), aad.into(), &mut payload_vec);
|
let _ = cipher.encrypt_in_place(&iv.into(), aad.into(), &mut payload_vec);
|
||||||
|
|
||||||
assert_eq!(ciphertext, payload_vec[0..ciphertext.len()]);
|
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
|
// Decrypt in software using AES-GCM 128-bit
|
||||||
let _ = cipher.decrypt_in_place(&iv.into(), aad.into(), &mut payload_vec);
|
let _ = cipher.decrypt_in_place(&iv.into(), aad.into(), &mut payload_vec);
|
||||||
|
|
Loading…
Reference in a new issue