1 # $OpenBSD: cipher-speed.sh,v 1.9 2013/05/17 04:29:14 dtucker Exp $
2 # Placed in the Public Domain.
8 sed -n -e '/transferred/s/.*secs (\(.* bytes.sec\).*/\1/p' \
9 -e '/copied/s/.*s, \(.* MB.s\).*/\1/p'
14 ciphers="aes128-cbc 3des-cbc blowfish-cbc cast128-cbc
15 arcfour128 arcfour256 arcfour
16 aes192-cbc aes256-cbc rijndael-cbc@lysator.liu.se
17 aes128-ctr aes192-ctr aes256-ctr"
18 config_defined OPENSSL_HAVE_EVPGCM && \
19 ciphers="$ciphers aes128-gcm@openssh.com aes256-gcm@openssh.com"
20 macs="hmac-sha1 hmac-md5 umac-64@openssh.com umac-128@openssh.com
21 hmac-sha1-96 hmac-md5-96"
22 config_defined HAVE_EVP_SHA256 && \
23 macs="$macs hmac-sha2-256 hmac-sha2-512"
25 for c in $ciphers; do n=0; for m in $macs; do
26 trace "proto 2 cipher $c mac $m"
28 printf "%-60s" "$c/$m:"
29 ( ${SSH} -o 'compression no' \
30 -F $OBJ/ssh_proxy -2 -m $m -c $c somehost \
31 exec sh -c \'"dd of=/dev/null obs=32k"\' \
32 < ${DATA} ) 2>&1 | getbytes
35 fail "ssh -2 failed with mac $m cipher $c"
38 # No point trying all MACs for GCM since they are ignored.
40 aes*-gcm@openssh.com) test $n -gt 0 && break;;
45 ciphers="3des blowfish"
47 trace "proto 1 cipher $c"
50 ( ${SSH} -o 'compression no' \
51 -F $OBJ/ssh_proxy -1 -c $c somehost \
52 exec sh -c \'"dd of=/dev/null obs=32k"\' \
53 < ${DATA} ) 2>&1 | getbytes
55 fail "ssh -1 failed with cipher $c"