[−][src]Struct nrf52832_hal::ccm::CcmData
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
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,