[][src]Struct crypto_api_chachapoly::ChaCha20Ietf

pub struct ChaCha20Ietf;

An implementation of ChaCha20 (IETF-version)

Implementations

impl ChaCha20Ietf[src]

pub fn cipher() -> Box<dyn Cipher>[src]

Creates a Cipher instance with ChaCha20Ietf as underlying cipher

pub fn xor(key: &[u8], nonce: &[u8], n: u32, data: &mut [u8])[src]

XORs the bytes in data with the ChaCha20 keystream for key and nonce starting at the nth block

Warning:

This function panics if

  • key is smaller or larger than 32 bytes/256 bits
  • nonce is smaller or larger than 12 bytes/96 bits
  • n exceeds 2^32 - 1 (which means that data must be smaller than (2^32 - n) * 64)

Consider using the crypto_api-interface instead of calling this function directly

Trait Implementations

impl Cipher for ChaCha20Ietf[src]

impl SecKeyGen for ChaCha20Ietf[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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> 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.