summaryrefslogtreecommitdiff
path: root/sntrup4591761.sh
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2019-01-21 10:20:12 +0000
committerDamien Miller <djm@mindrot.org>2019-01-21 22:07:02 +1100
commitdfd591618cdf2c96727ac0eb65f89cf54af0d97e (patch)
tree59700563da0dc6f1de649394ffb4c787710eda5a /sntrup4591761.sh
parentb1b2ff4ed559051d1035419f8f236275fa66d5d6 (diff)
upstream: Add support for a PQC KEX/KEM:
sntrup4591761x25519-sha512@tinyssh.org using the Streamlined NTRU Prime 4591^761 implementation from SUPERCOP coupled with X25519 as a stop-loss. Not enabled by default. introduce KEM API; a simplified framework for DH-ish KEX methods. from markus@ feedback & ok djm@ OpenBSD-Commit-ID: d687f76cffd3561dd73eb302d17a1c3bf321d1a7
Diffstat (limited to 'sntrup4591761.sh')
-rw-r--r--sntrup4591761.sh47
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
2FILES="
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
29set -e
30DIR=/data/git/mfriedl
31cd $DIR
32echo '#include <string.h>'
33echo '#include "crypto_api.h"'
34echo
35for 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
47done