embassy-stm32

Crates

git

Versions

stm32h757xi-cm4

Flavors

embassy_stm32::cryp

Struct AesCcm

Source
pub struct AesCcm<'c, const KEY_SIZE: usize, const TAG_SIZE: usize, const IV_SIZE: usize> { /* private fields */ }
Expand description

AES-CCM Cipher Mode

Implementations§

Source§

impl<'c, const KEY_SIZE: usize, const TAG_SIZE: usize, const IV_SIZE: usize> AesCcm<'c, KEY_SIZE, TAG_SIZE, IV_SIZE>

Source

pub fn new( key: &'c [u8; KEY_SIZE], iv: &'c [u8; IV_SIZE], aad_len: usize, payload_len: usize, ) -> Self

Constructs a new AES-CCM cipher for a cryptographic operation.

Trait Implementations§

Source§

impl<'c, const KEY_SIZE: usize, const TAG_SIZE: usize, const IV_SIZE: usize> Cipher<'c> for AesCcm<'c, KEY_SIZE, TAG_SIZE, IV_SIZE>

Source§

const BLOCK_SIZE: usize = 16usize

Processing block size. Determined by the processor and the algorithm.
Source§

fn key(&self) -> &'c [u8]

Returns the symmetric key.
Source§

fn iv(&self) -> &[u8]

Returns the initialization vector.
Source§

fn set_algomode(&self, p: Cryp)

Sets the processor algorithm mode according to the associated cipher.
Source§

