Update Benchmarks to const generics
This commit is contained in:
parent
e26981e6af
commit
a9f10651cc
|
@ -6,7 +6,7 @@ fn benchmark_generate_tag(c: &mut Criterion) {
|
||||||
let mut group = c.benchmark_group("generate_tags");
|
let mut group = c.benchmark_group("generate_tags");
|
||||||
group.measurement_time(Duration::new(10, 0));
|
group.measurement_time(Duration::new(10, 0));
|
||||||
group.sample_size(1000);
|
group.sample_size(1000);
|
||||||
let secret_key = FuzzySecretKey::generate(24);
|
let secret_key = FuzzySecretKey::<24>::generate();
|
||||||
for p in [5, 10, 15].iter() {
|
for p in [5, 10, 15].iter() {
|
||||||
let public_key = secret_key.public_key();
|
let public_key = secret_key.public_key();
|
||||||
group.bench_with_input(BenchmarkId::from_parameter(p), p, |b, _gamma| b.iter(|| public_key.generate_tag()));
|
group.bench_with_input(BenchmarkId::from_parameter(p), p, |b, _gamma| b.iter(|| public_key.generate_tag()));
|
||||||
|
@ -17,7 +17,7 @@ fn benchmark_test_tag(c: &mut Criterion) {
|
||||||
let mut group = c.benchmark_group("test_tags");
|
let mut group = c.benchmark_group("test_tags");
|
||||||
group.measurement_time(Duration::new(10, 0));
|
group.measurement_time(Duration::new(10, 0));
|
||||||
group.sample_size(1000);
|
group.sample_size(1000);
|
||||||
let secret_key = FuzzySecretKey::generate(24);
|
let secret_key = FuzzySecretKey::<24>::generate();
|
||||||
|
|
||||||
for p in [5, 10, 15].iter() {
|
for p in [5, 10, 15].iter() {
|
||||||
let tag = secret_key.public_key().generate_tag();
|
let tag = secret_key.public_key().generate_tag();
|
||||||
|
|
|
@ -244,8 +244,6 @@ impl<const GAMMA: u8> FuzzySecretKey<{ GAMMA }> {
|
||||||
let mut input = vec![];
|
let mut input = vec![];
|
||||||
input.push(GAMMA);
|
input.push(GAMMA);
|
||||||
input.extend_from_slice(points.to_bytes().as_slice());
|
input.extend_from_slice(points.to_bytes().as_slice());
|
||||||
// enforce separation between ciphertext and u
|
|
||||||
input.extend_from_slice("|| u: ".as_bytes());
|
|
||||||
input.extend_from_slice(u.compress().as_bytes());
|
input.extend_from_slice(u.compress().as_bytes());
|
||||||
Scalar::hash_from_bytes::<Sha3_512>(input.as_slice())
|
Scalar::hash_from_bytes::<Sha3_512>(input.as_slice())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue