pub struct PublicKey<P: Profile> { /* private fields */ }Expand description
A HashSigsRS public key bound to cryptographic profile P.
Its byte encoding is the 32-byte public seed followed by the 32-byte hash of all 67 WOTS chain endpoints.
Implementations§
Source§impl<P: Profile> PublicKey<P>
impl<P: Profile> PublicKey<P>
Sourcepub const fn new(public_seed: [u8; 32], public_key_hash: [u8; 32]) -> Self
pub const fn new(public_seed: [u8; 32], public_key_hash: [u8; 32]) -> Self
Constructs a public key from its two protocol fields.
Sourcepub fn from_slice(bytes: &[u8]) -> Result<Self, LengthError>
pub fn from_slice(bytes: &[u8]) -> Result<Self, LengthError>
Parses the exact 64-byte upstream public-key encoding.
§Errors
Returns LengthError unless bytes contains exactly 64 bytes.
Sourcepub const fn public_seed(&self) -> &[u8; 32]
pub const fn public_seed(&self) -> &[u8; 32]
Returns the public seed used to derive all chain masks.
Sourcepub const fn public_key_hash(&self) -> &[u8; 32]
pub const fn public_key_hash(&self) -> &[u8; 32]
Returns the hash of the concatenated 67 chain endpoints.
Trait Implementations§
impl<P: Copy + Profile> Copy for PublicKey<P>
impl<P: Eq + Profile> Eq for PublicKey<P>
impl<P: Profile> StructuralPartialEq for PublicKey<P>
Auto Trait Implementations§
impl<P> Freeze for PublicKey<P>
impl<P> RefUnwindSafe for PublicKey<P>
impl<P> Send for PublicKey<P>
impl<P> Sync for PublicKey<P>
impl<P> Unpin for PublicKey<P>
impl<P> UnsafeUnpin for PublicKey<P>
impl<P> UnwindSafe for PublicKey<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