Skip to content

Commit 5006104

Browse files
committed
initial vrf crate structure
1 parent 204a4e0 commit 5006104

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ members = [
1313
"signature_derive",
1414
"universal-hash",
1515
"signature",
16+
"vrf",
1617
]
1718

1819
[patch.crates-io]

vrf/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "vrf"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[dependencies]
7+
digest = "=0.11.0-pre.10"

vrf/src/lib.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use digest::{Output, OutputSizeUser};
2+
3+
pub trait Proof<H>
4+
where
5+
H: OutputSizeUser,
6+
{
7+
fn to_hash(&self) -> Output<H>;
8+
}
9+
10+
pub trait Prover<H>
11+
where
12+
H: OutputSizeUser,
13+
{
14+
type Proof: Proof<H>;
15+
16+
fn prove(&self, alpha: &[u8]) -> Self::Proof;
17+
}
18+
19+
pub trait Verifier<H>
20+
where
21+
H: OutputSizeUser,
22+
{
23+
type Proof: Proof<H>;
24+
25+
fn verify(&self, alpha: &[u8], proof: Self::Proof) -> bool;
26+
}

0 commit comments

Comments
 (0)