Skip to main content

Ecvrf

Struct Ecvrf 

Source
pub struct Ecvrf;
Expand description

Classical ECVRF-edwards25519-SHA512-TAI (RFC 9381 ciphersuite 0x03), the default CONIKS VRF.

This is a thin adapter over metamorphic_crypto’s audited vrf primitive (which is itself built on the in-tree curve25519-dalek backend and locked to RFC 9381’s official test vectors). No cryptography lives here — only the opaque-byte ↔ primitive plumbing.

RFC 9381’s sibling suite ECVRF-edwards25519-SHA512-ELL2 (0x04, constant-time Elligator2 hash-to-curve) is a designed-in future addition: it lands when the released curve backend exposes a conformant hash-to-curve (curve25519-dalek 5.x). Because Vrf::suite_id is bound into CONIKS domain separation, adding it is purely additive and never invalidates a 0x03 proof. The two suites are interchangeable behind this trait; index privacy as observed by a verifier is identical.

Trait Implementations§

Source§

impl Clone for Ecvrf

Source§

fn clone(&self) -> Ecvrf

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Ecvrf

Source§

impl Debug for Ecvrf

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Ecvrf

Source§

fn default() -> Ecvrf

Returns the “default value” for a type. Read more
Source§

impl Vrf for Ecvrf

Source§

fn suite_id(&self) -> u8

A stable identifier for the construction. For RFC 9381 suites this is the ciphersuite octet (e.g. 0x03 for ECVRF-edwards25519-SHA512-TAI); a future composite/hybrid construction uses its own reserved identifier. It is mixed into CONIKS domain separation so proofs are bound to the exact VRF construction and cannot be reinterpreted under another.
Source§

fn generate_keypair(&self) -> (VrfSecretKey, VrfPublicKey)

Generate a fresh keypair from the OS CSPRNG, as (secret, public).
Source§

fn derive_public_key(&self, secret_key: &VrfSecretKey) -> Result<VrfPublicKey>

Derive the public key for a secret key. Read more
Source§

fn prove(&self, secret_key: &VrfSecretKey, alpha: &[u8]) -> Result<VrfProof>

Produce a proof pi that binds alpha to its VRF output under secret_key. Read more
Source§

fn verify( &self, public_key: &VrfPublicKey, alpha: &[u8], proof: &VrfProof, ) -> Result<Option<VrfOutput>>

Verify a proof and, on success, return the VRF output. Read more
Source§

fn proof_to_output(&self, proof: &VrfProof) -> Result<VrfOutput>

Recover the VRF output from a proof without verifying it. Only safe on a proof already verified with Vrf::verify (which returns the output directly) or whose provenance is independently trusted. Read more

Auto Trait Implementations§

§

impl Freeze for Ecvrf

§

impl RefUnwindSafe for Ecvrf

§

impl Send for Ecvrf

§

impl Sync for Ecvrf

§

impl Unpin for Ecvrf

§

impl UnsafeUnpin for Ecvrf

§

impl UnwindSafe for Ecvrf

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.