pub struct Bls12381ProofOfPossession { /* private fields */ }Available on crate feature
bls only.Expand description
A BLS12-381 proof of possession.
A proof of possession (PoP) proves ownership of the private key corresponding
to a public key. This prevents rogue key attacks in aggregate signature schemes.
Implementations§
Source§impl Bls12381ProofOfPossession
impl Bls12381ProofOfPossession
Sourcepub fn from_bytes(bytes: &[u8]) -> AptosResult<Self>
pub fn from_bytes(bytes: &[u8]) -> AptosResult<Self>
Creates a proof of possession from compressed bytes (96 bytes).
§Errors
Returns an error if the bytes length is not 96 bytes or if the proof of possession deserialization fails.
Sourcepub fn from_hex(hex_str: &str) -> AptosResult<Self>
pub fn from_hex(hex_str: &str) -> AptosResult<Self>
Creates a proof of possession from a hex string.
§Errors
Returns an error if hex decoding fails or if the resulting bytes are invalid.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Returns the proof of possession as compressed bytes (96 bytes).
Sourcepub fn verify(&self, public_key: &Bls12381PublicKey) -> AptosResult<()>
pub fn verify(&self, public_key: &Bls12381PublicKey) -> AptosResult<()>
Verifies this proof of possession against a public key.
Returns Ok(()) if the PoP is valid, or an error if invalid.
§Errors
Returns an error if proof of possession verification fails.
Trait Implementations§
Source§impl Clone for Bls12381ProofOfPossession
impl Clone for Bls12381ProofOfPossession
Source§fn clone(&self) -> Bls12381ProofOfPossession
fn clone(&self) -> Bls12381ProofOfPossession
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 moreSource§impl Debug for Bls12381ProofOfPossession
impl Debug for Bls12381ProofOfPossession
Source§impl Display for Bls12381ProofOfPossession
impl Display for Bls12381ProofOfPossession
impl Eq for Bls12381ProofOfPossession
impl StructuralPartialEq for Bls12381ProofOfPossession
Auto Trait Implementations§
impl Freeze for Bls12381ProofOfPossession
impl RefUnwindSafe for Bls12381ProofOfPossession
impl Send for Bls12381ProofOfPossession
impl Sync for Bls12381ProofOfPossession
impl Unpin for Bls12381ProofOfPossession
impl UnsafeUnpin for Bls12381ProofOfPossession
impl UnwindSafe for Bls12381ProofOfPossession
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.