remove rand and replace with general cryptography

master
Able 2022-12-05 09:25:10 -06:00
parent abb57500d7
commit 9db8cd35c0
Signed by untrusted user: able
GPG Key ID: 0BD8B45C30DCA887
6 changed files with 43 additions and 15 deletions

31
Cargo.lock generated
View File

@ -68,6 +68,13 @@ dependencies = [
"toml 0.5.9 (git+https://git.ablecorp.us/theoddgarlic/toml-rs)",
]
[[package]]
name = "cryptography"
version = "0.1.1"
dependencies = [
"versioning",
]
[[package]]
name = "delete"
version = "0.1.0"
@ -152,6 +159,14 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "messaging"
version = "0.1.0"
dependencies = [
"process",
"versioning",
]
[[package]]
name = "no_video"
version = "0.1.0"
@ -177,6 +192,13 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "process"
version = "0.1.0"
dependencies = [
"versioning",
]
[[package]]
name = "ps2_keyboard"
version = "0.1.0"
@ -190,18 +212,11 @@ dependencies = [
"proc-macro2",
]
[[package]]
name = "rand"
version = "0.1.1"
dependencies = [
"versioning",
]
[[package]]
name = "randomness_handler"
version = "0.1.0"
dependencies = [
"rand",
"cryptography",
"versioning",
]

View File

@ -13,8 +13,10 @@ members = [
"libraries/able_graphics_library",
"libraries/clparse",
"libraries/cryptography",
"libraries/locale-maxima",
"libraries/rand",
"libraries/messaging",
"libraries/process",
"libraries/table",
"libraries/tar",
"libraries/time",

View File

@ -1,5 +1,5 @@
[package]
name = "rand"
name = "cryptography"
version = "0.1.1"
edition = "2021"

View File

@ -0,0 +1,10 @@
pub fn checksum<T: AsRef<[u8]>>(input: T) -> u64 {
let input_bytes = input.as_ref();
let mut checksum: u64 = 0;
for &byte in input_bytes {
checksum = checksum.wrapping_add(byte as u64);
}
checksum
}

View File

@ -0,0 +1,6 @@
#![no_std]
pub mod random;
use versioning::Version;
pub const VERSION: Version = Version::new(0, 1, 1);

View File

@ -1,10 +1,5 @@
#![no_std]
use core::fmt::Display;
use versioning::Version;
pub const VERSION: Version = Version::new(0, 1, 1);
pub struct Csprng {
state: [u8; 256],
dirty: bool,