Rearrange the file tree.
[u/mdw/catacomb] / symm / aes-trans
CommitLineData
76105832 1#! /bin/sh
2
3prog=`echo $0 | sed 's:.*/::'`
4alg=${1?}; shift
5lc=`echo $alg | tr A-Z a-z`
6
7cat <<EOF
8# Test vectors for $alg
9#
10# Generated on `date +%Y-%m-%d` by $prog
11
12$lc {
13EOF
14
15awk "$@" '
16function mangle(x, y) {
17 if (!rev)
18 return x;
19 y = "";
20 while (length(x) > 1) {
21 y = y substr(x, length(x) - 1);
22 x = substr(x, 1, length(x) - 2);
23 }
24 return y;
25}
26
27BEGIN { FS = "="; }
28/^KEY=/ { key = mangle($2); }
29/^PT=/ { pt = mangle($2); }
30/^CT=/ {
31 ct = mangle($2);
32 printf(" %s\n %s\n %s;\n", key, pt, ct);
33}
34'
35echo }
36