pub struct Bls12381ProofOfPossession { /* private fields */ }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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
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
§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
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.