pub struct PrivateSeed<P>where
P: Profile,{ /* private fields */ }Expand description
A caller-supplied 32-byte seed used to derive one WOTS private key.
The type is intentionally neither Copy nor Clone. It does not zeroize
memory on drop; callers needing that property must place it in a protected,
zeroizing container before constructing this value.
Implementations§
Source§impl<P> PrivateSeed<P>where
P: Profile,
impl<P> PrivateSeed<P>where
P: Profile,
Sourcepub const fn new(bytes: [u8; 32]) -> PrivateSeed<P>
pub const fn new(bytes: [u8; 32]) -> PrivateSeed<P>
Creates a profile-bound private seed.
Sourcepub fn from_slice(bytes: &[u8]) -> Result<PrivateSeed<P>, LengthError>
pub fn from_slice(bytes: &[u8]) -> Result<PrivateSeed<P>, LengthError>
Parses a private seed, rejecting every non-32-byte input.
§Errors
Returns LengthError unless bytes contains exactly 32 bytes.
Sourcepub const fn expose_secret(&self) -> &[u8; 32]
pub const fn expose_secret(&self) -> &[u8; 32]
Explicitly borrows the secret bytes for a cryptographic operation.
Sourcepub const fn into_secret(self) -> [u8; 32]
pub const fn into_secret(self) -> [u8; 32]
Explicitly returns the secret bytes.
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for PrivateSeed<P>
impl<P> RefUnwindSafe for PrivateSeed<P>
impl<P> Send for PrivateSeed<P>
impl<P> Sync for PrivateSeed<P>
impl<P> Unpin for PrivateSeed<P>
impl<P> UnsafeUnpin for PrivateSeed<P>
impl<P> UnwindSafe for PrivateSeed<P>
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