From c71f472743de83d19bbbe170569628ab493cf3ac Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 15 Feb 2026 03:20:54 +0800 Subject: [PATCH] fix in-line directive on hardened bool this prevents there being a single "hot spot" to attack for hardened bool testing --- libs/bao1x-api/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/bao1x-api/src/lib.rs b/libs/bao1x-api/src/lib.rs index 9efda4583..55b1f573b 100644 --- a/libs/bao1x-api/src/lib.rs +++ b/libs/bao1x-api/src/lib.rs @@ -224,7 +224,7 @@ impl HardenedBool { const TRUE_VALUE: u32 = 0x5A5A_A5A5; /// Check if true - returns None if value is corrupted - #[inline(never)] + #[inline(always)] pub fn is_true(self) -> Option { match self.0 { Self::TRUE_VALUE => Some(true), @@ -234,7 +234,7 @@ impl HardenedBool { } /// Constant-time equality check against TRUE - #[inline(never)] + #[inline(always)] pub fn check_true(self) -> bool { // Use volatile to prevent optimizer from simplifying let val = unsafe { core::ptr::read_volatile(&self.0) };