pub struct Dot11TKIP {
pub offset: usize,
}Expand description
TKIP (Temporal Key Integrity Protocol) encryption wrapper.
Format:
[TSC1(1)] [WEPSeed(1)] [TSC0(1)] [KeyID/ExtIV(1)] [TSC2(1) TSC3(1) TSC4(1) TSC5(1)] [Encrypted Data...] [ICV(4)]The KeyID/ExtIV byte:
- Bits 0-4: Reserved
- Bit 5: ExtIV flag (always 1 for TKIP)
- Bits 6-7: Key ID
TSC (TKIP Sequence Counter) is a 48-bit value constructed from TSC0..TSC5.
Fields§
§offset: usizeImplementations§
Source§impl Dot11TKIP
impl Dot11TKIP
pub fn new(offset: usize) -> Self
Sourcepub fn validate(buf: &[u8], offset: usize) -> Result<(), FieldError>
pub fn validate(buf: &[u8], offset: usize) -> Result<(), FieldError>
Validate buffer length for TKIP header.
Sourcepub fn ext_iv(&self, buf: &[u8]) -> Result<bool, FieldError>
pub fn ext_iv(&self, buf: &[u8]) -> Result<bool, FieldError>
Check if Extended IV flag is set (bit 5 of byte 3).
Sourcepub fn tsc_high(&self, buf: &[u8]) -> Result<[u8; 4], FieldError>
pub fn tsc_high(&self, buf: &[u8]) -> Result<[u8; 4], FieldError>
TSC2-TSC5 (bytes 4-7, only present if ExtIV is set).
Sourcepub fn tsc(&self, buf: &[u8]) -> Result<u64, FieldError>
pub fn tsc(&self, buf: &[u8]) -> Result<u64, FieldError>
Full 48-bit TSC (TKIP Sequence Counter). TSC = TSC0 | (TSC1 << 8) | (TSC2 << 16) | (TSC3 << 24) | (TSC4 << 32) | (TSC5 << 40)
Sourcepub fn header_len(&self, buf: &[u8]) -> usize
pub fn header_len(&self, buf: &[u8]) -> usize
Header length: 4 bytes (no ExtIV) or 8 bytes (with ExtIV).
Sourcepub fn trailer_len(&self) -> usize
pub fn trailer_len(&self) -> usize
Trailer length (ICV = 4 bytes).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dot11TKIP
impl RefUnwindSafe for Dot11TKIP
impl Send for Dot11TKIP
impl Sync for Dot11TKIP
impl Unpin for Dot11TKIP
impl UnsafeUnpin for Dot11TKIP
impl UnwindSafe for Dot11TKIP
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