]> git.ipfire.org Git - people/ms/strongswan.git/blame_incremental - scripts/pubkey_speed.sh
Merge branch 'utils-split'
[people/ms/strongswan.git] / scripts / pubkey_speed.sh
... / ...
CommitLineData
1#!/bin/bash
2
3DIR=$(dirname `readlink -f $0`)
4
5function 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
10function 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
23function ecdsatest {
24 openssl ecparam -genkey -name $1 -noout | $DIR/pubkey_speed "$2" ecdsa $3
25
26}
27
28function ecdsatestall {
29 echo "testing: $1"
30 ecdsatest prime256v1 "$1" 4000
31 ecdsatest secp384r1 "$1" 1000
32 ecdsatest secp521r1 "$1" 500
33}
34
35rsatestall "gmp gcrypt pem pkcs1"
36rsatestall "gcrypt pem pkcs1"
37rsatestall "openssl pem"
38ecdsatestall "openssl pem"