[−][src]Struct bdrck::crypto::key::Nonce
A cryptographic nonce is an arbitrary number that can be used only once (e.g. for encryption).
Methods
impl Nonce
[src]
pub fn new() -> Self
[src]
Return a new, zero-initialized nonce.
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
[src]
Construct a new Nonce from raw bytes. The given byte slice must be exactly NONCE_BYTES long.
pub fn increment(self) -> Self
[src]
Increment this nonce's bytes by 1. This is useful for counter-style nonces.
pub fn as_bytes(&self) -> &[u8]
[src]
Access the raw bytes which make up this Nonce.
Trait Implementations
impl Clone for Nonce
[src]
impl Debug for Nonce
[src]
impl Default for Nonce
[src]
fn default() -> Self
[src]
Return a new randomly generated nonce. This is the default, because it's safer / less error prone vs. e.g. accidentally using a zeroed out nonce twice.
impl<'de> Deserialize<'de> for Nonce
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Nonce
[src]
impl PartialEq<Nonce> for Nonce
[src]
impl Serialize for Nonce
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Nonce
[src]
impl StructuralPartialEq for Nonce
[src]
Auto Trait Implementations
impl RefUnwindSafe for Nonce
impl Send for Nonce
impl Sync for Nonce
impl Unpin for Nonce
impl UnwindSafe for Nonce
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,