message: Add Curve25519_2HashDH instance for VRF
diff: @@ -2,6 +2,7 @@ mod dleq;
  pub mod vrf;
  use crate::key::{AsymmetricKey, PublicKeyError, SecretKeyError};
  +use crate::vrf::{VerifiableRandomFunction, Verification};
  use rand::{CryptoRng, RngCore};
  /// VRF
  @@ -37,3 +38,29 @@ impl AsymmetricKey for Curve25519_2HashDH {
  vrf::PublicKey::from_bytes(data)
  }
  }
  +
  +impl VerifiableRandomFunction for Curve25519_2HashDH {
  + type VerifiedRandom = vrf::ProvenOutputSeed;
  + type Input = [u8];
  +
  + fn evaluate<T: RngCore + CryptoRng>(
  + secret: &Self::Secret,
  + input: &Self::Input,
  + mut rng: T,
  + ) -> Self::VerifiedRandom {
  + secret.evaluate_simple(&mut rng, input)
  + }
  +
  + fn verify(
  + public: &Self::Public,
  + input: &Self::Input,
  + vrand: &Self::VerifiedRandom,
  + ) -> Verification {
  + let v = vrand.verify(public, input);
  + if v {
  + Verification::Success
  + } else {
  + Verification::Failed
  + }
  + }
  +}
  