]> git.ipfire.org Git - thirdparty/strongswan.git/blame - scripts/dh_speed.sh
nm: Move server port to options tab and position tabs to the left
[thirdparty/strongswan.git] / scripts / dh_speed.sh
CommitLineData
6edad5af
MW
1#!/bin/bash
2
b959532f
TB
3DIR=$(dirname `readlink -f $0`)
4
6edad5af
MW
5# we run an unprinted group, as it seems the first run is inaccurate (cache?)
6
b959532f
TB
7function modptest {
8 $DIR/dh_speed "$1" 400 modp768 modp768 modp1024 modp1024s160 modp1536 modp2048 modp2048s224 modp2048s256 | tail -n 7
9 $DIR/dh_speed "$1" 100 modp1024 modp3072 modp4096 | tail -n 2
10 $DIR/dh_speed "$1" 5 modp2048 modp6144 modp8192 | tail -n 2
11}
12
6edad5af 13echo "testing gmp"
b959532f
TB
14# gmp needs an RNG plugin, pick gcrypt
15modptest "gmp gcrypt"
16
17echo "testing curve25519"
18# curve25519 needs an RNG plugin, pick gcrypt
19$DIR/dh_speed "curve25519 gcrypt" 300 curve25519 curve25519 | tail -n 1
6edad5af
MW
20
21echo "testing gcrypt"
b959532f 22modptest "gcrypt"
6edad5af
MW
23
24echo "testing openssl"
b959532f
TB
25modptest "openssl"
26$DIR/dh_speed "openssl" 300 ecp192 ecp192 ecp224 ecp256 ecp384 ecp521 | tail -n 5
6edad5af 27
b959532f
TB
28echo "testing botan"
29modptest "botan"
30$DIR/dh_speed "botan" 300 ecp256 ecp256 ecp384 ecp521 | tail -n 3
31$DIR/dh_speed "botan" 300 curve25519 curve25519 | tail -n 1