hardware-rust-crypto 0.1.0

Hardware-only AES-256-GCM and AES-256-CTR key/nonce generation (AES-NI/PCLMULQDQ, ARMv8 AES/PMULL) with compact, caller-placeable, zeroized key state.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Fails when the hardware AES-GCM / AES-CTR backends are unavailable.
//!
//! CI runs this before the test suites so a green build cannot mean
//! "hardware-gated tests silently skipped on a runner without AES support".

fn main() {
    let aes_gcm = hardware_rust_crypto::aes_gcm::HardwareAes256Gcm::hardware_available();
    let aes_ctr = hardware_rust_crypto::random::AesCtrKeyGenerator::hardware_available();
    if !(aes_gcm && aes_ctr) {
        eprintln!("hardware crypto unavailable: aes_gcm={aes_gcm} aes_ctr={aes_ctr}");
        std::process::exit(1);
    }
    println!("hardware AES-GCM and AES-CTR backends available");
}