pub struct SecurityBytes { /* private fields */ }Expand description
Container for MessageCounter and Checksum.
Implementations§
Source§impl SecurityBytes
impl SecurityBytes
pub fn from_seeds(crc_seed: u32, count_seed: u32) -> SecurityBytes
Sourcepub fn generate_count_byte(&self) -> u8
pub fn generate_count_byte(&self) -> u8
Generate the next count byte.
A count byte is used to avoid replay attacks, used to determine a continuous flow of the data. If a packet is dropped, or another injected, this will no longer match. It is essentially a seeded RNG number.
pub fn generate_checksum(&self, data: &[u8]) -> u8
pub fn checksum_builder(&self) -> ChecksumBuilder<'_>
Trait Implementations§
Source§impl From<CheckBytesInitialization> for SecurityBytes
impl From<CheckBytesInitialization> for SecurityBytes
Source§fn from(value: CheckBytesInitialization) -> SecurityBytes
fn from(value: CheckBytesInitialization) -> SecurityBytes
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for SecurityBytes
impl RefUnwindSafe for SecurityBytes
impl Send for SecurityBytes
impl Sync for SecurityBytes
impl Unpin for SecurityBytes
impl UnwindSafe for SecurityBytes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more