From 8838fa616292a51c248866df53cb23d642a2a6ed Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 18 Jun 2024 00:08:57 +0800 Subject: [PATCH] add loader test mode for entropy output --- loader/Cargo.toml | 4 ++-- loader/src/platform/cramium/swap.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/loader/Cargo.toml b/loader/Cargo.toml index 2dc1c0f82..9b1c24d7c 100644 --- a/loader/Cargo.toml +++ b/loader/Cargo.toml @@ -97,5 +97,5 @@ irq-test = [] usb-test = [] trng-test = [] dump-trng = [] -resume = [] # suspend/resume pathway code -default = ["board-bringup", "usb-test", "trng-test"] +resume = [] # suspend/resume pathway code +default = ["board-bringup", "dump-trng"] diff --git a/loader/src/platform/cramium/swap.rs b/loader/src/platform/cramium/swap.rs index 91af9428a..322ae3d4b 100644 --- a/loader/src/platform/cramium/swap.rs +++ b/loader/src/platform/cramium/swap.rs @@ -317,6 +317,7 @@ impl SwapHal { // 1. XOR in another round of HW TRNG data into ChaCha8 // 2. create a new ChaCha8 from the resulting data // 3. Run the ChaCha8 for a few rounds and XOR that back into the state + // // Each round pulls in 8*32 = 256 bits from HW TRNG // 64 rounds of this would fold in 16,384 bits total, about 100x safety margin. for _ in 0..64 {