remove rand and replace with general cryptography

This commit is contained in:
Able 2022-12-05 09:25:10 -06:00
parent 92fdf7c42c
commit d696b236ec
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,