Annotation of src/usr.bin/ssh/sntrup4591761.sh, Revision 1.3
1.1 djm 1: #!/bin/sh
1.3 ! markus 2: # $OpenBSD: $
! 3: # Placed in the Public Domain.
! 4: #
! 5: AUTHOR="libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/implementors"
1.1 djm 6: FILES="
1.2 djm 7: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/int32_sort.h
8: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/int32_sort.c
9: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/small.h
10: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/mod3.h
11: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/modq.h
12: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/params.h
13: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/r3.h
14: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/rq.h
15: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/swap.h
16: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/dec.c
17: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/enc.c
18: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/keypair.c
19: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/r3_mult.c
20: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/r3_recip.c
21: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/randomsmall.c
22: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/randomweightw.c
23: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/rq.c
24: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/rq_mult.c
25: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/rq_recip3.c
26: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/rq_round3.c
27: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/rq_rounded.c
28: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/small.c
29: libpqcrypto-20180314/crypto_kem/sntrup4591761/ref/swap.c
1.1 djm 30: "
31: ###
32:
33: set -e
1.3 ! markus 34: cd $1
! 35: echo -n '/* $'
! 36: echo 'OpenBSD: $ */'
! 37: echo
! 38: echo '/*'
! 39: echo ' * Public Domain, Authors:'
! 40: sed -e '/Alphabetical order:/d' -e 's/^/ * - /' < $AUTHOR
! 41: echo ' */'
! 42: echo
1.1 djm 43: echo '#include <string.h>'
44: echo '#include "crypto_api.h"'
45: echo
46: for i in $FILES; do
47: echo "/* from $i */"
48: b=$(basename $i .c)
49: grep \
50: -v '#include' $i | \
51: grep -v "extern crypto_int32 small_random32" |
52: sed -e "s/crypto_kem_/crypto_kem_sntrup4591761_/g" \
53: -e "s/smaller_mask/smaller_mask_${b}/g" \
54: -e "s/^extern void /static void /" \
55: -e "s/^void /static void /"
56: echo
57: done