fn init_phase_blocking<T: Instance, DmaIn, DmaOut>( &self, p: Cryp, cryp: &Cryp<'_, T, DmaIn, DmaOut>, )

Performs any cipher-specific initialization.
Source§

async fn init_phase<T: Instance, DmaIn, DmaOut>( &self, p: Cryp, cryp: &mut Cryp<'_, T, DmaIn, DmaOut>, )
where DmaIn: DmaIn<T>, DmaOut: DmaOut<T>,

Performs any cipher-specific initialization.
Source§

fn get_header_block(&self) -> &[u8]

Returns the AAD header block as required by the cipher.
Source§

fn pre_final(&self, p: Cryp, _dir: Direction, padding_len: usize) -> [u32; 4]

Called prior to processing the last data block for cipher-specific operations.
Source§

const REQUIRES_PADDING: bool = false

Indicates whether the cipher requires the application to provide padding. If true, no partial blocks will be accepted (a panic will occur).
Source§

fn prepare_key(&self, _p: Cryp)

Performs any key preparation within the processor, if necessary.
Source§

fn post_final_blocking<T: Instance, DmaIn, DmaOut>( &self, _p: Cryp, _cryp: &Cryp<'_, T, DmaIn, DmaOut>, _dir: Direction, _int_data: &mut [u8; 16], _temp1: [u32; 4], _padding_mask: [u8; 16], )

Called after processing the last data block for cipher-specific operations.
Source§

async fn post_final<T: Instance, DmaIn, DmaOut>( &self, _p: Cryp, _cryp: &mut Cryp<'_, T, DmaIn, DmaOut>, _dir: Direction, _int_data: &mut [u8; 16], _temp1: [u32; 4], _padding_mask: [u8; 16], )
where DmaIn: DmaIn<T>, DmaOut: DmaOut<T>,

Called after processing the last data block for cipher-specific operations.
Source§

impl<'c, const KEY_SIZE: usize, const IV_SIZE: usize> CipherAuthenticated<10> for AesCcm<'c, KEY_SIZE, 10, IV_SIZE>

Source§

const TAG_SIZE: usize = TAG_SIZE

Defines the authentication tag size.
Source§

impl<'c, const KEY_SIZE: usize, const IV_SIZE: usize> CipherAuthenticated<12> for AesCcm<'c, KEY_SIZE, 12, IV_SIZE>

Source§

const TAG_SIZE: usize = TAG_SIZE

Defines the authentication tag size.
Source§

impl<'c, const KEY_SIZE: usize, const IV_SIZE: usize> CipherAuthenticated<14> for AesCcm<'c, KEY_SIZE, 14, IV_SIZE>

Source§

const TAG_SIZE: usize = TAG_SIZE

Defines the authentication tag size.
Source§

impl<'c, const KEY_SIZE: usize, const IV_SIZE: usize> CipherAuthenticated<16> for AesCcm<'c, KEY_SIZE, 16, IV_SIZE>

Source§

const TAG_SIZE: usize = TAG_SIZE

Defines the authentication tag size.
Source§

impl<'c, const KEY_SIZE: usize, const IV_SIZE: usize> CipherAuthenticated<4> for AesCcm<'c, KEY_SIZE, 4, IV_SIZE>

Source§

const TAG_SIZE: usize = TAG_SIZE

Defines the authentication tag size.
Source§

impl<'c, const KEY_SIZE: usize, const IV_SIZE: usize> CipherAuthenticated<6> for AesCcm<'c, KEY_SIZE, 6, IV_SIZE>

Source§

const TAG_SIZE: usize = TAG_SIZE

Defines the authentication tag size.
Source§

impl<'c, const KEY_SIZE: usize, const IV_SIZE: usize> CipherAuthenticated<8> for AesCcm<'c, KEY_SIZE, 8, IV_SIZE>

Source§

const TAG_SIZE: usize = TAG_SIZE

Defines the authentication tag size.
Source§

impl<'c, const TAG_SIZE: usize, const IV_SIZE: usize> CipherSized for AesCcm<'c, { _ }, TAG_SIZE, IV_SIZE>

Source§

impl<'c, const TAG_SIZE: usize, const IV_SIZE: usize> CipherSized for AesCcm<'c, { _ }, TAG_SIZE, IV_SIZE>

Source§

impl<'c, const TAG_SIZE: usize, const IV_SIZE: usize> CipherSized for AesCcm<'c, { _ }, TAG_SIZE, IV_SIZE>

Source§

impl<'c, const KEY_SIZE: usize, const TAG_SIZE: usize> IVSized for AesCcm<'c, KEY_SIZE, TAG_SIZE, 10>

Source§

impl<'c, const KEY_SIZE: usize, const TAG_SIZE: usize> IVSized for AesCcm<'c, KEY_SIZE, TAG_SIZE, 11>

Source§

impl<'c, const KEY_SIZE: usize, const TAG_SIZE: usize> IVSized for AesCcm<'c, KEY_SIZE, TAG_SIZE, 12>

Source§

impl<'c, const KEY_SIZE: usize, const TAG_SIZE: usize> IVSized for AesCcm<'c, KEY_SIZE, TAG_SIZE, 13>

Source§

impl<'c, const KEY_SIZE: usize, const TAG_SIZE: usize> IVSized for AesCcm<'c, KEY_SIZE, TAG_SIZE, 7>

Source§

impl<'c, const KEY_SIZE: usize, const TAG_SIZE: usize> IVSized for AesCcm<'c, KEY_SIZE, TAG_SIZE, 8>

Source§

impl<'c, const KEY_SIZE: usize, const TAG_SIZE: usize> IVSized for AesCcm<'c, KEY_SIZE, TAG_SIZE, 9>

Auto Trait Implementations§

§

impl<'c, const KEY_SIZE: usize, const TAG_SIZE: usize, const IV_SIZE: usize> Freeze for AesCcm<'c, KEY_SIZE, TAG_SIZE, IV_SIZE>

§

impl<'c, const KEY_SIZE: usize, const TAG_SIZE: usize, const IV_SIZE: usize> RefUnwindSafe for AesCcm<'c, KEY_SIZE, TAG_SIZE, IV_SIZE>

§

impl<'c, const KEY_SIZE: usize, const TAG_SIZE: usize, const IV_SIZE: usize> Send for AesCcm<'c, KEY_SIZE, TAG_SIZE, IV_SIZE>

§

impl<'c, const KEY_SIZE: usize, const TAG_SIZE: usize, const IV_SIZE: usize> Sync for AesCcm<'c, KEY_SIZE, TAG_SIZE, IV_SIZE>

§

impl<'c, const KEY_SIZE: usize, const TAG_SIZE: usize, const IV_SIZE: usize> Unpin for AesCcm<'c, KEY_SIZE, TAG_SIZE, IV_SIZE>

§

impl<'c, const KEY_SIZE: usize, const TAG_SIZE: usize, const IV_SIZE: usize> UnwindSafe for AesCcm<'c, KEY_SIZE, TAG_SIZE, IV_SIZE>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.