Use Botan 2.9.0 for tests
[strongswan.git] / scripts / pubkey_speed.sh
1 #!/bin/bash
2
3 DIR=$(dirname `readlink -f $0`)
4
5 function rsatest {
6 echo -n " e=3 "; openssl genrsa -3 $1 2>/dev/null| $DIR/pubkey_speed "$2" rsa $3
7 echo -n " e=f4 "; openssl genrsa -f4 $1 2>/dev/null| $DIR/pubkey_speed "$2" rsa $3
8 }
9
10 function rsatestall {
11 echo "testing: $1"
12 rsatest 512 "$1" 5000
13 rsatest 768 "$1" 5000
14 rsatest 1024 "$1" 1000
15 rsatest 1536 "$1" 500
16 rsatest 2048 "$1" 100
17 rsatest 3072 "$1" 10
18 rsatest 4096 "$1" 5
19 rsatest 6144 "$1" 2
20 rsatest 8192 "$1" 1
21 }
22
23 function ecdsatest {
24 openssl ecparam -genkey -name $1 -noout | $DIR/pubkey_speed "$2" ecdsa $3
25
26 }
27
28 function ecdsatestall {
29 echo "testing: $1"
30 ecdsatest prime256v1 "$1" 4000
31 ecdsatest secp384r1 "$1" 1000
32 ecdsatest secp521r1 "$1" 500
33 }
34
35 rsatestall "gmp gcrypt pem pkcs1"
36 rsatestall "gcrypt pem pkcs1"
37 rsatestall "openssl pem"
38 rsatestall "botan pem"
39 ecdsatestall "openssl pem"
40 ecdsatestall "botan pem"