nxp-pac

Crates

git

Versions

lpc55s69_cm33_core0

Flavors

Cryptcfg

Struct Cryptcfg 

Source
#[repr(transparent)]
pub struct Cryptcfg(pub u32);
Expand description

Crypto settings for AES and Salsa and ChaCha

Tuple Fields§

§0: u32

Implementations§

Source§

impl Cryptcfg

Source

pub const fn msw1st_out(&self) -> bool

If 1, OUTDATA0 will be read Most significant word 1st for AES. Else it will be read in normal little endian - Least significant word 1st. Note: only if allowed by configuration.

Source

pub const fn set_msw1st_out(&mut self, val: bool)

If 1, OUTDATA0 will be read Most significant word 1st for AES. Else it will be read in normal little endian - Least significant word 1st. Note: only if allowed by configuration.

Source

pub const fn swapkey(&self) -> bool

If 1, will Swap the key input (bytes in each word).

Source

pub const fn set_swapkey(&mut self, val: bool)

If 1, will Swap the key input (bytes in each word).

Source

pub const fn swapdat(&self) -> bool

If 1, will SWAP the data and IV inputs (bytes in each word).

Source

pub const fn set_swapdat(&mut self, val: bool)

If 1, will SWAP the data and IV inputs (bytes in each word).

Source

pub const fn msw1st(&self) -> bool

If 1, load of key, IV, and data is MSW 1st for AES. Else, the words are little endian. Note: only if allowed by configuration.

Source

pub const fn set_msw1st(&mut self, val: bool)

If 1, load of key, IV, and data is MSW 1st for AES. Else, the words are little endian. Note: only if allowed by configuration.

Source

pub const fn aesmode(&self) -> Aesmode

AES Cipher mode to use if plain AES

Source

pub const fn set_aesmode(&mut self, val: Aesmode)

AES Cipher mode to use if plain AES

Source

pub const fn aesdecrypt(&self) -> Aesdecrypt

AES ECB direction. Only encryption used if CTR mode or manual modes such as CFB

Source

pub const fn set_aesdecrypt(&mut self, val: Aesdecrypt)

AES ECB direction. Only encryption used if CTR mode or manual modes such as CFB

Source

pub const fn aessecret(&self) -> Aessecret

Selects the Hidden Secret key vs. User key, if provided. If security levels are used, only the highest level is permitted to select this.

Source

pub const fn set_aessecret(&mut self, val: Aessecret)

Selects the Hidden Secret key vs. User key, if provided. If security levels are used, only the highest level is permitted to select this.

Source

pub const fn aeskeysz(&self) -> Aeskeysz

Sets the AES key size

Source

pub const fn set_aeskeysz(&mut self, val: Aeskeysz)

Sets the AES key size

Source

pub const fn aesctrpos(&self) -> u8

Halfword position of 16b counter in IV if AESMODE is CTR (position is fixed for Salsa and ChaCha). Only supports 16b counter, so application must control any additional bytes if using more. The 16-bit counter is read from the IV and incremented by 1 each time. Any other use CTR should use ECB directly and do its own XOR and so on.

Source

pub const fn set_aesctrpos(&mut self, val: u8)

Halfword position of 16b counter in IV if AESMODE is CTR (position is fixed for Salsa and ChaCha). Only supports 16b counter, so application must control any additional bytes if using more. The 16-bit counter is read from the IV and incremented by 1 each time. Any other use CTR should use ECB directly and do its own XOR and so on.

Source

pub const fn streamlast(&self) -> bool

Is 1 if last stream block. If not 1, then the engine will compute the next “hash”.

Source

pub const fn set_streamlast(&mut self, val: bool)

Is 1 if last stream block. If not 1, then the engine will compute the next “hash”.

Source

pub const fn icbsz(&self) -> Icbsz

This sets the ICB size between 32 and 128 bits, using the following rules. Note that the counter is assumed to occupy the low order bits of the IV.

Source

pub const fn set_icbsz(&mut self, val: Icbsz)

This sets the ICB size between 32 and 128 bits, using the following rules. Note that the counter is assumed to occupy the low order bits of the IV.

Source

pub const fn icbstrm(&self) -> Icbstrm

The size of the ICB-AES stream that can be pushed before needing to compute a new IV/ctr (counter start). This optimizes the performance of the stream of blocks after the 1st.

Source

pub const fn set_icbstrm(&mut self, val: Icbstrm)

The size of the ICB-AES stream that can be pushed before needing to compute a new IV/ctr (counter start). This optimizes the performance of the stream of blocks after the 1st.

Trait Implementations§

Source§

impl Clone for Cryptcfg

Source§

fn clone(&self) -> Cryptcfg

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Cryptcfg

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Cryptcfg

Source§

fn default() -> Cryptcfg

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Cryptcfg

Source§

fn eq(&self, other: &Cryptcfg) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Cryptcfg

Source§

impl Eq for Cryptcfg

Source§

impl StructuralPartialEq for Cryptcfg

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.