diff options
Diffstat (limited to 'sntrup4591761.sh')
-rw-r--r-- | sntrup4591761.sh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/sntrup4591761.sh b/sntrup4591761.sh new file mode 100644 index 000000000..5540ca4d9 --- /dev/null +++ b/sntrup4591761.sh | |||
@@ -0,0 +1,47 @@ | |||
1 | #!/bin/sh | ||
2 | FILES=" | ||
3 | supercop-20181216/crypto_sort/int32/portable3/int32_minmax.inc | ||
4 | supercop-20181216/crypto_sort/int32/portable3/sort.c | ||
5 | supercop-20181216/crypto_kem/sntrup4591761/ref/small.h | ||
6 | supercop-20181216/crypto_kem/sntrup4591761/ref/mod3.h | ||
7 | supercop-20181216/crypto_kem/sntrup4591761/ref/modq.h | ||
8 | supercop-20181216/crypto_kem/sntrup4591761/ref/params.h | ||
9 | supercop-20181216/crypto_kem/sntrup4591761/ref/r3.h | ||
10 | supercop-20181216/crypto_kem/sntrup4591761/ref/rq.h | ||
11 | supercop-20181216/crypto_kem/sntrup4591761/ref/swap.h | ||
12 | supercop-20181216/crypto_kem/sntrup4591761/ref/dec.c | ||
13 | supercop-20181216/crypto_kem/sntrup4591761/ref/enc.c | ||
14 | supercop-20181216/crypto_kem/sntrup4591761/ref/keypair.c | ||
15 | supercop-20181216/crypto_kem/sntrup4591761/ref/r3_mult.c | ||
16 | supercop-20181216/crypto_kem/sntrup4591761/ref/r3_recip.c | ||
17 | supercop-20181216/crypto_kem/sntrup4591761/ref/randomsmall.c | ||
18 | supercop-20181216/crypto_kem/sntrup4591761/ref/randomweightw.c | ||
19 | supercop-20181216/crypto_kem/sntrup4591761/ref/rq.c | ||
20 | supercop-20181216/crypto_kem/sntrup4591761/ref/rq_mult.c | ||
21 | supercop-20181216/crypto_kem/sntrup4591761/ref/rq_recip3.c | ||
22 | supercop-20181216/crypto_kem/sntrup4591761/ref/rq_round3.c | ||
23 | supercop-20181216/crypto_kem/sntrup4591761/ref/rq_rounded.c | ||
24 | supercop-20181216/crypto_kem/sntrup4591761/ref/small.c | ||
25 | supercop-20181216/crypto_kem/sntrup4591761/ref/swap.c | ||
26 | " | ||
27 | ### | ||
28 | |||
29 | set -e | ||
30 | DIR=/data/git/mfriedl | ||
31 | cd $DIR | ||
32 | echo '#include <string.h>' | ||
33 | echo '#include "crypto_api.h"' | ||
34 | echo | ||
35 | for i in $FILES; do | ||
36 | echo "/* from $i */" | ||
37 | b=$(basename $i .c) | ||
38 | grep \ | ||
39 | -v '#include' $i | \ | ||
40 | grep -v "extern crypto_int32 small_random32" | | ||
41 | sed -e "s/crypto_kem_/crypto_kem_sntrup4591761_/g" \ | ||
42 | -e "s/smaller_mask/smaller_mask_${b}/g" \ | ||
43 | -e "s/void crypto_sort/void crypto_sort_int32/" \ | ||
44 | -e "s/^extern void /static void /" \ | ||
45 | -e "s/^void /static void /" | ||
46 | echo | ||
47 | done | ||