|
1 | 1 | use bouncycastle_core::key_material::{KeyMaterial0, KeyMaterial256, KeyMaterial512, KeyType}; |
2 | 2 | use bouncycastle_core::traits::{RNG, SecurityStrength}; |
3 | | -use bouncycastle_core_test_framework::DUMMY_SEED_512; |
| 3 | +use bouncycastle_core_test_framework::DUMMY_SEED; |
4 | 4 | use bouncycastle_rng::{HashDRBG_SHA256, HashDRBG_SHA512, Sp80090ADrbg}; |
5 | 5 | use criterion::{Criterion, Throughput, criterion_group, criterion_main}; |
6 | 6 | use std::hint::black_box; |
7 | 7 |
|
8 | 8 | fn bench_hash_drbg_sha256(c: &mut Criterion) { |
9 | 9 | let mut rng = HashDRBG_SHA256::new_unititialized(); |
10 | | - let seed = KeyMaterial256::from_bytes_as_type(&DUMMY_SEED_512[..32], KeyType::Seed).unwrap(); |
| 10 | + let seed = KeyMaterial256::from_bytes_as_type(&DUMMY_SEED[..32], KeyType::Seed).unwrap(); |
11 | 11 | rng.instantiate(false, seed, &KeyMaterial0::new(), &[], SecurityStrength::_128bit).unwrap(); |
12 | 12 | do_bench(c, &mut rng, "rng::hash_drbg80090a::HashDRBG_SHA256"); |
13 | 13 | } |
14 | 14 |
|
15 | 15 | fn bench_hash_drbg_sha512(c: &mut Criterion) { |
16 | 16 | let mut rng = HashDRBG_SHA512::new_unititialized(); |
17 | | - let seed = KeyMaterial512::from_bytes_as_type(&DUMMY_SEED_512[..64], KeyType::Seed).unwrap(); |
| 17 | + let seed = KeyMaterial512::from_bytes_as_type(&DUMMY_SEED[..64], KeyType::Seed).unwrap(); |
18 | 18 | rng.instantiate(false, seed, &KeyMaterial0::new(), &[], SecurityStrength::_256bit).unwrap(); |
19 | 19 | do_bench(c, &mut rng, "rng::hash_drbg80090a::HashDRBG_SHA512"); |
20 | 20 | } |
|
0 commit comments