diff options
Diffstat (limited to 'vendor/hkdf/benches/mod.rs')
-rw-r--r-- | vendor/hkdf/benches/mod.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/vendor/hkdf/benches/mod.rs b/vendor/hkdf/benches/mod.rs new file mode 100644 index 0000000..4679b59 --- /dev/null +++ b/vendor/hkdf/benches/mod.rs @@ -0,0 +1,27 @@ +#![feature(test)] +extern crate test; + +use test::Bencher; + +type HkdfSha256 = hkdf::Hkdf<sha2::Sha256>; + +#[bench] +fn hkdf_sha256_10(b: &mut Bencher) { + let mut okm = vec![0u8; 10]; + b.iter(|| HkdfSha256::new(Some(&[]), &[]).expand(&[], &mut okm)); + b.bytes = okm.len() as u64; +} + +#[bench] +fn hkdf_sha256_1024(b: &mut Bencher) { + let mut okm = vec![0u8; 1024]; + b.iter(|| HkdfSha256::new(Some(&[]), &[]).expand(&[], &mut okm)); + b.bytes = okm.len() as u64; +} + +#[bench] +fn hkdf_sha256_8000(b: &mut Bencher) { + let mut okm = vec![0u8; 8000]; + b.iter(|| HkdfSha256::new(Some(&[]), &[]).expand(&[], &mut okm)); + b.bytes = okm.len() as u64; +} |