pub struct Challenge(/* private fields */);
Expand description
Contains the complete Proof-of-Relay challenge is a secp256k1 curve point.
This is the elliptic curve point corresponding to the Ticket
challenge.
Implementations§
Source§impl Challenge
impl Challenge
Sourcepub fn to_ethereum_challenge(&self) -> EthereumChallenge
pub fn to_ethereum_challenge(&self) -> EthereumChallenge
Converts the PoR challenge to an Ethereum challenge.
This is a one-way (lossy) operation, since the corresponding curve point is hashed with the hash value then truncated.
Source§impl Challenge
impl Challenge
Gets the PoR challenge by adding the two EC points represented by the half-key challenges.
Note that this is an expensive operation that involves point decompression of the
both HalfKeyChallenges
.
Gets the PoR challenge by converting the given HalfKey into a secp256k1 point and adding it with the given HalfKeyChallenge (which already represents a secp256k1 point).
Note that this is an expensive operation that involves point decompression of the
both HalfKeyChallenge
and scalar multiplication of the HalfKey
with the basepoint.
Trait Implementations§
impl Copy for Challenge
impl Eq for Challenge
Auto Trait Implementations§
impl Freeze for Challenge
impl RefUnwindSafe for Challenge
impl Send for Challenge
impl Sync for Challenge
impl Unpin for Challenge
impl UnwindSafe for Challenge
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
key
and return true
if they are equal.§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<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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more