Struct schnorrkel::vrf::VRFOutput
source · Expand description
VRF output, possibly unverified.
Internally, we keep both RistrettoPoint
and CompressedRistretto
forms using RistrettoBoth
.
We’d actually love to statically distinguish here between inputs
and outputs, as well as whether outputs were verified, but doing
so would disrupt our general purpose DLEQ proof mechanism, so
users must be responcible for this themselves. We do however
consume by value in actual output methods, and do not implement
Copy
, as a reminder that VRF outputs should only be used once
and should be checked before usage.
Tuple Fields
0: [u8; 32]
Implementations
sourceimpl VRFOutput
impl VRFOutput
sourcepub fn from_bytes(bytes: &[u8]) -> SignatureResult<VRFOutput>
pub fn from_bytes(bytes: &[u8]) -> SignatureResult<VRFOutput>
Construct a VRFOutput
from a slice of bytes.
sourcepub fn attach_input_hash<T>(
&self,
public: &PublicKey,
t: T
) -> SignatureResult<VRFInOut>where
T: VRFSigningTranscript,
pub fn attach_input_hash<T>(
&self,
public: &PublicKey,
t: T
) -> SignatureResult<VRFInOut>where
T: VRFSigningTranscript,
Pair a non-malleable VRF output with the hash of the given transcript.
Trait Implementations
sourceimpl Ord for VRFOutput
impl Ord for VRFOutput
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<VRFOutput> for VRFOutput
impl PartialOrd<VRFOutput> for VRFOutput
sourcefn partial_cmp(&self, other: &VRFOutput) -> Option<Ordering>
fn partial_cmp(&self, other: &VRFOutput) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for VRFOutput
impl Eq for VRFOutput
impl StructuralEq for VRFOutput
impl StructuralPartialEq for VRFOutput
Auto Trait Implementations
impl RefUnwindSafe for VRFOutput
impl Send for VRFOutput
impl Sync for VRFOutput
impl Unpin for VRFOutput
impl UnwindSafe for VRFOutput
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more