rusty_crypt 0.2.0

Rust library allowing for a very quick and simple implementation of AES-GCM encryption
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::error::CryptoError;

pub struct AesGeneratedKey;

impl AesGeneratedKey {
    pub fn generate_key(&self) -> Result<[u8; 32], CryptoError> {
        let mut key = [0u8; 32];

        getrandom::fill(&mut key).map_err(|_| CryptoError::RandomGenerationFailed)?;

        Ok(key)
    }
}