[][src]Struct ring::aead::Nonce

pub struct Nonce(_);

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.

Methods

impl Nonce[src]

pub fn try_assume_unique_for_key(value: &[u8]) -> Result<Self, Unspecified>[src]

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.

pub fn assume_unique_for_key(value: [u8; 12]) -> Self[src]

Constructs a Nonce with the given value, assuming that the value is unique for the lifetime of the key it is being used with.

Trait Implementations

impl AsRef<[u8; 12]> for Nonce[src]

Auto Trait Implementations

impl Send for Nonce

impl Sync for Nonce

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]