pub struct Mac(/* private fields */);Expand description
A computed file MAC: 128 uppercase hex characters.
The inner string is private and PartialEq routes through
subtle::ConstantTimeEq, so there is no non-constant-time way to compare two
of these. Upstream uses Go’s !=; the verdict is identical and the timing
channel is gone — a strict improvement that costs nothing at the wire.
Implementations§
Source§impl Mac
impl Mac
Sourcepub fn as_hex(&self) -> &str
pub fn as_hex(&self) -> &str
The uppercase-hex rendering, for writing into the file.
A MAC is not a secret — it ships in the file, encrypted only to bind it to
the data key — so exposing the string is fine. Comparing it as a plain
string is what is prevented, and that is done by making PartialEq the
only comparison available.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mac
impl RefUnwindSafe for Mac
impl Send for Mac
impl Sync for Mac
impl Unpin for Mac
impl UnsafeUnpin for Mac
impl UnwindSafe for Mac
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