mod challenge;
pub mod ecvrf;
mod encode_to_curve;
pub mod error;
mod nonce;
mod utils;
#[cfg(test)]
mod tests;
pub struct VrfStruct<Curve, Hasher> {
pub curve: Curve,
pub hasher: Hasher,
pub suite_id: u8,
}
impl<C: Default, D: Default> VrfStruct<C, D> {
pub fn new(suite_id: u8) -> Self {
Self {
curve: C::default(),
hasher: D::default(),
suite_id,
}
}
}
pub type P256k1Sha256 = VrfStruct<p256::NistP256, sha2::Sha256>;
impl Default for P256k1Sha256 {
fn default() -> Self {
Self {
curve: Default::default(),
hasher: Default::default(),
suite_id: 0x01,
}
}
}
pub type Secp256k1Sha256 = VrfStruct<k256::Secp256k1, sha2::Sha256>;
impl Default for Secp256k1Sha256 {
fn default() -> Self {
Self {
curve: Default::default(),
hasher: Default::default(),
suite_id: 0xFE,
}
}
}