Updates people!

pull/1/head
Able 2022-12-05 04:04:54 -06:00
parent 7d7a04d8e4
commit d209e69659
Signed by: able
GPG Key ID: 0BD8B45C30DCA887
4 changed files with 29 additions and 4 deletions

2
Cargo.lock generated
View File

@ -188,7 +188,7 @@ dependencies = [
[[package]]
name = "rand"
version = "0.1.0"
version = "0.1.1"
dependencies = [
"versioning",
]

View File

@ -8,5 +8,22 @@ pub const VERSION: Version = Version::new(0, 1, 0);
fn start() {
let mut inner_rng = Csprng::new();
inner_rng.mix_in_data(&[8, 9, 10, 23, 2, 3]);
let _ran_u8 = inner_rng.get_random_u8();
// Request PCI IDS and mixin
let pci_id_data = [8, 12];
inner_rng.mix_in_data(&pci_id_data);
let rand_bytes = inner_rng.get_random_u128().unwrap();
inner_rng.mix_in_data(&rand_bytes.to_le_bytes());
// Loop driver forever
loop {
// Request Mouse XY
let mouse_x_y = [12, 12];
inner_rng.mix_in_data(&mouse_x_y);
// Request the last keypress
let key_press = [7];
inner_rng.mix_in_data(&key_press);
}
}

View File

@ -1,6 +1,6 @@
[package]
name = "rand"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -1,7 +1,9 @@
#![no_std]
use core::fmt::Display;
use versioning::Version;
pub const VERSION: Version = Version::new(0, 1, 0);
pub const VERSION: Version = Version::new(0, 1, 1);
pub struct Csprng {
state: [u8; 256],
@ -137,4 +139,10 @@ impl Csprng {
}
}
#[derive(Debug)]
pub enum RandError {}
impl Display for RandError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self)
}
}