pub struct SideChannelProtection {
pub timing_protection: bool,
pub power_analysis_protection: bool,
pub cache_attack_protection: bool,
pub fault_injection_protection: bool,
}Expand description
Side-channel protection configuration
Fields§
§timing_protection: boolEnable timing attack protection
power_analysis_protection: boolEnable power analysis protection
cache_attack_protection: boolEnable cache attack protection
fault_injection_protection: boolEnable fault injection protection
Implementations§
Source§impl SideChannelProtection
impl SideChannelProtection
Sourcepub fn permissive() -> Self
pub fn permissive() -> Self
Create a permissive side-channel protection configuration
Sourcepub fn secure_key_compare(&self, a: &[u8], b: &[u8]) -> bool
pub fn secure_key_compare(&self, a: &[u8], b: &[u8]) -> bool
Protected key comparison with timing attack resistance
Sourcepub fn secure_key_select(&self, choice: u8, a: &[u8], b: &[u8]) -> Vec<u8> ⓘ
pub fn secure_key_select(&self, choice: u8, a: &[u8], b: &[u8]) -> Vec<u8> ⓘ
Protected key selection with timing attack resistance
Sourcepub fn secure_memory_access<'a, T>(
&self,
data: &'a [T],
index: usize,
) -> Option<&'a T>
pub fn secure_memory_access<'a, T>( &self, data: &'a [T], index: usize, ) -> Option<&'a T>
Protected memory access with cache attack resistance
Sourcepub fn secure_memory_access_mut<'a, T>(
&self,
data: &'a mut [T],
index: usize,
) -> Option<&'a mut T>
pub fn secure_memory_access_mut<'a, T>( &self, data: &'a mut [T], index: usize, ) -> Option<&'a mut T>
Protected memory access with cache attack resistance (mutable)
Sourcepub fn secure_conditional_execute<F>(&self, condition: bool, func: F) -> bool
pub fn secure_conditional_execute<F>(&self, condition: bool, func: F) -> bool
Protected conditional execution with timing attack resistance
Sourcepub fn secure_conditional_execute_no_return<F>(&self, condition: bool, func: F)where
F: FnOnce(),
pub fn secure_conditional_execute_no_return<F>(&self, condition: bool, func: F)where
F: FnOnce(),
Protected conditional execution with timing attack resistance (no return value)
Sourcepub fn secure_loop<F>(&self, iterations: usize, func: F)
pub fn secure_loop<F>(&self, iterations: usize, func: F)
Protected loop with timing attack resistance
Sourcepub fn secure_array_access<'a, T>(
&self,
array: &'a [T],
index: usize,
) -> Option<&'a T>
pub fn secure_array_access<'a, T>( &self, array: &'a [T], index: usize, ) -> Option<&'a T>
Protected array access with bounds checking and timing attack resistance
Sourcepub fn secure_array_access_mut<'a, T>(
&self,
array: &'a mut [T],
index: usize,
) -> Option<&'a mut T>
pub fn secure_array_access_mut<'a, T>( &self, array: &'a mut [T], index: usize, ) -> Option<&'a mut T>
Protected array access with bounds checking and timing attack resistance (mutable)
Sourcepub fn secure_string_compare(&self, a: &str, b: &str) -> bool
pub fn secure_string_compare(&self, a: &str, b: &str) -> bool
Protected string comparison with timing attack resistance
Sourcepub fn secure_integer_compare(&self, a: u64, b: u64) -> bool
pub fn secure_integer_compare(&self, a: u64, b: u64) -> bool
Protected integer comparison with timing attack resistance
Sourcepub fn secure_integer_add(&self, a: u64, b: u64) -> u64
pub fn secure_integer_add(&self, a: u64, b: u64) -> u64
Protected integer addition with timing attack resistance
Sourcepub fn secure_integer_sub(&self, a: u64, b: u64) -> u64
pub fn secure_integer_sub(&self, a: u64, b: u64) -> u64
Protected integer subtraction with timing attack resistance
Sourcepub fn secure_integer_mul(&self, a: u64, b: u64) -> u64
pub fn secure_integer_mul(&self, a: u64, b: u64) -> u64
Protected integer multiplication with timing attack resistance
Sourcepub fn secure_integer_div(&self, a: u64, b: u64) -> u64
pub fn secure_integer_div(&self, a: u64, b: u64) -> u64
Protected integer division with timing attack resistance
Sourcepub fn secure_integer_mod(&self, a: u64, b: u64) -> u64
pub fn secure_integer_mod(&self, a: u64, b: u64) -> u64
Protected integer modulo with timing attack resistance
Sourcepub fn secure_bitwise_and(&self, a: u64, b: u64) -> u64
pub fn secure_bitwise_and(&self, a: u64, b: u64) -> u64
Protected bitwise AND with timing attack resistance
Sourcepub fn secure_bitwise_or(&self, a: u64, b: u64) -> u64
pub fn secure_bitwise_or(&self, a: u64, b: u64) -> u64
Protected bitwise OR with timing attack resistance
Sourcepub fn secure_bitwise_xor(&self, a: u64, b: u64) -> u64
pub fn secure_bitwise_xor(&self, a: u64, b: u64) -> u64
Protected bitwise XOR with timing attack resistance
Sourcepub fn secure_bitwise_not(&self, a: u64) -> u64
pub fn secure_bitwise_not(&self, a: u64) -> u64
Protected bitwise NOT with timing attack resistance
Sourcepub fn secure_left_shift(&self, a: u64, amount: u32) -> u64
pub fn secure_left_shift(&self, a: u64, amount: u32) -> u64
Protected left shift with timing attack resistance
Sourcepub fn secure_right_shift(&self, a: u64, amount: u32) -> u64
pub fn secure_right_shift(&self, a: u64, amount: u32) -> u64
Protected right shift with timing attack resistance
Sourcepub fn secure_rotate_left(&self, a: u64, amount: u32) -> u64
pub fn secure_rotate_left(&self, a: u64, amount: u32) -> u64
Protected rotate left with timing attack resistance
Sourcepub fn secure_rotate_right(&self, a: u64, amount: u32) -> u64
pub fn secure_rotate_right(&self, a: u64, amount: u32) -> u64
Protected rotate right with timing attack resistance
Sourcepub fn secure_conditional_assign<T: ConditionallySelectable>(
&self,
condition: bool,
value: &mut T,
new_value: T,
)
pub fn secure_conditional_assign<T: ConditionallySelectable>( &self, condition: bool, value: &mut T, new_value: T, )
Protected conditional assignment with timing attack resistance
Sourcepub fn secure_conditional_increment(&self, condition: bool, value: &mut u64)
pub fn secure_conditional_increment(&self, condition: bool, value: &mut u64)
Protected conditional increment with timing attack resistance
Sourcepub fn secure_conditional_decrement(&self, condition: bool, value: &mut u64)
pub fn secure_conditional_decrement(&self, condition: bool, value: &mut u64)
Protected conditional decrement with timing attack resistance
Sourcepub fn secure_conditional_add(
&self,
condition: bool,
value: &mut u64,
addend: u64,
)
pub fn secure_conditional_add( &self, condition: bool, value: &mut u64, addend: u64, )
Protected conditional add with timing attack resistance
Sourcepub fn secure_conditional_subtract(
&self,
condition: bool,
value: &mut u64,
subtrahend: u64,
)
pub fn secure_conditional_subtract( &self, condition: bool, value: &mut u64, subtrahend: u64, )
Protected conditional subtract with timing attack resistance
Sourcepub fn secure_conditional_multiply(
&self,
condition: bool,
value: &mut u64,
multiplier: u64,
)
pub fn secure_conditional_multiply( &self, condition: bool, value: &mut u64, multiplier: u64, )
Protected conditional multiply with timing attack resistance
Sourcepub fn secure_conditional_divide(
&self,
condition: bool,
value: &mut u64,
divisor: u64,
)
pub fn secure_conditional_divide( &self, condition: bool, value: &mut u64, divisor: u64, )
Protected conditional divide with timing attack resistance
Sourcepub fn secure_conditional_modulo(
&self,
condition: bool,
value: &mut u64,
divisor: u64,
)
pub fn secure_conditional_modulo( &self, condition: bool, value: &mut u64, divisor: u64, )
Protected conditional modulo with timing attack resistance
Sourcepub fn secure_conditional_bitwise_and(
&self,
condition: bool,
value: &mut u64,
mask: u64,
)
pub fn secure_conditional_bitwise_and( &self, condition: bool, value: &mut u64, mask: u64, )
Protected conditional bitwise AND with timing attack resistance
Sourcepub fn secure_conditional_bitwise_or(
&self,
condition: bool,
value: &mut u64,
mask: u64,
)
pub fn secure_conditional_bitwise_or( &self, condition: bool, value: &mut u64, mask: u64, )
Protected conditional bitwise OR with timing attack resistance
Sourcepub fn secure_conditional_bitwise_xor(
&self,
condition: bool,
value: &mut u64,
mask: u64,
)
pub fn secure_conditional_bitwise_xor( &self, condition: bool, value: &mut u64, mask: u64, )
Protected conditional bitwise XOR with timing attack resistance
Sourcepub fn secure_conditional_bitwise_not(&self, condition: bool, value: &mut u64)
pub fn secure_conditional_bitwise_not(&self, condition: bool, value: &mut u64)
Protected conditional bitwise NOT with timing attack resistance
Sourcepub fn secure_conditional_left_shift(
&self,
condition: bool,
value: &mut u64,
amount: u32,
)
pub fn secure_conditional_left_shift( &self, condition: bool, value: &mut u64, amount: u32, )
Protected conditional left shift with timing attack resistance
Sourcepub fn secure_conditional_right_shift(
&self,
condition: bool,
value: &mut u64,
amount: u32,
)
pub fn secure_conditional_right_shift( &self, condition: bool, value: &mut u64, amount: u32, )
Protected conditional right shift with timing attack resistance
Sourcepub fn secure_conditional_rotate_left(
&self,
condition: bool,
value: &mut u64,
amount: u32,
)
pub fn secure_conditional_rotate_left( &self, condition: bool, value: &mut u64, amount: u32, )
Protected conditional rotate left with timing attack resistance
Sourcepub fn secure_conditional_rotate_right(
&self,
condition: bool,
value: &mut u64,
amount: u32,
)
pub fn secure_conditional_rotate_right( &self, condition: bool, value: &mut u64, amount: u32, )
Protected conditional rotate right with timing attack resistance
Trait Implementations§
Source§impl Clone for SideChannelProtection
impl Clone for SideChannelProtection
Source§fn clone(&self) -> SideChannelProtection
fn clone(&self) -> SideChannelProtection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SideChannelProtection
impl Debug for SideChannelProtection
Source§impl Default for SideChannelProtection
impl Default for SideChannelProtection
Source§impl PartialEq for SideChannelProtection
impl PartialEq for SideChannelProtection
Source§fn eq(&self, other: &SideChannelProtection) -> bool
fn eq(&self, other: &SideChannelProtection) -> bool
self and other values to be equal, and is used by ==.