Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mastic: Align XOF computations with the spec #1182

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions benches/speed_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,10 +859,12 @@ fn vidpf(c: &mut Criterion) {
let input = VidpfInput::from_bools(&bits);
let weight = VidpfWeight::from(vec![Field255::one(), Field255::one()]);

let vidpf = Vidpf::<VidpfWeight<Field255>>::new(2);
let vidpf = Vidpf::<VidpfWeight<Field255>>::new(bits.len(), 2).unwrap();

b.iter(|| {
let _ = vidpf.gen(&input, &weight, NONCE).unwrap();
let _ = vidpf
.gen(b"some application", &input, &weight, NONCE)
.unwrap();
});
});
}
Expand All @@ -875,13 +877,22 @@ fn vidpf(c: &mut Criterion) {
let bits = iter::repeat_with(random).take(size).collect::<Vec<bool>>();
let input = VidpfInput::from_bools(&bits);
let weight = VidpfWeight::from(vec![Field255::one(), Field255::one()]);
let vidpf = Vidpf::<VidpfWeight<Field255>>::new(2);
let vidpf = Vidpf::<VidpfWeight<Field255>>::new(bits.len(), 2).unwrap();

let (public, keys) = vidpf.gen(&input, &weight, NONCE).unwrap();
let (public, keys) = vidpf
.gen(b"some application", &input, &weight, NONCE)
.unwrap();

b.iter(|| {
let _ = vidpf
.eval(VidpfServerId::S0, &keys[0], &public, &input, NONCE)
.eval(
b"some application",
VidpfServerId::S0,
&keys[0],
&public,
&input,
NONCE,
)
.unwrap();
});
});
Expand Down
Loading
Loading