mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
adjust trng source provider based on hardware target
This commit is contained in:
parent
4d28e940d0
commit
ae4ed7ba3d
3 changed files with 12 additions and 4 deletions
|
|
@ -19,7 +19,8 @@ rkyv = { version = "0.4.3", features = [
|
|||
"const_generics",
|
||||
], default-features = false }
|
||||
gam = { path = "../gam" }
|
||||
trng = { path = "../trng" }
|
||||
trng = { path = "../trng", optional = true }
|
||||
cram-hal-service = { path = "../cram-hal-service", optional = true } # provides trng for cramium-soc
|
||||
tts-frontend = { path = "../tts" }
|
||||
locales = { path = "../../locales" }
|
||||
bit_field = "0.9.0"
|
||||
|
|
@ -27,9 +28,10 @@ bit_field = "0.9.0"
|
|||
utralib = { version = "0.1.24", optional = true, default-features = false }
|
||||
|
||||
[features]
|
||||
precursor = ["utralib/precursor"]
|
||||
hosted = ["utralib/hosted"]
|
||||
renode = ["utralib/renode"]
|
||||
precursor = ["utralib/precursor", "trng"]
|
||||
hosted = ["utralib/hosted", "trng"]
|
||||
renode = ["utralib/renode", "trng"]
|
||||
cramium-soc = ["utralib/cramium-soc", "cram-hal-service"]
|
||||
tts = []
|
||||
ditherpunk = []
|
||||
hazardous-debug = []
|
||||
|
|
|
|||
|
|
@ -180,6 +180,9 @@ impl Modals {
|
|||
REFCOUNT.fetch_add(1, Ordering::Relaxed);
|
||||
let conn =
|
||||
xns.request_connection_blocking(api::SERVER_NAME_MODALS).expect("Can't connect to Modals server");
|
||||
#[cfg(feature = "cramium-soc")]
|
||||
let trng = cram_hal_service::trng::Trng::new(&xns).unwrap();
|
||||
#[cfg(not(feature = "cramium-soc"))]
|
||||
let trng = trng::Trng::new(&xns).unwrap();
|
||||
let mut token = [0u32; 4];
|
||||
trng.fill_buf(&mut token).unwrap();
|
||||
|
|
|
|||
|
|
@ -138,6 +138,9 @@ fn wrapped_main() -> ! {
|
|||
let mut list_selected = 0u32;
|
||||
|
||||
let mut token_lock: Option<[u32; 4]> = None;
|
||||
#[cfg(feature = "cramium-soc")]
|
||||
let trng = cram_hal_service::trng::Trng::new(&xns).unwrap();
|
||||
#[cfg(not(feature = "cramium-soc"))]
|
||||
let trng = trng::Trng::new(&xns).unwrap();
|
||||
// this is a random number that serves as a "default" that cannot be guessed
|
||||
let default_nonce =
|
||||
|
|
|
|||
Loading…
Reference in a new issue