pub struct Tag(pub [u8; 16]);Expand description
Authentication Tag for the detached encryption mode
In the combined mode, the tag occupies the first MACBYTES bytes of the ciphertext.
Tuple Fields§
§0: [u8; 16]Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tag
impl<'de> Deserialize<'de> for Tag
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Tag, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Tag, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Index<Range<usize>> for Tag
Allows a user to access the byte contents of an object as a slice.
impl Index<Range<usize>> for Tag
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.
Source§impl Index<RangeFrom<usize>> for Tag
Allows a user to access the byte contents of an object as a slice.
impl Index<RangeFrom<usize>> for Tag
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.
Source§impl Index<RangeFull> for Tag
Allows a user to access the byte contents of an object as a slice.
impl Index<RangeFull> for Tag
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.
Source§impl Index<RangeTo<usize>> for Tag
Allows a user to access the byte contents of an object as a slice.
impl Index<RangeTo<usize>> for Tag
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.