pub trait VRFKeyPair<const OUTPUT_SIZE: usize> {
type Proof: VRFProof<OUTPUT_SIZE, PublicKey = Self::PublicKey>;
type PrivateKey: VRFPrivateKey<PublicKey = Self::PublicKey>;
type PublicKey: VRFPublicKey<PrivateKey = Self::PrivateKey>;
// Required methods
fn generate<R: AllowedRng>(rng: &mut R) -> Self;
fn prove(&self, input: &[u8]) -> Self::Proof;
// Provided method
fn output(&self, input: &[u8]) -> ([u8; OUTPUT_SIZE], Self::Proof) { ... }
}Expand description
A keypair for a verifiable random function (VRF).
Required Associated Types§
type Proof: VRFProof<OUTPUT_SIZE, PublicKey = Self::PublicKey>
type PrivateKey: VRFPrivateKey<PublicKey = Self::PublicKey>
type PublicKey: VRFPublicKey<PrivateKey = Self::PrivateKey>
Required Methods§
Sourcefn generate<R: AllowedRng>(rng: &mut R) -> Self
fn generate<R: AllowedRng>(rng: &mut R) -> Self
Generate a new keypair using the given RNG.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.