mirror of https://github.com/dswd/vpncloud.git
Initializing crypto for benchmarks
This commit is contained in:
parent
23cbbda2b0
commit
f860d487e9
|
@ -15,6 +15,7 @@ use super::ip::Packet;
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
fn crypto_salsa20(b: &mut Bencher) {
|
fn crypto_salsa20(b: &mut Bencher) {
|
||||||
|
Crypto::init();
|
||||||
let mut crypto = Crypto::from_shared_key(CryptoMethod::ChaCha20, "test");
|
let mut crypto = Crypto::from_shared_key(CryptoMethod::ChaCha20, "test");
|
||||||
let mut payload = [0; 1500];
|
let mut payload = [0; 1500];
|
||||||
let header = [0; 8];
|
let header = [0; 8];
|
||||||
|
@ -28,6 +29,7 @@ fn crypto_salsa20(b: &mut Bencher) {
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
fn crypto_aes256(b: &mut Bencher) {
|
fn crypto_aes256(b: &mut Bencher) {
|
||||||
|
Crypto::init();
|
||||||
if !Crypto::aes256_available() {
|
if !Crypto::aes256_available() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue