Crate rc6_rs

Source
Expand description

§rc6_rs

A Rust implementation of the RC6 block cipher, translated from libtomcrypto using c2rust.

§Features

  • RC6 block cipher implementation (128-bit blocks)
  • Variable key sizes (16, 24, 32 bytes)
  • Compatible with the RustCrypto crate traits
  • Safe Rust API over translated C code

§Usage

use rc6_rs::Rc6;
use cipher::consts::U32;

// Create cipher with 32-byte key
let key = [0u8; 32];
let cipher = Rc6::<U32>::new(&key, 20); // 20 rounds

// Encrypt 16-byte block
let plaintext = [0u8; 16];
let ciphertext = cipher.encrypt(&plaintext).unwrap();

// Decrypt
let decrypted = cipher.decrypt(&ciphertext).unwrap();
assert_eq!(plaintext, decrypted.as_slice());

§Credits

§Features

  • rust_crypto (enabled by default) — Enables Rust Crypto crate integration

Structs§

Rc6