[][src]Struct schnorrkel::vrf::VRFInOut

pub struct VRFInOut {
    pub input: RistrettoBoth,
    pub output: RistrettoBoth,
}

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]

impl Ord for VRFInOut[src]

impl PartialEq<VRFInOut> for VRFInOut[src]

impl PartialOrd<VRFInOut> for VRFInOut[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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]