pub struct Saes<'d, T: Instance, M: Mode> { /* private fields */ }Expand description
SAES driver.
Implementations§
Source§impl<'d, T: Instance> Saes<'d, T, Blocking>
impl<'d, T: Instance> Saes<'d, T, Blocking>
Sourcepub fn new_blocking(
peripheral: Peri<'d, T>,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd,
) -> Self
pub fn new_blocking( peripheral: Peri<'d, T>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + 'd, ) -> Self
Instantiates, resets, and enables the SAES peripheral.
Source§impl<'d, T: Instance> Saes<'d, T, Async>
impl<'d, T: Instance> Saes<'d, T, Async>
Sourcepub fn new<D1: DmaIn<T>, D2: DmaOut<T>>(
peripheral: Peri<'d, T>,
dma_in: Peri<'d, D1>,
dma_out: Peri<'d, D2>,
_irq: impl Binding<T::Interrupt, InterruptHandler<T>> + Binding<D1::Interrupt, InterruptHandler<D1>> + Binding<D2::Interrupt, InterruptHandler<D2>> + 'd,
) -> Self
pub fn new<D1: DmaIn<T>, D2: DmaOut<T>>( peripheral: Peri<'d, T>, dma_in: Peri<'d, D1>, dma_out: Peri<'d, D2>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>> + Binding<D1::Interrupt, InterruptHandler<D1>> + Binding<D2::Interrupt, InterruptHandler<D2>> + 'd, ) -> Self
Instantiates, resets, and enables the SAES peripheral with DMA support.
Source§impl<'d, T: Instance, M: Mode> Saes<'d, T, M>
impl<'d, T: Instance, M: Mode> Saes<'d, T, M>
Sourcepub fn start<'c, C>(&mut self, cipher: &'c C, dir: Direction) -> Context<'c, C>
pub fn start<'c, C>(&mut self, cipher: &'c C, dir: Direction) -> Context<'c, C>
Starts a new cipher operation with a software key.
Sourcepub fn start_with_hw_key<'c, C>(
&mut self,
key_source: HardwareKeySource,
cipher: &'c C,
dir: Direction,
) -> Context<'c, C>
pub fn start_with_hw_key<'c, C>( &mut self, key_source: HardwareKeySource, cipher: &'c C, dir: Direction, ) -> Context<'c, C>
Starts a new cipher operation with a hardware-derived key.
Sourcepub fn start_with_mode<'c, C>(
&mut self,
key_mode: KeyMode,
hw_key: Option<HardwareKeySource>,
cipher: &'c C,
dir: Direction,
) -> Context<'c, C>
pub fn start_with_mode<'c, C>( &mut self, key_mode: KeyMode, hw_key: Option<HardwareKeySource>, cipher: &'c C, dir: Direction, ) -> Context<'c, C>
Starts a new cipher operation with an explicit SAES key mode.
This enables wrapped-key/shared-key workflows in addition to normal mode.
When hw_key is provided, SAES selects a hardware key source.
Sourcepub fn start_wrapped_key<'c, C>(
&mut self,
cipher: &'c C,
dir: Direction,
) -> Context<'c, C>
pub fn start_wrapped_key<'c, C>( &mut self, cipher: &'c C, dir: Direction, ) -> Context<'c, C>
Starts a new cipher operation in wrapped-key mode.
Starts a new cipher operation in shared-key mode.
Share the current unwrapped key with another peripheral. This must be called after a decryption operation that unwrapped a key.
Sourcepub fn aad_blocking<'c, C>(
&mut self,
ctx: &mut Context<'c, C>,
aad: &[u8],
last: bool,
) -> Result<(), Error>where
C: Cipher<'c> + CipherAuthenticated<16>,
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.
Source§impl<'d, T: Instance> Saes<'d, T, Async>
impl<'d, T: Instance> Saes<'d, T, Async>
Sourcepub async fn aad<'c, C>(
&mut self,
ctx: &mut Context<'c, C>,
aad: &[u8],
last: bool,
) -> Result<(), Error>where
C: Cipher<'c> + CipherAuthenticated<16>,
pub async fn aad<'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 (async facade).