add loader test mode for entropy output

This commit is contained in:
bunnie 2024-06-18 00:08:57 +08:00
parent 75cc40d866
commit 8838fa6162
2 changed files with 3 additions and 2 deletions

View file

@ -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"]

View file

@ -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 {