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

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

VRF output point bytes for serialization.

VRF output point bytes for serialization.

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.

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.

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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.