mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
ensure that hardened_get2 is used correctly with an assert
This commit is contained in:
parent
32ffba0931
commit
d9d146352f
1 changed files with 4 additions and 0 deletions
|
|
@ -128,6 +128,10 @@ impl OneWayCounter {
|
||||||
/// if they are not, then something bad happened.
|
/// if they are not, then something bad happened.
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn hardened_get2(&self, offset: usize, dupe: usize) -> Result<(u32, u32), OneWayErr> {
|
pub fn hardened_get2(&self, offset: usize, dupe: usize) -> Result<(u32, u32), OneWayErr> {
|
||||||
|
assert!(
|
||||||
|
offset != dupe,
|
||||||
|
"hardened_get2 requires different offsets; use hardened_get for same offset gets"
|
||||||
|
);
|
||||||
bollard!(4);
|
bollard!(4);
|
||||||
const HARDENING_FACTOR: usize = 4;
|
const HARDENING_FACTOR: usize = 4;
|
||||||
#[cfg(not(feature = "std"))]
|
#[cfg(not(feature = "std"))]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue