mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
print the debug info for trng pump
This commit is contained in:
parent
9ebb61c68c
commit
ec43c4622c
1 changed files with 4 additions and 4 deletions
|
|
@ -70,10 +70,10 @@ impl<'a> ShellCmdApi<'a> for TrngCmd {
|
||||||
"pump" => {
|
"pump" => {
|
||||||
const ROUNDS: usize = 16;
|
const ROUNDS: usize = 16;
|
||||||
for i in 0..ROUNDS {
|
for i in 0..ROUNDS {
|
||||||
log::debug!("pump round {}", i);
|
log::info!("pump round {}", i);
|
||||||
let mut buf: [u32; 1024] = [0; 1024];
|
let mut buf: [u32; 1020] = [0; 1020];
|
||||||
env.trng.fill_buf(&mut buf).unwrap();
|
env.trng.fill_buf(&mut buf).unwrap();
|
||||||
log::debug!("pump samples: {:x}, {:x}, {:x}", buf[0], buf[512], buf[1023]);
|
log::info!("pump samples: {:x}, {:x}, {:x}", buf[0], buf[512], buf[1019]);
|
||||||
}
|
}
|
||||||
write!(ret, "Pumped {}x1k values out of the engine", ROUNDS).unwrap();
|
write!(ret, "Pumped {}x1k values out of the engine", ROUNDS).unwrap();
|
||||||
}
|
}
|
||||||
|
|
@ -83,8 +83,8 @@ impl<'a> ShellCmdApi<'a> for TrngCmd {
|
||||||
"api" => {
|
"api" => {
|
||||||
// the purpose of these tests is to check the edge-case code because
|
// the purpose of these tests is to check the edge-case code because
|
||||||
// the trng fetch is u32, but rand_core allows u8
|
// the trng fetch is u32, but rand_core allows u8
|
||||||
use rand::rngs::OsRng;
|
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
|
use rand::rngs::OsRng;
|
||||||
let mut test1 = [0u8; 1];
|
let mut test1 = [0u8; 1];
|
||||||
OsRng.fill_bytes(&mut test1);
|
OsRng.fill_bytes(&mut test1);
|
||||||
log::info!("test 1: {:?}", test1);
|
log::info!("test 1: {:?}", test1);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue