vios_app 0.1.1

Small JSON vaults: Argon2id + AES-GCM, with optional AAD binding.
Documentation
use sha2::{Digest, Sha256};

pub fn compute_cia_hex(encrypted_bytes: &[u8], aad: &[u8], device_hint: &str) -> String {
    // CIA™ authorship hash: H( enc_payload || aad || device_hint )
    let mut hasher = Sha256::new();
    hasher.update(encrypted_bytes);
    hasher.update(aad);
    hasher.update(device_hint.as_bytes());
    let out = hasher.finalize();
    hex::encode(out)
}

// minimal hex helper (no extra dep)
mod hex {
    pub fn encode(bytes: impl AsRef<[u8]>) -> String {
        const LUT: &[u8; 16] = b"0123456789abcdef";
        let b = bytes.as_ref();
        let mut s = String::with_capacity(b.len() * 2);
        for &x in b {
            s.push(LUT[(x >> 4) as usize] as char);
            s.push(LUT[(x & 0x0f) as usize] as char);
        }
        s
    }
}