Struct sarkara::stream::HC256 [] [src]

pub struct HC256 { /* fields omitted */ }

HC256.

Example(process)

use rand::{ Rng, thread_rng };
use sarkara::stream::{ HC256, StreamCipher };

let mut rng = thread_rng();
let mut pass = vec![0; HC256::key_length()];
let mut nonce = vec![0; HC256::nonce_length()];
let mut data = vec![0; 1024];
rng.fill_bytes(&mut pass);
rng.fill_bytes(&mut nonce);
rng.fill_bytes(&mut data);

let cipher = HC256::new(&pass);
let ciphertext = cipher.process(&nonce, &data);
let plaintext = cipher.process(&nonce, &ciphertext);
assert_eq!(plaintext, data);

Trait Implementations

impl Debug for HC256
[src]

Formats the value using the given formatter.

impl Clone for HC256
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl StreamCipher for HC256
[src]

Create a new StreamCipher.

Key length.

Nonce length.

Process data.