rc6_rs

Crates.iorc6_rs
lib.rsrc6_rs
version0.1.0
created_at2025-07-16 03:45:38.713482+00
updated_at2025-07-16 03:45:38.713482+00
descriptionRC6 implementation in Rust
homepage
repositoryhttps://github.com/cathaysia/rc6_rs
max_upload_size
id1754852
size34,325
cathaysia (cathaysia)

documentation

README

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

Commit count: 0

cargo fmt