mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
add sampling countermeasures to the kernel
this evolves the TRNG state further after reporting any raw samples for QC to make it harder to reason about the TRNG state after QC.
This commit is contained in:
parent
ed2b5ec84d
commit
a5322eaa7a
1 changed files with 10 additions and 0 deletions
|
|
@ -102,3 +102,13 @@ pub fn get_u32() -> u32 {
|
|||
LOCAL_RNG_STATE_MSB.store((next_state >> 32) as u32, Ordering::SeqCst);
|
||||
ret_val
|
||||
}
|
||||
|
||||
pub fn get_raw_u32() -> u32 {
|
||||
unsafe {
|
||||
TRNG_KERNEL
|
||||
.as_mut()
|
||||
.expect("TRNG_KERNEL driver not initialized")
|
||||
.get_u32()
|
||||
.expect("Error in random number generation")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue