Annotation of src/usr.bin/ssh/sntrup761.sh, Revision 1.2
1.1 djm 1: #!/bin/sh
1.2 ! tobhe 2: # $OpenBSD: sntrup761.sh,v 1.1 2020/12/29 00:59:15 djm Exp $
1.1 djm 3: # Placed in the Public Domain.
4: #
5: AUTHOR="supercop-20201130/crypto_kem/sntrup761/ref/implementors"
6: FILES="
7: supercop-20201130/crypto_kem/sntrup761/ref/uint64.h
8: supercop-20201130/crypto_kem/sntrup761/ref/uint16.h
9: supercop-20201130/crypto_kem/sntrup761/ref/uint32.h
10: supercop-20201130/crypto_kem/sntrup761/ref/int8.h
11: supercop-20201130/crypto_kem/sntrup761/ref/int16.h
12: supercop-20201130/crypto_kem/sntrup761/ref/int32.h
13: supercop-20201130/crypto_kem/sntrup761/ref/uint32.c
14: supercop-20201130/crypto_kem/sntrup761/ref/int32.c
15: supercop-20201130/crypto_kem/sntrup761/ref/paramsmenu.h
16: supercop-20201130/crypto_kem/sntrup761/ref/params.h
17: supercop-20201130/crypto_kem/sntrup761/ref/Decode.h
18: supercop-20201130/crypto_kem/sntrup761/ref/Decode.c
19: supercop-20201130/crypto_kem/sntrup761/ref/Encode.h
20: supercop-20201130/crypto_kem/sntrup761/ref/Encode.c
21: supercop-20201130/crypto_kem/sntrup761/ref/kem.c
22: "
23: SORT_I32="
24: supercop-20201130/crypto_sort/int32/portable4/sort.c
25: "
26: SORT_U32="supercop-20201130/crypto_sort/uint32/useint32/sort.c"
27: ###
28:
29: set -e
30: cd $1
31: echo -n '/* $'
32: echo 'OpenBSD: $ */'
33: echo
34: echo '/*'
35: echo ' * Public Domain, Authors:'
36: sed -e '/Alphabetical order:/d' -e 's/^/ * - /' < $AUTHOR
37: echo ' */'
38: echo
39: echo '#include <string.h>'
40: echo '#include "crypto_api.h"'
1.2 ! tobhe 41: echo '#include "int32_minmax.inc"'
1.1 djm 42: echo
43: echo '#define CRYPTO_NAMESPACE(s) s'
44: echo
45: for i in $SORT_I32; do
46: echo "/* from $i */"
47: grep \
48: -v '#include' $i | \
49: sed -e "s/void crypto_sort/static void crypto_sort_int32/g"
50: echo
51: done
52: echo "/* from $SORT_U32 */"
53: grep \
54: -v '#include' $SORT_U32 | \
55: sed -e "s/void crypto_sort/static void crypto_sort_uint32/g"
56: echo
57: for i in $FILES; do
58: echo "/* from $i */"
59: grep \
60: -v '#include' $i | \
61: sed -e "s/crypto_kem_/crypto_kem_sntrup761_/g" \
62: -e "s/^extern void /static void /" \
63: -e "s/^void /static void /"
64: echo
65: done