aurora/
random.rs

1use super::{named, ProviderInstance};
2use rand_core::CryptoRngCore;
3
4impl<'a> ProviderInstance<'a> {
5    #[named]
6    pub fn get_rng(&self) -> &'a mut dyn CryptoRngCore {
7        trace!(target: log_target!(), "Called ");
8
9        let rng = Box::new(rand::rngs::OsRng);
10
11        // FIXME: we should not leak memory and properly derive an RNG instance from the provctx
12        let leakyrng = Box::into_raw(rng);
13
14        return unsafe { &mut *leakyrng };
15    }
16}