updated pubkey_speed test to use pem plugin
[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 768 "$1" 5000
12 rsatest 1024 "$1" 1000
13 rsatest 1536 "$1" 500
14 rsatest 2048 "$1" 100
15 rsatest 3072 "$1" 10
16 rsatest 4096 "$1" 5
17 rsatest 6144 "$1" 2
18 rsatest 8192 "$1" 1
19 }
20
21 function ecdsatest {
22 openssl ecparam -genkey -name $1 -noout | sudo ./pubkey_speed "$2" ecdsa $3
23
24 }
25
26 function ecdsatestall {
27 echo "testing: $1"
28 ecdsatest prime256v1 "$1" 4000
29 ecdsatest secp384r1 "$1" 1000
30 ecdsatest secp521r1 "$1" 500
31 }
32
33 rsatestall "gmp gcrypt pem"
34 rsatestall "gcrypt pem"
35 rsatestall "openssl"
36 ecdsatestall "openssl"