3 prog=`echo $0 | sed 's:.*/::'`
6 # Test vectors for SHA3
8 # Generated on `date +%Y-%m-%d` by $prog
15 SHA3_*) tail=${base#SHA3_}; alg=sha3 sep=- hex=-hex ;;
16 SHAKE*) tail=${base#SHAKE}; alg=shake sep= hex= ;;
17 *) echo >&2 "$0: bad filename \`$i'"; exit 2 ;;
20 *LongMsg.rsp) hack=kat; bits=${tail%LongMsg.rsp} ;;
21 *ShortMsg.rsp) hack=kat; bits=${tail%ShortMsg.rsp} ;;
22 *VariableOut.rsp) hack=kat; bits=${tail%VariableOut.rsp} ;;
23 *Monte.rsp) hack=mct; bits=${tail%Monte.rsp} ;;
24 *) echo >&2 "$0: bad filename \`$i'"; exit 2 ;;
29 echo "$alg$sep$bits$hex {"
31 BEGIN { FS = "[ \t\r]+"; len = 8; }
32 /^Len = / { len = $3; }
33 /^Msg = / { msg = tolower($3); if (!len) msg = "\"\""; }
36 if (len%8 == 0) printf(" %s\n %s;\n", msg, h);
42 echo "$alg$sep$bits-mct {"
44 BEGIN { FS = "[ \t\r]+"; }
47 if (prev != "") printf(" 1000\n %s\n %s;\n", prev, $3);
54 echo >&2 "$0: unsupported test kind $hack/$alg"; exit 2 ;;