pub struct Nonce(pub [u8; 12]);Expand description
A nonce. This is unique for all messages on a connection.
Tuple Fields§
§0: [u8; 12]Implementations§
Source§impl Nonce
impl Nonce
Sourcepub fn new(iv: &Iv, seq: u64) -> Self
pub fn new(iv: &Iv, seq: u64) -> Self
Combine an Iv and sequence number to produce a unique nonce.
This is iv ^ seq where seq is encoded as a 96-bit big-endian integer.
Sourcepub fn for_path(path_id: u32, iv: &Iv, pn: u64) -> Self
pub fn for_path(path_id: u32, iv: &Iv, pn: u64) -> Self
Creates a unique nonce based on the iv, the packet number pn and multipath path_id.
The nonce is computed as the XOR between the iv and the 96-bit big-ending integer formed
by concatenating path_id and pn.
Sourcefn new_from_seq(iv: &Iv, seq: [u8; 12]) -> Self
fn new_from_seq(iv: &Iv, seq: [u8; 12]) -> Self
Creates a unique nonce based on the iv and sequence number seq.
Auto Trait Implementations§
impl Freeze for Nonce
impl RefUnwindSafe for Nonce
impl Send for Nonce
impl Sync for Nonce
impl Unpin for Nonce
impl UnwindSafe for Nonce
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