Annotation of src/usr.bin/ssh/sntrup761.sh, Revision 1.1
1.1 ! djm 1: #!/bin/sh
! 2: # $OpenBSD$
! 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/int32_minmax.inc
! 25: supercop-20201130/crypto_sort/int32/portable4/sort.c
! 26: "
! 27: SORT_U32="supercop-20201130/crypto_sort/uint32/useint32/sort.c"
! 28: ###
! 29:
! 30: set -e
! 31: cd $1
! 32: echo -n '/* $'
! 33: echo 'OpenBSD: $ */'
! 34: echo
! 35: echo '/*'
! 36: echo ' * Public Domain, Authors:'
! 37: sed -e '/Alphabetical order:/d' -e 's/^/ * - /' < $AUTHOR
! 38: echo ' */'
! 39: echo
! 40: echo '#include <string.h>'
! 41: echo '#include "crypto_api.h"'
! 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