use libslug::slugcrypt::internals::encrypt::chacha20::*;
fn main() {
println!("Generating XChaCha20 Key:");
let key = EncryptionKey::generate();
let key_hex = key.to_hex().unwrap();
println!("Key Hex (Using Constant-Time(ish)): {}", &key_hex);
let (eciphertext, nonce) = XChaCha20Encrypt::encrypt(key, "This message is to be encrypted using XCHACHA20-POLY1305").unwrap();
let message = XChaCha20Encrypt::decrypt(EncryptionKey::from_hex(&key_hex).unwrap(), nonce, eciphertext).unwrap();
let decoded_msg = String::from_utf8(message).unwrap();
println!("Decoded Message: {}", decoded_msg);
}