From 6f8e42ff653d5ff603bb9ff5a2921088924a3b5b Mon Sep 17 00:00:00 2001 From: Fathi Boudra Date: Thu, 5 Sep 2013 09:36:42 +0300 Subject: use qa/test-definitions structure Signed-off-by: Fathi Boudra --- openssl-bsaes.yaml | 24 ------------------- scripts/openssl-bsaes.sh | 51 ----------------------------------------- ubuntu/openssl-bsaes.yaml | 24 +++++++++++++++++++ ubuntu/scripts/openssl-bsaes.sh | 51 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 75 insertions(+), 75 deletions(-) delete mode 100644 openssl-bsaes.yaml delete mode 100755 scripts/openssl-bsaes.sh create mode 100644 ubuntu/openssl-bsaes.yaml create mode 100755 ubuntu/scripts/openssl-bsaes.sh diff --git a/openssl-bsaes.yaml b/openssl-bsaes.yaml deleted file mode 100644 index 7307a78..0000000 --- a/openssl-bsaes.yaml +++ /dev/null @@ -1,24 +0,0 @@ -metadata: - name: openssl-bsaes - format: "Lava-Test-Shell Test Definition 1.0" - description: "Test to verify correctness of the NEON bit sliced AES code in OpenSSL" - -install: - deps: - - bsdmainutils - -run: - steps: - - pwd - - find . -type f -name 'openssl-bsaes.sh' - - scripts/openssl-bsaes.sh 128 ctr - - scripts/openssl-bsaes.sh 192 ctr - - scripts/openssl-bsaes.sh 256 ctr - - scripts/openssl-bsaes.sh 128 cbc - - scripts/openssl-bsaes.sh 192 cbc - - scripts/openssl-bsaes.sh 256 cbc - - scripts/openssl-bsaes.sh 128 xts - - scripts/openssl-bsaes.sh 256 xts - -parse: - pattern: "(?P.*-*):\\s+(?P(pass|fail))" diff --git a/scripts/openssl-bsaes.sh b/scripts/openssl-bsaes.sh deleted file mode 100755 index b01224c..0000000 --- a/scripts/openssl-bsaes.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -## -## openssl-bsaes.sh - test the NEON bit sliced AES implementation -## in various sizes and modes -## -## 2013-07-09 Ard Biesheuvel -## - -set -u - -BITS=$1 -MODE=$2 - -exec 2> /dev/null - -KEY=$(dd if=/dev/urandom bs=32 count=1 | hexdump -ve '/1 "%02x"') -ALG=aes-$BITS-$MODE -NAME=neon-$ALG - -# ctr mode is essentially a stream cipher, so instead of using it for both -# encrypt and decrypt (which both call encrypt() under the hood), disable NEON -# for the decrypt case by setting OPENSSL_armcap to zero in the environment -if [ "$MODE" == "ctr" ] -then - ARMCAP="env OPENSSL_armcap=0" -fi - -TMP=/tmp/bsaestest-$$.md5sum - -export KEY -export ARMCAP - -for i in $(seq 100) -do - OUT=$(dd if=/dev/urandom bs=16k count=1 | - tee >(md5sum >$TMP) | - openssl enc -$ALG -pass env:KEY | - ${ARMCAP:-} openssl enc -d -$ALG -pass env:KEY | - md5sum) - - if [ "$OUT" != "$(cat $TMP)" ] - then - echo ${NAME}: fail - rm -f $TMP - exit 1 - fi -done - -rm -f $TMP -echo ${NAME}: pass diff --git a/ubuntu/openssl-bsaes.yaml b/ubuntu/openssl-bsaes.yaml new file mode 100644 index 0000000..7307a78 --- /dev/null +++ b/ubuntu/openssl-bsaes.yaml @@ -0,0 +1,24 @@ +metadata: + name: openssl-bsaes + format: "Lava-Test-Shell Test Definition 1.0" + description: "Test to verify correctness of the NEON bit sliced AES code in OpenSSL" + +install: + deps: + - bsdmainutils + +run: + steps: + - pwd + - find . -type f -name 'openssl-bsaes.sh' + - scripts/openssl-bsaes.sh 128 ctr + - scripts/openssl-bsaes.sh 192 ctr + - scripts/openssl-bsaes.sh 256 ctr + - scripts/openssl-bsaes.sh 128 cbc + - scripts/openssl-bsaes.sh 192 cbc + - scripts/openssl-bsaes.sh 256 cbc + - scripts/openssl-bsaes.sh 128 xts + - scripts/openssl-bsaes.sh 256 xts + +parse: + pattern: "(?P.*-*):\\s+(?P(pass|fail))" diff --git a/ubuntu/scripts/openssl-bsaes.sh b/ubuntu/scripts/openssl-bsaes.sh new file mode 100755 index 0000000..b01224c --- /dev/null +++ b/ubuntu/scripts/openssl-bsaes.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +## +## openssl-bsaes.sh - test the NEON bit sliced AES implementation +## in various sizes and modes +## +## 2013-07-09 Ard Biesheuvel +## + +set -u + +BITS=$1 +MODE=$2 + +exec 2> /dev/null + +KEY=$(dd if=/dev/urandom bs=32 count=1 | hexdump -ve '/1 "%02x"') +ALG=aes-$BITS-$MODE +NAME=neon-$ALG + +# ctr mode is essentially a stream cipher, so instead of using it for both +# encrypt and decrypt (which both call encrypt() under the hood), disable NEON +# for the decrypt case by setting OPENSSL_armcap to zero in the environment +if [ "$MODE" == "ctr" ] +then + ARMCAP="env OPENSSL_armcap=0" +fi + +TMP=/tmp/bsaestest-$$.md5sum + +export KEY +export ARMCAP + +for i in $(seq 100) +do + OUT=$(dd if=/dev/urandom bs=16k count=1 | + tee >(md5sum >$TMP) | + openssl enc -$ALG -pass env:KEY | + ${ARMCAP:-} openssl enc -d -$ALG -pass env:KEY | + md5sum) + + if [ "$OUT" != "$(cat $TMP)" ] + then + echo ${NAME}: fail + rm -f $TMP + exit 1 + fi +done + +rm -f $TMP +echo ${NAME}: pass -- cgit v1.2.3