pub struct PrfEncoding(/* private fields */);Expand description
A stable semantic domain for encoding a protected PRF leaf.
The domain is framed alongside the context and protected bytes, preventing
values with identical byte representations but different meanings from
deriving the same block. Multiple Rust containers may deliberately share a
domain when they represent the same semantic value; all byte containers,
for example, use BYTES.
Implementations§
Source§impl PrfEncoding
impl PrfEncoding
pub const BYTES: Self
pub const UTF8: Self
pub const U8: Self
pub const U16: Self
pub const U32: Self
pub const U64: Self
pub const U128: Self
pub const I8: Self
pub const I16: Self
pub const I32: Self
pub const I64: Self
pub const I128: Self
Sourcepub const fn new(identifier: &'static str) -> Self
pub const fn new(identifier: &'static str) -> Self
Define an application-specific leaf encoding domain.
Identifiers form part of the cryptographic protocol. Use a stable,
globally namespaced, versioned value such as
com.example/customer-id/uuid-bytes/v1 and never reuse it for a
different encoding.
pub const fn as_str(self) -> &'static str
pub const fn as_bytes(self) -> &'static [u8] ⓘ
Trait Implementations§
Source§impl Clone for PrfEncoding
impl Clone for PrfEncoding
Source§fn clone(&self) -> PrfEncoding
fn clone(&self) -> PrfEncoding
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PrfEncoding
Source§impl Debug for PrfEncoding
impl Debug for PrfEncoding
impl Eq for PrfEncoding
Source§impl Hash for PrfEncoding
impl Hash for PrfEncoding
Source§impl PartialEq for PrfEncoding
impl PartialEq for PrfEncoding
impl StructuralPartialEq for PrfEncoding
Auto Trait Implementations§
impl Freeze for PrfEncoding
impl RefUnwindSafe for PrfEncoding
impl Send for PrfEncoding
impl Sync for PrfEncoding
impl Unpin for PrfEncoding
impl UnsafeUnpin for PrfEncoding
impl UnwindSafe for PrfEncoding
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