embassy-stm32

Crates

git

Versions

stm32h7s7z8

Flavors

embassy_stm32::cryp

Struct AesGmac

source
pub struct AesGmac<'c, const KEY_SIZE: usize> { /* private fields */ }
Expand description

AES-GMAC Cipher Mode

Implementations§

source§

impl<'c, const KEY_SIZE: usize> AesGmac<'c, KEY_SIZE>

source

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

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

Trait Implementations§

source§

impl<'c, const KEY_SIZE: usize> Cipher<'c> for AesGmac<'c, KEY_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>, )

Performs any cipher-specific initialization.
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§

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

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

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

source§

const TAG_SIZE: usize = TAG_SIZE

Defines the authentication tag size.
source§

impl<'c> CipherSized for AesGmac<'c, { _ }>

source§

impl<'c> CipherSized for AesGmac<'c, { _ }>

source§

impl<'c> CipherSized for AesGmac<'c, { _ }>

source§

impl<'c, const KEY_SIZE: usize> IVSized for AesGmac<'c, KEY_SIZE>

Auto Trait Implementations§

§

impl<'c, const KEY_SIZE: usize> Freeze for AesGmac<'c, KEY_SIZE>

§

impl<'c, const KEY_SIZE: usize> RefUnwindSafe for AesGmac<'c, KEY_SIZE>

§

impl<'c, const KEY_SIZE: usize> Send for AesGmac<'c, KEY_SIZE>

§

impl<'c, const KEY_SIZE: usize> Sync for AesGmac<'c, KEY_SIZE>

§

impl<'c, const KEY_SIZE: usize> Unpin for AesGmac<'c, KEY_SIZE>

§

impl<'c, const KEY_SIZE: usize> UnwindSafe for AesGmac<'c, KEY_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.