Struct holochain::prelude::Nonce256Bits
source · pub struct Nonce256Bits(/* private fields */);
Expand description
256 Bit generic nonce.
Implementations§
source§impl Nonce256Bits
impl Nonce256Bits
pub fn into_inner(self) -> [u8; 32]
Trait Implementations§
source§impl AsRef<[u8]> for Nonce256Bits
impl AsRef<[u8]> for Nonce256Bits
source§impl Clone for Nonce256Bits
impl Clone for Nonce256Bits
source§fn clone(&self) -> Nonce256Bits
fn clone(&self) -> Nonce256Bits
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Nonce256Bits
impl Debug for Nonce256Bits
The only meaningful debug information for a cryptograhpic secret is the literal bytes. Also, encodings like base64 are not constant time so debugging could open some weird side channel issue trying to be ‘human friendly’. It seems better to never try to encode secrets.
Note that when using this crate with feature “subtle-encoding”, a hex representation will be used.
source§impl<'de> Deserialize<'de> for Nonce256Bits
impl<'de> Deserialize<'de> for Nonce256Bits
source§fn deserialize<D>(
deserializer: D
) -> Result<Nonce256Bits, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Nonce256Bits, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
source§impl From<[u8; 32]> for Nonce256Bits
impl From<[u8; 32]> for Nonce256Bits
Trivial new type derivation. Secrets should have private interiors and be constructed directly from fixed length arrays of known length.
source§impl PartialEq for Nonce256Bits
impl PartialEq for Nonce256Bits
Constant time equality check. This mitigates timing attacks where a remote agent can reverse engineer data by measuring tiny changes in latency associated with optimised equality checks. More matching bytes = more latency = vulnerability. This type of attack has been successfully demonstrated over a network despite varied latencies.
source§fn eq(&self, other: &Nonce256Bits) -> bool
fn eq(&self, other: &Nonce256Bits) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Nonce256Bits
impl Serialize for Nonce256Bits
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
source§impl TryFrom<&[u8]> for Nonce256Bits
impl TryFrom<&[u8]> for Nonce256Bits
§type Error = SecurePrimitiveError
type Error = SecurePrimitiveError
source§fn try_from(
slice: &[u8]
) -> Result<Nonce256Bits, <Nonce256Bits as TryFrom<&[u8]>>::Error>
fn try_from( slice: &[u8] ) -> Result<Nonce256Bits, <Nonce256Bits as TryFrom<&[u8]>>::Error>
source§impl TryFrom<Vec<u8>> for Nonce256Bits
impl TryFrom<Vec<u8>> for Nonce256Bits
§type Error = SecurePrimitiveError
type Error = SecurePrimitiveError
impl Copy for Nonce256Bits
impl Eq for Nonce256Bits
Auto Trait Implementations§
impl Freeze for Nonce256Bits
impl RefUnwindSafe for Nonce256Bits
impl Send for Nonce256Bits
impl Sync for Nonce256Bits
impl Unpin for Nonce256Bits
impl UnwindSafe for Nonce256Bits
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
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
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.source§impl<T> ToHex for T
impl<T> ToHex for T
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self
into the result. Upper case
letters are used (e.g. F9B4CA
)