ciph 0.1.0

Symmetric cipher layer for async read/write connections.
Documentation
//! Salsa20 symmetric cypher stream.
//!
//! Secure an `AsyncWrite + AsyncRead` type by layering over it two
/// [Salsa20](https://github.com/RustCrypto/stream-ciphers) stream ciphers.

mod connector;
mod acceptor;
mod stream;
mod model;

#[cfg(feature = "hyper")]
mod for_hyper_client;

pub use self::model::{WrapKey, Psk, Randomness, load_psk};
pub use self::stream::SalsaStream;
pub use self::connector::Connector;
pub use self::acceptor::{StreamAcceptor, TcpListenAcceptor, Acceptor, Accept};

#[cfg(feature = "hyper")]
pub use self::for_hyper_client::HyperSalsaConnector;

/// To ensure keys and other valuable bits of info don't linger in memory, this function
/// is called when possible to zero out the memory referred to in `slice`.
pub fn erase_bytes(slice: &mut [u8]) {
    slice
        .iter_mut()
        .for_each(|b| {
            *b = 0
        });
}