added convenience scripts for pubkey/dh speed tests
[strongswan.git] / scripts / pubkey_speed.sh
1 #!/bin/bash
2
3 function rsatest {
4 echo -n " e=3 "; openssl genrsa -3 $1 2>/dev/null| sudo ./pubkey_speed "$2" rsa $3
5 echo -n " e=f4 "; openssl genrsa -f4 $1 2>/dev/null| sudo ./pubkey_speed "$2" rsa $3
6 }
7
8 function rsatestall {
9 echo "testing: $1"
10 rsatest 512 "$1" 5000
11 rsatest 1024 "$1" 1000
12 rsatest 1536 "$1" 500
13 rsatest 2048 "$1" 100
14 rsatest 3072 "$1" 10
15 rsatest 4096 "$1" 5
16 rsatest 6144 "$1" 2
17 rsatest 8192 "$1" 1
18 }
19
20 function ecdsatest {
21 openssl ecparam -genkey -name $1 -noout | sudo ./pubkey_speed "$2" ecdsa $3
22
23 }
24
25 function ecdsatestall {
26 echo "testing: $1"
27 ecdsatest prime256v1 "$1" 4000
28 ecdsatest secp384r1 "$1" 1000
29 ecdsatest secp521r1 "$1" 500
30 }
31
32 rsatestall "gmp gcrypt"
33 rsatestall "gcrypt"
34 rsatestall "openssl"
35 ecdsatestall "openssl"