Struct schnorrkel::vrf::VRFOutput
source · pub struct VRFOutput(pub [u8; 32]);
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§
source§impl 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§
source§impl Ord for VRFOutput
impl Ord for VRFOutput
source§impl PartialEq<VRFOutput> for VRFOutput
impl PartialEq<VRFOutput> for VRFOutput
source§impl PartialOrd<VRFOutput> for VRFOutput
impl PartialOrd<VRFOutput> for VRFOutput
1.0.0 · source§fn 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§
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