mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-07-23 18:52:50 +02:00
* Noise XK work in progress. * A whole lot more Noise_XK work... exchange almost done. * Delete a bunch of commented out old Noise_IK code. * Add back in send() and a few other things to Noise_XK ZSSP. * Some p384 experiment in attic * A ton of ZSSP work, and put MPL on ZSSP. * updated kbkdf512 to use the modern nist standard * Parameterize KBKDF on resulting output key size the way NIST likes. * updated variable comment * Make the label a const parameter on kbkdf. * updated variable comment * Add MPL to utils and other stuff. * layout tweak * Some more ZSSP work and a VDF we may use. * warning removal * More ZSSP work, add benchmarks for mimcvdf. * Almost ready to test... * Build fix. * Add automatic retransmission in the earliest stages of session init. * Just about ready to test... wow. * It opens a session. * ZSSP basically works... --------- Co-authored-by: mamoniot <mamoniot@protonmail.com>
43 lines
1.2 KiB
Rust
43 lines
1.2 KiB
Rust
use criterion::{criterion_group, criterion_main, Criterion};
|
|
use std::time::Duration;
|
|
|
|
use zerotier_crypto::mimcvdf;
|
|
use zerotier_crypto::p384::*;
|
|
use zerotier_crypto::x25519::*;
|
|
|
|
pub fn criterion_benchmark(c: &mut Criterion) {
|
|
let mut group = c.benchmark_group("cryptography");
|
|
|
|
let mut input = 1;
|
|
let mut proof = 0;
|
|
group.bench_function("mimcvdf::delay(1000)", |b| {
|
|
b.iter(|| {
|
|
input += 1;
|
|
proof = mimcvdf::delay(input, 1000);
|
|
})
|
|
});
|
|
group.bench_function("mimcvdf::verify(1000)", |b| {
|
|
b.iter(|| {
|
|
assert!(mimcvdf::verify(proof, input, 1000));
|
|
})
|
|
});
|
|
|
|
let p384_a = P384KeyPair::generate();
|
|
let p384_b = P384KeyPair::generate();
|
|
|
|
let x25519_a = X25519KeyPair::generate();
|
|
let x25519_b = X25519KeyPair::generate();
|
|
let x25519_b_pub = x25519_b.public_bytes();
|
|
|
|
group.measurement_time(Duration::new(10, 0));
|
|
|
|
group.bench_function("ecdhp384", |b| {
|
|
b.iter(|| p384_a.agree(p384_b.public_key()).expect("ecdhp384 failed"))
|
|
});
|
|
group.bench_function("ecdhx25519", |b| b.iter(|| x25519_a.agree(&x25519_b_pub)));
|
|
|
|
group.finish();
|
|
}
|
|
|
|
criterion_group!(benches, criterion_benchmark);
|
|
criterion_main!(benches);
|