genkat.sh 636 Bytes
Newer Older
lwc-tester committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
#!/bin/bash

SNEIK=`pwd`
WORKD=`mktemp -d`
echo "Work directory =" $WORKD
AEADMAIN=$SNEIK/common/nist/genkat_aead.c
HASHMAIN=$SNEIK/common/nist/genkat_hash.c
CFLAGS="-std=c99 -Wall -Wextra -Wshadow -fsanitize=address,undefined -O2"

for x in $SNEIK/crypto_aead/*
do
	y=`basename $x`
	cd $x/ref
	gcc $CFLAGS -I. -o $WORKD/test.$y *.c $AEADMAIN
	cd $WORKD
	./test.$y
	echo -n $y ": "
	sha256sum *.txt
	cp *.txt $x
	rm -f *
done

for x in $SNEIK/crypto_hash/*
do
	y=`basename $x`
	cd $x/ref
	gcc $CFLAGS -I. -o $WORKD/test.$y *.c $HASHMAIN
	cd $WORKD
	./test.$y
	echo -n $y ": "
	sha256sum *.txt
	cp *.txt $x
	rm -f *
done

rm -rf $WORKD