added convenience scripts for pubkey/dh speed tests
This commit is contained in:
parent
a4caeac76e
commit
6edad5afdd
2 changed files with 56 additions and 0 deletions
21
scripts/dh_speed.sh
Executable file
21
scripts/dh_speed.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
# we run an unprinted group, as it seems the first run is inaccurate (cache?)
|
||||
|
||||
echo "testing gmp"
|
||||
# gmp needs a RNG plugin, pick gcrypt
|
||||
sudo ./dh_speed "gmp gcrypt" 400 modp768 modp768 modp1024 modp1536 modp2048 | tail -n 4
|
||||
sudo ./dh_speed "gmp gcrypt" 100 modp1024 modp3072 modp4096 | tail -n 2
|
||||
sudo ./dh_speed "gmp gcrypt" 5 modp2048 modp6144 modp8192 | tail -n 2
|
||||
|
||||
echo "testing gcrypt"
|
||||
sudo ./dh_speed "gcrypt" 400 modp768 modp768 modp1024 modp1536 modp2048 | tail -n 4
|
||||
sudo ./dh_speed "gcrypt" 100 modp1024 modp3072 modp4096 | tail -n 2
|
||||
sudo ./dh_speed "gcrypt" 5 modp2048 modp6144 modp8192 | tail -n 2
|
||||
|
||||
echo "testing openssl"
|
||||
sudo ./dh_speed "openssl" 400 modp768 modp768 modp1024 modp1536 modp2048 | tail -n 4
|
||||
sudo ./dh_speed "openssl" 100 modp1024 modp3072 modp4096 | tail -n 2
|
||||
sudo ./dh_speed "openssl" 5 modp2048 modp6144 modp8192 | tail -n 2
|
||||
sudo ./dh_speed "openssl" 300 ecp192 ecp192 ecp224 ecp256 ecp384 ecp256 | tail -n 5
|
||||
|
35
scripts/pubkey_speed.sh
Executable file
35
scripts/pubkey_speed.sh
Executable file
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash
|
||||
|
||||
function rsatest {
|
||||
echo -n " e=3 "; openssl genrsa -3 $1 2>/dev/null| sudo ./pubkey_speed "$2" rsa $3
|
||||
echo -n " e=f4 "; openssl genrsa -f4 $1 2>/dev/null| sudo ./pubkey_speed "$2" rsa $3
|
||||
}
|
||||
|
||||
function rsatestall {
|
||||
echo "testing: $1"
|
||||
rsatest 512 "$1" 5000
|
||||
rsatest 1024 "$1" 1000
|
||||
rsatest 1536 "$1" 500
|
||||
rsatest 2048 "$1" 100
|
||||
rsatest 3072 "$1" 10
|
||||
rsatest 4096 "$1" 5
|
||||
rsatest 6144 "$1" 2
|
||||
rsatest 8192 "$1" 1
|
||||
}
|
||||
|
||||
function ecdsatest {
|
||||
openssl ecparam -genkey -name $1 -noout | sudo ./pubkey_speed "$2" ecdsa $3
|
||||
|
||||
}
|
||||
|
||||
function ecdsatestall {
|
||||
echo "testing: $1"
|
||||
ecdsatest prime256v1 "$1" 4000
|
||||
ecdsatest secp384r1 "$1" 1000
|
||||
ecdsatest secp521r1 "$1" 500
|
||||
}
|
||||
|
||||
rsatestall "gmp gcrypt"
|
||||
rsatestall "gcrypt"
|
||||
rsatestall "openssl"
|
||||
ecdsatestall "openssl"
|
Loading…
Reference in a new issue