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<'d> Deserialize<'d> for VRFOutput
impl<'d> Deserialize<'d> for VRFOutput
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'d>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'d>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Ord for VRFOutput
impl Ord for VRFOutput
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>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
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 more
impl 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more