construct_nonce

Function construct_nonce 

Source
pub fn construct_nonce(
    epoch: u32,
    direction: Direction,
    counter: u64,
) -> [u8; 24]
Available on crate feature crypto only.
Expand description

Construct a 24-byte XChaCha20-Poly1305 nonce.

Layout:

[ epoch (4) | direction (1) | zeros (11) | counter (8) ]

ยงArguments

  • epoch - Current key epoch (increments on rekey)
  • direction - Communication direction
  • counter - Per-direction frame counter