6 if expr "x`$PROG version`" : "xOpenSSL" > /dev/null; then
9 echo "$PROG is not OpenSSL executable"
13 echo "$PROG is not executable"
19 HASH=`cat $PROG | $PROG dgst -hex`
21 AES_ALGS=" aes-128-ctr aes-128-ecb aes-128-cbc aes-128-cfb aes-128-ofb \
22 aes-192-ctr aes-192-ecb aes-192-cbc aes-192-cfb aes-192-ofb \
23 aes-256-ctr aes-256-ecb aes-256-cbc aes-256-cfb aes-256-ofb"
24 BUFSIZE="16 32 48 64 80 96 128 144 999"
28 for alg in $AES_ALGS; do
30 for bufsize in $BUFSIZE; do
32 $PROG enc -e -k "$HASH" -$alg -bufsize $bufsize | \
33 env OPENSSL_ia32cap=~0x0200000000000000 $PROG enc -d -k "$HASH" -$alg | \
34 $PROG dgst -hex ) 2>/dev/null`
35 if [ "$TEST" != "$HASH" ]; then
36 echo "-$alg/$bufsize encrypt test failed"
40 for bufsize in $BUFSIZE; do
42 env OPENSSL_ia32cap=~0x0200000000000000 $PROG enc -e -k "$HASH" -$alg | \
43 $PROG enc -d -k "$HASH" -$alg -bufsize $bufsize | \
44 $PROG dgst -hex ) 2>/dev/null`
45 if [ "$TEST" != "$HASH" ]; then
46 echo "-$alg/$bufsize decrypt test failed"
51 $PROG enc -e -k "$HASH" -$alg | \
52 $PROG enc -d -k "$HASH" -$alg | \
53 $PROG dgst -hex ) 2>/dev/null`
54 if [ "$TEST" != "$HASH" ]; then
55 echo "-$alg en/decrypt test failed"
60 if [ $nerr -gt 0 ]; then
61 echo "AESNI engine test failed."
65 echo "AESNI engine is not available"