Struct PublicKey
pub struct PublicKey<P>where
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§
§impl<P> PublicKey<P>where
P: Profile,
impl<P> PublicKey<P>where
P: Profile,
pub const fn new(
public_seed: [u8; 32],
public_key_hash: [u8; 32],
) -> PublicKey<P>
pub const fn new( public_seed: [u8; 32], public_key_hash: [u8; 32], ) -> PublicKey<P>
Constructs a public key from its two protocol fields.
pub fn from_slice(bytes: &[u8]) -> Result<PublicKey<P>, LengthError>
pub fn from_slice(bytes: &[u8]) -> Result<PublicKey<P>, LengthError>
Parses the exact 64-byte upstream public-key encoding.
§Errors
Returns LengthError unless bytes contains exactly 64 bytes.
pub 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.
pub 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 for PublicKey<P>
impl<P> Eq for PublicKey<P>
impl<P> StructuralPartialEq for PublicKey<P>where
P: Profile,
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