qssl 0.2.0

Pure Rust post-quantum TLS — zero C code. ML-KEM, ML-DSA, SLH-DSA, Falcon. FIPS 203/204/205/206 compliant. 100 Lean 4 theorems.
Documentation
//! Test SLH-DSA/Falcon KEM implementation

use qssl::quantum_native::sphincs_kem::SphincsKem;

fn main() {
    println!("Testing SLH-DSA/Falcon KEM (pure Rust, zero C)");
    println!("================================================\n");

    println!("Creating Alice and Bob with SLH-DSA identity keys...");
    let alice = SphincsKem::new().expect("Failed to create Alice KEM");
    let bob = SphincsKem::new().expect("Failed to create Bob KEM");

    println!("Keys generated successfully\n");

    let alice_pk = &alice.identity_pk.bytes;
    let bob_pk = &bob.identity_pk.bytes;

    println!("Key sizes:");
    println!("  SLH-DSA public key: {} bytes", alice_pk.len());
    println!("  Falcon public key: {} bytes", alice.ephemeral_pk.bytes.len());

    println!("\nAlice encapsulating for Bob...");
    let (ciphertext, alice_secret) = alice.encapsulate(bob_pk)
        .expect("Alice encapsulation failed");

    println!("Encapsulation successful");
    println!("  Ciphertext size: {} bytes", ciphertext.len());
    println!("  Shared secret: {} bytes", alice_secret.len());

    println!("\nBob decapsulating...");
    let bob_secret = bob.decapsulate(&ciphertext, alice_pk)
        .expect("Bob decapsulation failed");

    println!("Decapsulation successful");

    if alice_secret == bob_secret {
        println!("\nSUCCESS: Shared secrets match!");
        println!("Shared secret (hex): {}", hex::encode(&alice_secret[..16]));
    } else {
        println!("\nFAILURE: Shared secrets don't match!");
        std::process::exit(1);
    }
}