pub struct Iv(/* private fields */);Expand description
A nonce for writing. Always 32 bytes, by type.
There is no constructor that takes a length and none that takes fewer bytes, so “encrypt with a 12-byte nonce” has no spelling in this crate.
Implementations§
Source§impl Iv
impl Iv
Sourcepub fn from_wire_exact(bytes: &[u8]) -> Option<Self>
pub fn from_wire_exact(bytes: &[u8]) -> Option<Self>
Adopt a nonce recovered from a file so an unchanged value re-encrypts identically. Only accepts the canonical length — a shorter nonce off the wire can be read but is never carried forward into a write.
pub fn as_bytes(&self) -> &[u8; 32]
Trait Implementations§
impl Eq for Iv
impl StructuralPartialEq for Iv
Auto Trait Implementations§
impl Freeze for Iv
impl RefUnwindSafe for Iv
impl Send for Iv
impl Sync for Iv
impl Unpin for Iv
impl UnsafeUnpin for Iv
impl UnwindSafe for Iv
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