Skip to content

Commit

Permalink
mastic: Align XOF computations with the spec (#1182)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjpatton authored Jan 3, 2025
1 parent 30d4302 commit 6a7a916
Show file tree
Hide file tree
Showing 4 changed files with 330 additions and 216 deletions.
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

0 comments on commit 6a7a916

Please sign in to comment.