Struct schnorrkel::vrf::VRFInOut [−][src]
VRF input and output paired together, possibly unverified.
Internally, we keep both RistrettoPoint
and CompressedRistretto
forms using RistrettoBoth
.
Fields
input: RistrettoBoth
VRF input point
output: RistrettoBoth
VRF output point
Implementations
impl VRFInOut
[src]
pub fn as_output_bytes(&self) -> &[u8; 32]
[src]
VRF output point bytes for serialization.
pub fn to_output(&self) -> VRFOutput
[src]
VRF output point bytes for serialization.
pub fn commit<T: SigningTranscript>(&self, t: &mut T)
[src]
Commit VRF input and output to a transcript.
We commit both the input and output to provide the 2Hash-DH construction from Theorem 2 on page 32 in appendix C of “Ouroboros Praos: An adaptively-secure, semi-synchronous proof-of-stake blockchain” by Bernardo David, Peter Gazi, Aggelos Kiayias, and Alexander Russell.
We use this construction both for the VRF usage methods
VRFInOut::make_*
as well as for signer side batching.
pub fn make_bytes<B: Default + AsMut<[u8]>>(&self, context: &[u8]) -> B
[src]
Raw bytes output from the VRF.
If you are not the signer then you must verify the VRF before calling this method.
If called with distinct contexts then outputs should be independent.
We incorporate both the input and output to provide the 2Hash-DH construction from Theorem 2 on page 32 in appendex C of “Ouroboros Praos: An adaptively-secure, semi-synchronous proof-of-stake blockchain” by Bernardo David, Peter Gazi, Aggelos Kiayias, and Alexander Russell.
pub fn make_rng<R: SeedableRng>(&self, context: &[u8]) -> R
[src]
VRF output converted into any SeedableRng
.
If you are not the signer then you must verify the VRF before calling this method.
We expect most users would prefer the less generic VRFInOut::make_chacharng
method.
pub fn make_merlin_rng(&self, context: &[u8]) -> TranscriptRng
[src]
VRF output converted into Merlin’s Keccek based Rng
.
If you are not the signer then you must verify the VRF before calling this method.
We think this might be marginally slower than ChaChaRng
when considerable output is required, but it should reduce
the final linked binary size slightly, and improves domain
separation.
Trait Implementations
impl Clone for VRFInOut
[src]
impl Debug for VRFInOut
[src]
impl Eq for VRFInOut
[src]
impl Hash for VRFInOut
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for VRFInOut
[src]
fn cmp(&self, other: &VRFInOut) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<VRFInOut> for VRFInOut
[src]
impl PartialOrd<VRFInOut> for VRFInOut
[src]
fn partial_cmp(&self, other: &VRFInOut) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for VRFInOut
[src]
impl StructuralPartialEq for VRFInOut
[src]
Auto Trait Implementations
impl RefUnwindSafe for VRFInOut
impl Send for VRFInOut
impl Sync for VRFInOut
impl Unpin for VRFInOut
impl UnwindSafe for VRFInOut
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,