pub struct Nonce(_);
Expand description
A nonce for a single AEAD opening or sealing operation.
The user must ensure, for a particular key, that each nonce is unique.
Nonce
intentionally doesn’t implement Clone
to ensure that each one is
consumed at most once.
Implementations§
source§impl Nonce
impl Nonce
sourcepub fn try_assume_unique_for_key(value: &[u8]) -> Result<Self, Unspecified>
pub fn try_assume_unique_for_key(value: &[u8]) -> Result<Self, Unspecified>
Constructs a Nonce
with the given value, assuming that the value is
unique for the lifetime of the key it is being used with.
Fails if value
isn’t NONCE_LEN
bytes long.
sourcepub fn assume_unique_for_key(value: [u8; 12]) -> Self
pub fn assume_unique_for_key(value: [u8; 12]) -> Self
Constructs a Nonce
with the given value, assuming that the value is
unique for the lifetime of the key it is being used with.