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]
impl CcmData
[src]pub fn new(key: [u8; 16], initialization_vector: [u8; 8]) -> 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_direction(&mut self, direction: bool)
[src]
pub fn set_direction(&mut self, direction: bool)
[src]Updates the direction bit.
pub fn increment_counter(&mut self)
[src]
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]
pub fn decrement_counter(&mut self)
[src]Decrements the counter if the current value is bigger than zero.
Trait Implementations
impl StructuralPartialEq for CcmData
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> CheckedAs for T
[src]
impl<T> CheckedAs for T
[src]pub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
[src]
pub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
[src]Casts the value.
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]pub fn lossless_try_into(self) -> Option<Dst>
[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]
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]pub fn lossy_into(self) -> Dst
[src]
pub fn lossy_into(self) -> Dst
[src]Performs the conversion.
impl<T> OverflowingAs for T
[src]
impl<T> OverflowingAs for T
[src]pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
[src]
pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
[src]Casts the value.
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> SaturatingAs for T
[src]
impl<T> SaturatingAs for T
[src]pub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
[src]
pub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
[src]Casts the value.
impl<T> UnwrappedAs for T
[src]
impl<T> UnwrappedAs for T
[src]pub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
[src]
pub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
[src]Casts the value.
impl<T> WrappingAs for T
[src]
impl<T> WrappingAs for T
[src]pub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
[src]
pub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
[src]Casts the value.