camellia-rs

Crates.iocamellia-rs
lib.rscamellia-rs
version0.2.0
sourcesrc
created_at2019-04-07 12:28:42.779593
updated_at2019-04-12 06:22:58.897555
descriptionRust implementation of Camellia cipher.
homepage
repositoryhttps://github.com/dobasy/camellia-rs
max_upload_size
id126341
size51,345
(dobasy)

documentation

README

camellia-rs

Rust implementation of Camellia cipher.

Usage

use camellia_rs::*;

fn encrypt(key: &[u8], data: &mut [u8]) {
    assert_eq!(data.len() % 16, 0);
    let cipher = CamelliaCipher::new(key).unwrap();
    let mut buf = Block::default();

    for i in (0..key.len()).step_by(16) {
        buf.bytes.copy_from_slice(&data[i..(i + 16)]);
        cipher.encrypt(&mut buf);
        data[i..(i + 16)].copy_from_slice(&buf.bytes);
    }
}

License

This library is licensed under MIT License.

Commit count: 11

cargo fmt