# [−] [src] Crate c2_chacha

Pure Rust ChaCha with SIMD optimizations.

Stream-cipher usage:

    extern crate c2_chacha;

    use c2_chacha::stream_cipher::{NewStreamCipher, SyncStreamCipher, SyncStreamCipherSeek};
    use c2_chacha::{ChaCha20, ChaCha12};

    let key = b"very secret key-the most secret.";
    let iv = b"my nonce";
    let plaintext = b"The quick brown fox jumps over the lazy dog.";

    let mut buffer = plaintext.to_vec();
    // create cipher instance
    let mut cipher = ChaCha20::new_var(key, iv).unwrap();
    // apply keystream (encrypt)
    cipher.apply_keystream(&mut buffer);
    // and decrypt it back
    cipher.seek(0);
    cipher.apply_keystream(&mut buffer);
    // stream ciphers can be used with streaming messages
    let mut cipher = ChaCha12::new_var(key, iv).unwrap();
    for chunk in buffer.chunks_mut(3) {
        cipher.apply_keystream(chunk);
    }

## Modules

guts |

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)