Struct fortresscrypto::MacTag
source · [−]Tuple Fields
0: [u8; 32]
Implementations
sourceimpl MacTag
impl MacTag
sourcepub fn from_slice(bs: &[u8]) -> Option<MacTag>
pub fn from_slice(bs: &[u8]) -> Option<MacTag>
from_slice()
creates an object from a byte slice
This function will fail and return None
if the length of
the byte-s;ice isn’t equal to the length of the object
pub fn from_rng<R: Rng + ?Sized>(rng: &mut R) -> MacTag
pub fn to_hex(&self) -> String
Trait Implementations
sourceimpl ConstantTimeEq for MacTag
impl ConstantTimeEq for MacTag
sourceimpl<'de> Deserialize<'de> for MacTag
impl<'de> Deserialize<'de> for MacTag
sourcefn deserialize<D>(deserializer: D) -> Result<MacTag, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<MacTag, D::Error>where
D: Deserializer<'de>,
sourceimpl Distribution<MacTag> for Standard
impl Distribution<MacTag> for Standard
sourcefn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> MacTag
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> MacTag
T
, using rng
as the source of randomness.sourceimpl Index<Range<usize>> for MacTag
impl Index<Range<usize>> for MacTag
Allows a user to access the byte contents of an object as a slice.
WARNING: it might be tempting to do comparisons on objects
by using x[a..b] == y[a..b]
. This will open up for timing attacks
when comparing for example authenticator tags. Because of this only
use the comparison functions exposed by the sodiumoxide API.
sourceimpl Index<RangeFrom<usize>> for MacTag
impl Index<RangeFrom<usize>> for MacTag
Allows a user to access the byte contents of an object as a slice.
WARNING: it might be tempting to do comparisons on objects
by using x[a..] == y[a..]
. This will open up for timing attacks
when comparing for example authenticator tags. Because of this only
use the comparison functions exposed by the sodiumoxide API.
sourceimpl Index<RangeFull> for MacTag
impl Index<RangeFull> for MacTag
Allows a user to access the byte contents of an object as a slice.
WARNING: it might be tempting to do comparisons on objects
by using x[] == y[]
. This will open up for timing attacks
when comparing for example authenticator tags. Because of this only
use the comparison functions exposed by the sodiumoxide API.
sourceimpl Index<RangeTo<usize>> for MacTag
impl Index<RangeTo<usize>> for MacTag
Allows a user to access the byte contents of an object as a slice.
WARNING: it might be tempting to do comparisons on objects
by using x[..b] == y[..b]
. This will open up for timing attacks
when comparing for example authenticator tags. Because of this only
use the comparison functions exposed by the sodiumoxide API.
sourceimpl Ord for MacTag
impl Ord for MacTag
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
sourceimpl PartialOrd<MacTag> for MacTag
impl PartialOrd<MacTag> for MacTag
sourcefn partial_cmp(&self, other: &MacTag) -> Option<Ordering>
fn partial_cmp(&self, other: &MacTag) -> Option<Ordering>
sourcefn le(&self, other: &MacTag) -> bool
fn le(&self, other: &MacTag) -> bool
self
and other
) and is used by the <=
operator. Read more