#[cfg(feature = "std")]
use crate::{OxiRng, ReseedingRng};
#[cfg(feature = "std")]
use oxicrypto_core::Rng;
#[cfg(feature = "std")]
impl std::io::Read for OxiRng {
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
self.fill(buf)
.map_err(|e| std::io::Error::other(format!("{e}")))?;
Ok(buf.len())
}
}
#[cfg(feature = "std")]
impl std::io::Read for ReseedingRng {
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
self.fill(buf)
.map_err(|e| std::io::Error::other(format!("{e}")))?;
Ok(buf.len())
}
}