Struct nrf52840_hal::ccm::CcmData[][src]

#[repr(C)]
pub struct CcmData { /* fields omitted */ }
Expand description

Data used for encryption/decryption.

It consists of a 128-bits key, a 39-bits counter, a direction bit and a 8-bytes initialization vector. There are some reserved bits in this structure, the total size is 33 bytes.

The NONCE vector (as specified by the Bluetooth Core Specification) will be generated by hardware based on this information.

Implementations

impl CcmData[src]

pub fn new(key: [u8; 16], initialization_vector: [u8; 8]) -> CcmData[src]

Creates a new CcmData instance.

The direction bit and the counter value will be initialized to zero. Care must be taken when choosing an initialization vector, it must be sufficiently random.

pub fn set_key(&mut self, key: [u8; 16])[src]

Updates the key.

pub fn set_iv(&mut self, initialization_vector: [u8; 8])[src]

Updates the initialization vector.

pub fn set_direction(&mut self, direction: bool)[src]

Updates the direction bit.

pub fn increment_counter(&mut self)[src]

Increments the counter. It will wrap around to zero at its maximum value.

pub fn decrement_counter(&mut self)[src]

Decrements the counter if the current value is bigger than zero.

Trait Implementations

impl Debug for CcmData[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl PartialEq<CcmData> for CcmData[src]

pub fn eq(&self, other: &CcmData) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

pub fn ne(&self, other: &CcmData) -> bool[src]

This method tests for !=.

impl StructuralPartialEq for CcmData[src]

Auto Trait Implementations

impl Send for CcmData

impl Sync for CcmData

impl Unpin for CcmData

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Az for T[src]

pub fn az<Dst>(self) -> Dst where
    T: Cast<Dst>, 
[src]

Casts the value.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> CheckedAs for T[src]

pub fn checked_as<Dst>(self) -> Option<Dst> where
    T: CheckedCast<Dst>, 
[src]

Casts the value.

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<Src, Dst> LosslessTryInto<Dst> for Src where
    Dst: LosslessTryFrom<Src>, 
[src]

pub fn lossless_try_into(self) -> Option<Dst>[src]

Performs the conversion.

impl<Src, Dst> LossyInto<Dst> for Src where
    Dst: LossyFrom<Src>, 
[src]

pub fn lossy_into(self) -> Dst[src]

Performs the conversion.

impl<T> OverflowingAs for T[src]

pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
    T: OverflowingCast<Dst>, 
[src]

Casts the value.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatingAs for T[src]

pub fn saturating_as<Dst>(self) -> Dst where
    T: SaturatingCast<Dst>, 
[src]

Casts the value.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> UnwrappedAs for T[src]

pub fn unwrapped_as<Dst>(self) -> Dst where
    T: UnwrappedCast<Dst>, 
[src]

Casts the value.

impl<T> WrappingAs for T[src]

pub fn wrapping_as<Dst>(self) -> Dst where
    T: WrappingCast<Dst>, 
[src]

Casts the value.