mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
add an upper limit for counter increments
this is a sanity check number that can be used by firmware to vet a counter value before incrementing to it. it's particularly useful to thwart wear-out attacks agaisnt anti-rollback firmware versions, i.e. by specifying an extremely high anti-rollback number one might be able to cause a reset-to-0 failure and this prevents that from happening by limiting the maximum value of the the counter that can be requested.
This commit is contained in:
parent
9d972f59d5
commit
23b7bc0142
1 changed files with 3 additions and 0 deletions
|
|
@ -24,6 +24,9 @@ const COUNTER_STRIDE_U32: usize = ONEWAY_LEN / size_of::<u32>();
|
||||||
pub const MAX_ONEWAY_COUNTERS: usize = 8192 / ONEWAY_LEN;
|
pub const MAX_ONEWAY_COUNTERS: usize = 8192 / ONEWAY_LEN;
|
||||||
pub const CODESEL_END: usize = 0x603D_A000;
|
pub const CODESEL_END: usize = 0x603D_A000;
|
||||||
|
|
||||||
|
/// This is set by the wear-out limit of the underlying RRAM.
|
||||||
|
pub const ONEWAY_MAX_VALUE: u32 = 10_0000;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
pub enum OneWayErr {
|
pub enum OneWayErr {
|
||||||
OutOfBounds,
|
OutOfBounds,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue