// Quick sanity check for the Cardea crypto builtins
// No running here — just structurally verifying call shapes

fn main() {
    println("=== Cardea Primitives Sanity ===")

    // Secure random
    let seed = secure_random_bytes(32)
    println("seed len:")
    println(tensor_len(seed))

    // SHA3-256
    let digest = sha3_256(seed)
    println("sha3_256 digest len:")
    println(tensor_len(digest))

    // SHAKE-256 extendable output
    let extended = shake_256(seed, 64)
    println("shake_256 len 64:")
    println(tensor_len(extended))

    // XOR two byte tensors
    let a = secure_random_bytes(16)
    let b = secure_random_bytes(16)
    let x = xor_bytes(a, b)
    println("xor_bytes len:")
    println(tensor_len(x))

    // Centered binomial sample (Kyber noise)
    let cbd = cbd_sample(seed, 2, 256)
    println("cbd_sample 256 len:")
    println(tensor_len(cbd))

    // Mod-q arithmetic
    let poly_a = cbd_sample(seed, 2, 256)
    let poly_b = cbd_sample(shake_256(seed, 32), 2, 256)
    let sum = poly_add_mod_q(poly_a, poly_b, 3329)
    println("poly_add_mod_q len:")
    println(tensor_len(sum))

    let prod = poly_mul_mod_q(poly_a, poly_b, 3329)
    println("poly_mul_mod_q len:")
    println(tensor_len(prod))

    let modded = mod_q(prod, 3329)
    println("mod_q result len:")
    println(tensor_len(modded))

    println("All Cardea primitives wired correctly.")
}
