pub struct XChaCha20(_);
Expand description
XChaCha20 is a ChaCha20 variant with an extended 192-bit (24-byte) nonce.
The construction is an adaptation of the same techniques used by XSalsa20 as described in the paper “Extending the Salsa20 Nonce”, applied to the 96-bit nonce variant of ChaCha20, and derive a separate subkey/nonce for each extended nonce:
https://cr.yp.to/snuffle/xsalsa-20081128.pdf
No authoritative specification exists for XChaCha20, however the construction has “rough consensus and running code” in the form of several interoperable libraries and protocols (e.g. libsodium, WireGuard) and is documented in an (expired) IETF draft:
https://tools.ietf.org/html/draft-arciszewski-xchacha-03
The xchacha20
Cargo feature must be enabled in order to use this
(which it is by default).
Trait Implementations
sourceimpl NewStreamCipher for XChaCha20
impl NewStreamCipher for XChaCha20
sourceimpl SyncStreamCipher for XChaCha20
impl SyncStreamCipher for XChaCha20
sourceimpl SyncStreamCipherSeek for XChaCha20
impl SyncStreamCipherSeek for XChaCha20
sourcefn try_current_pos<T: SeekNum>(&self) -> Result<T, OverflowError>
fn try_current_pos<T: SeekNum>(&self) -> Result<T, OverflowError>
Try to get current keystream position Read more
sourcefn try_seek<T: SeekNum>(&mut self, pos: T) -> Result<(), LoopError>
fn try_seek<T: SeekNum>(&mut self, pos: T) -> Result<(), LoopError>
Try to seek to the given position Read more
sourcefn current_pos<T>(&self) -> T where
T: SeekNum,
fn current_pos<T>(&self) -> T where
T: SeekNum,
Get current keystream position Read more
Auto Trait Implementations
impl RefUnwindSafe for XChaCha20
impl Send for XChaCha20
impl Sync for XChaCha20
impl Unpin for XChaCha20
impl UnwindSafe for XChaCha20
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more