pub struct SessionKey(pub [u8; 32]);Expand description
A session key that is automatically zeroed when dropped. This prevents secrets from lingering in heap / stack memory after use.
Tuple Fields§
§0: [u8; 32]Implementations§
Source§impl SessionKey
impl SessionKey
Sourcepub fn ct_eq(&self, other: &SessionKey) -> bool
pub fn ct_eq(&self, other: &SessionKey) -> bool
Constant-time equality check — never branches on secret data.
Use this instead of == whenever comparing session keys to prevent
timing side-channel attacks.
Trait Implementations§
Source§impl Debug for SessionKey
impl Debug for SessionKey
Source§impl Drop for SessionKey
impl Drop for SessionKey
Auto Trait Implementations§
impl Freeze for SessionKey
impl RefUnwindSafe for SessionKey
impl Send for SessionKey
impl Sync for SessionKey
impl Unpin for SessionKey
impl UnsafeUnpin for SessionKey
impl UnwindSafe for SessionKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more