[][src]Struct nrf52832_hal::ccm::CcmData

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

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]

impl PartialEq<CcmData> for CcmData[src]

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]

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

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.