embassy-stm32

Crates

git

Versions

stm32h533ze

Flavors

Aes

Struct Aes 

Source
pub struct Aes<'d, T: Instance, M: Mode> { /* private fields */ }
Expand description

AES driver.

Implementations§

Source§

impl<'d, T: Instance> Aes<'d, T, Blocking>

Source

pub fn new_blocking( peripheral: Peri<'d, T>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, ) -> Self

Instantiates, resets, and enables the AES peripheral.

Source§

impl<'d, T: Instance> Aes<'d, T, Async>

Source

pub fn new( peripheral: Peri<'d, T>, dma_in: Peri<'d, impl DmaIn<T>>, dma_out: Peri<'d, impl DmaOut<T>>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, ) -> Self

Instantiates, resets, and enables the AES peripheral with DMA support.

Source§

impl<'d, T: Instance, M: Mode> Aes<'d, T, M>

Source

pub fn start<'c, C>(&mut self, cipher: &'c C, dir: Direction) -> Context<'c, C>
where C: Cipher<'c> + CipherSized + IVSized,

Starts a new cipher operation and returns the context.

Source

pub fn aad_blocking<'c, C>( &mut self, ctx: &mut Context<'c, C>, aad: &[u8], last: bool, ) -> Result<(), Error>
where C: Cipher<'c> + CipherAuthenticated<16>,

Process authenticated additional data (AAD) for GCM/CCM modes. Must be called after start and before payload_blocking. Set last to true for the final AAD block.

Source

pub fn payload_blocking<'c, C>( &mut self, ctx: &mut Context<'c, C>, input: &[u8], output: &mut [u8], last: bool, ) -> Result<(), Error>
where C: Cipher<'c>,

Process payload data in blocking mode.

Set last to true for the final block. Intermediate chunks (last=false) must be block-aligned (16 bytes). Only the final chunk can be a partial block.

Source

pub fn finish_blocking<'c, C>( &mut self, ctx: Context<'c, C>, ) -> Result<Option<[u8; 16]>, Error>
where C: Cipher<'c>,

Finishes the cipher operation and returns the authentication tag (for GCM/CCM).

Auto Trait Implementations§

§

impl<'d, T, M> Freeze for Aes<'d, T, M>
where T: Freeze,

§

impl<'d, T, M> RefUnwindSafe for Aes<'d, T, M>

§

impl<'d, T, M> Send for Aes<'d, T, M>
where M: Send,

§

impl<'d, T, M> Sync for Aes<'d, T, M>
where T: Sync, M: Sync,

§

impl<'d, T, M> Unpin for Aes<'d, T, M>
where T: Unpin, M: Unpin,

§

impl<'d, T, M> !UnwindSafe for Aes<'d, T, M>

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.