cas-lib 0.2.77

A function wrapper layer for RustCrypto and Dalek-Cryptography. Intended to be used in FFI situations with a global heap deallactor at the top level project.
Documentation
#[cfg(test)]
mod sponges {
    use std::{fs::File, io::Write, path::Path};
    use cas_lib::sponges::{ascon_aead::AsconAead, cas_ascon_aead::CASAsconAead};
    
    #[test]
    fn test_ascon_128() {
        let path = Path::new("tests/test.docx");
        let file_bytes: Vec<u8> = std::fs::read(path).unwrap();
        let ascon_nonce = <AsconAead as CASAsconAead>::generate_nonce();
        let ascon_key = <AsconAead as CASAsconAead>::generate_key();
        let encrypted_bytes = <AsconAead as CASAsconAead>::encrypt(ascon_key.clone(), ascon_nonce.clone(), file_bytes.clone());
        let mut file =  File::create("encrypted.docx").unwrap();
        file.write_all(&encrypted_bytes).unwrap();

        let decrypted_bytes = <AsconAead as CASAsconAead>::decrypt(ascon_key, ascon_nonce, encrypted_bytes);
        let mut file =  File::create("decrypted.docx").unwrap();
        file.write_all(&decrypted_bytes).unwrap();
        assert_eq!(file_bytes, decrypted_bytes);
    }
}