use autograph_protocol::{key_exchange, verify_key_exchange}; use criterion::{black_box, Criterion}; pub fn benchmark(c: &mut Criterion) { let our_identity_key_pair = vec![ 118, 164, 17, 240, 147, 79, 190, 38, 66, 93, 254, 238, 125, 202, 197, 2, 56, 252, 122, 177, 18, 187, 249, 208, 29, 149, 122, 103, 57, 199, 19, 17, 213, 153, 88, 124, 93, 136, 104, 111, 196, 208, 155, 156, 165, 31, 120, 186, 79, 205, 247, 175, 243, 184, 114, 80, 152, 243, 24, 225, 91, 220, 141, 150, ]; let their_identity_key = vec![ 177, 67, 45, 125, 158, 190, 181, 222, 101, 149, 224, 200, 223, 235, 222, 110, 67, 61, 200, 62, 29, 37, 150, 228, 137, 114, 143, 77, 115, 135, 143, 103, ]; let their_session_key = vec![ 88, 115, 171, 4, 34, 181, 120, 21, 10, 39, 204, 215, 158, 210, 177, 243, 28, 138, 52, 91, 236, 55, 30, 117, 10, 125, 87, 232, 80, 6, 232, 93, ]; let transcript = vec![ 35, 16, 23, 37, 205, 131, 166, 97, 13, 81, 136, 246, 193, 253, 139, 193, 230, 155, 222, 221, 37, 114, 190, 87, 104, 44, 210, 144, 127, 176, 198, 45, 88, 115, 171, 4, 34, 181, 120, 21, 10, 39, 204, 215, 158, 210, 177, 243, 28, 138, 52, 91, 236, 55, 30, 117, 10, 125, 87, 232, 80, 6, 232, 93, ]; let their_signature = vec![ 89, 193, 59, 76, 215, 36, 171, 145, 63, 32, 134, 60, 225, 112, 136, 191, 176, 64, 42, 18, 210, 2, 33, 212, 243, 245, 230, 147, 182, 20, 81, 101, 170, 221, 69, 164, 224, 166, 188, 170, 197, 114, 55, 218, 48, 218, 29, 56, 98, 91, 236, 12, 10, 64, 82, 140, 15, 76, 243, 188, 24, 236, 62, 5, ]; c.bench_function("key_exchange", |b| { b.iter(|| { let our_session_key_pair = vec![ 201, 142, 54, 248, 151, 150, 224, 79, 30, 126, 207, 157, 118, 85, 9, 212, 148, 156, 73, 176, 107, 107, 47, 111, 95, 98, 33, 192, 80, 223, 48, 221, 35, 16, 23, 37, 205, 131, 166, 97, 13, 81, 136, 246, 193, 253, 139, 193, 230, 155, 222, 221, 37, 114, 190, 87, 104, 44, 210, 144, 127, 176, 198, 45, ]; key_exchange( true, &our_identity_key_pair, black_box(&our_session_key_pair), &their_identity_key, &their_session_key, ) .unwrap() }) }); c.bench_function("verify_key_exchange", |b| { b.iter(|| { verify_key_exchange( &transcript, &our_identity_key_pair, &their_identity_key, &their_signature, ) .unwrap() }) }); }