camellia-rs 0.2.0

Rust implementation of Camellia cipher.
Documentation
  • Coverage
  • 60%
    3 out of 5 items documented0 out of 1 items with examples
  • Size
  • Source code size: 50.98 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.31 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • dobasy/camellia-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dobasy

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.