aegis 0.9.9

AEGIS authenticated ciphers (AEGIS-128, AEGIS-256, AEGIS-128X, AEGIS-256X)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::Error;

pub trait RafRng {
    fn fill(&mut self, buf: &mut [u8]) -> Result<(), Error>;
}

#[cfg(feature = "getrandom")]
pub struct OsRng;

#[cfg(feature = "getrandom")]
impl RafRng for OsRng {
    fn fill(&mut self, buf: &mut [u8]) -> Result<(), Error> {
        getrandom::fill(buf).map_err(|_| Error::Rng)
    }
}