Skip to content

Commit

Permalink
use RSA-2048
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmountaintop committed Aug 10, 2020
1 parent d58d270 commit 4847bd2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
24 changes: 12 additions & 12 deletions benches/vdf/class_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
extern crate criterion;

use class_group::primitives::vdf::VDF;
use class_group::ABDeltaTriple;
use criterion::Criterion;
use curv::BigInt;
use class_group::ABDeltaTriple;

fn benches_class(c: &mut Criterion) {
let bench_eval = |c: &mut Criterion, difficulty: &BigInt, a_b_delta: &ABDeltaTriple, seed: &BigInt| {
c.bench_function(&format!("eval with difficulty {}", difficulty), move |b| {
b.iter(|| VDF::eval(&a_b_delta, &seed, &difficulty))
});
};
let bench_verify =
|c: &mut Criterion, difficulty: &BigInt, vdf_out_proof: &VDF| {
c.bench_function(
&format!("verify with difficulty {}", difficulty),
move |b| b.iter(|| vdf_out_proof.verify()),
);
let bench_eval =
|c: &mut Criterion, difficulty: &BigInt, a_b_delta: &ABDeltaTriple, seed: &BigInt| {
c.bench_function(&format!("eval with difficulty {}", difficulty), move |b| {
b.iter(|| VDF::eval(&a_b_delta, &seed, &difficulty))
});
};
let bench_verify = |c: &mut Criterion, difficulty: &BigInt, vdf_out_proof: &VDF| {
c.bench_function(
&format!("verify with difficulty {}", difficulty),
move |b| b.iter(|| vdf_out_proof.verify()),
);
};

let sec = 1600;
const TEST_HASH: &str = "1eeb30c7163271850b6d018e8282093ac6755a771da6267edf6c9b4fce9242ba";
Expand Down
11 changes: 9 additions & 2 deletions benches/vdf/rsa_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,15 @@ fn benches_rsa(c: &mut Criterion) {
);
};

// (M13 prime)
const MODULUS: &str = "6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151"; // (M13 prime)
/// RSA-2048 modulus, taken from [Wikipedia](https://en.wikipedia.org/wiki/RSA_numbers#RSA-2048).
const MODULUS: &str =
"251959084756578934940271832400483985714292821262040320277771378360436620207075955562640185258807\
8440691829064124951508218929855914917618450280848912007284499268739280728777673597141834727026189\
6375014971824691165077613379859095700097330459748808428401797429100642458691817195118746121515172\
6546322822168699875491824224336372590851418654620435767984233871847744479207399342365848238242811\
9816381501067481045166037730605620161967625613384414360383390441495263443219011465754445417842402\
0924616515723350778707749817125772467962926386356373289912154831438167899885040445364023527381951\
378636564391212010397122822120720357";
let modulus = Integer::from_str_radix(MODULUS, 10).unwrap();

const TEST_HASH: &str = "1eeb30c7163271850b6d018e8282093ac6755a771da6267edf6c9b4fce9242ba";
Expand Down

0 comments on commit 4847bd2

Please sign in to comment.