qubip_aurora 0.11.0

A framework to build OpenSSL Providers tailored for the transition to post-quantum cryptography
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::{named, ProviderInstance};
use rand_core::CryptoRngCore;

impl<'a> ProviderInstance<'a> {
    #[named]
    pub fn get_rng(&self) -> &'a mut dyn CryptoRngCore {
        trace!(target: log_target!(), "Called ");

        let rng = Box::new(rand::rngs::OsRng);

        // FIXME: we should not leak memory and properly derive an RNG instance from the provctx
        let leakyrng = Box::into_raw(rng);

        return unsafe { &mut *leakyrng };
    }
}