1mod challenge;
2pub mod ecvrf;
3mod encode_to_curve;
4pub mod error;
5mod nonce;
6mod utils;
7
8#[cfg(test)]
9mod tests;
10
11pub struct VrfStruct<Curve, Hasher> {
12 pub curve: Curve,
14 pub hasher: Hasher,
16 pub suite_id: u8,
18}
19
20impl<C: Default, D: Default> VrfStruct<C, D> {
21 pub fn new(suite_id: u8) -> Self {
22 Self {
23 curve: C::default(),
24 hasher: D::default(),
25 suite_id,
26 }
27 }
28}
29
30pub type P256k1Sha256 = VrfStruct<p256::NistP256, sha2::Sha256>;
31impl Default for P256k1Sha256 {
32 fn default() -> Self {
33 Self {
34 curve: Default::default(),
35 hasher: Default::default(),
36 suite_id: 0x01,
37 }
38 }
39}
40
41pub type Secp256k1Sha256 = VrfStruct<k256::Secp256k1, sha2::Sha256>;
42impl Default for Secp256k1Sha256 {
43 fn default() -> Self {
44 Self {
45 curve: Default::default(),
46 hasher: Default::default(),
47 suite_id: 0xFE,
48 }
49 }
50}