summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootstrap.conf2
-rwxr-xr-xdevel/import-ecc-from-nettle.sh (renamed from devel/import-curve448-from-nettle.sh)28
-rw-r--r--lib/nettle/Makefile.am68
-rw-r--r--lib/nettle/pk.c4
4 files changed, 51 insertions, 51 deletions
diff --git a/bootstrap.conf b/bootstrap.conf
index a2e9ae661d..9a5b3639b0 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -102,6 +102,6 @@ bootstrap_post_import_hook ()
# Automake requires that ChangeLog exist.
touch ChangeLog || return 1
- devel/import-curve448-from-nettle.sh
+ devel/import-ecc-from-nettle.sh
devel/import-chacha-from-nettle.sh
}
diff --git a/devel/import-curve448-from-nettle.sh b/devel/import-ecc-from-nettle.sh
index 8b04f13653..1fe93005e7 100755
--- a/devel/import-curve448-from-nettle.sh
+++ b/devel/import-ecc-from-nettle.sh
@@ -7,7 +7,7 @@ set +e
: ${srcdir=.}
SRC=$srcdir/devel/nettle
-DST=$srcdir/lib/nettle/curve448
+DST=$srcdir/lib/nettle/ecc
IMPORTS="
cnd-copy.c
@@ -114,16 +114,16 @@ for f in $IMPORTS; do
# Rename header guard so as not to conflict with the public ones.
if grep '^#ifndef NETTLE_.*_H\(_INCLUDED\)*' $dst 2>&1 >/dev/null; then
g=$(sed -n 's/^#ifndef NETTLE_\(.*_H\(_INCLUDED\)*\)/\1/p' $dst)
- sed 's/\(NETTLE_'$g'\)/GNUTLS_LIB_NETTLE_CURVE448_\1/' $dst > $dst-t && \
+ sed 's/\(NETTLE_'$g'\)/GNUTLS_LIB_NETTLE_ECC_\1/' $dst > $dst-t && \
mv $dst-t $dst
fi
# Add prefix to function symbols avoid clashing with the public ones.
- sed -e 's/^#define \(.*\) nettle_\1/#define \1 gnutls_nettle_curve448_\1/' \
- -e 's/^#define \(.*\) _nettle_\1/#define \1 _gnutls_nettle_curve448_\1/' \
- -e 's/^#define _\(.*\) _nettle_\1/#define _\1 _gnutls_nettle_curve448_\1/' \
- -e 's/^_nettle_\(.*\)(.*/#define _nettle_\1 _gnutls_nettle_curve448_\1\n\0/' \
- -e 's/^extern const struct ecc_curve _nettle_\(.*\);/#define _nettle_\1 _gnutls_nettle_curve448_\1\n\0/' \
- -e 's/^extern const struct ecc_eddsa _nettle_\(.*\);/#define _nettle_\1 _gnutls_nettle_curve448_\1\n\0/' \
+ sed -e 's/^#define \(.*\) nettle_\1/#define \1 gnutls_nettle_ecc_\1/' \
+ -e 's/^#define \(.*\) _nettle_\1/#define \1 _gnutls_nettle_ecc_\1/' \
+ -e 's/^#define _\(.*\) _nettle_\1/#define _\1 _gnutls_nettle_ecc_\1/' \
+ -e 's/^_nettle_\(.*\)(.*/#define _nettle_\1 _gnutls_nettle_ecc_\1\n\0/' \
+ -e 's/^extern const struct ecc_curve _nettle_\(.*\);/#define _nettle_\1 _gnutls_nettle_ecc_\1\n\0/' \
+ -e 's/^extern const struct ecc_eddsa _nettle_\(.*\);/#define _nettle_\1 _gnutls_nettle_ecc_\1\n\0/' \
$dst > $dst-t && \
mv $dst-t $dst
;;
@@ -139,9 +139,9 @@ for f in $IMPORTS; do
# pragma GCC diagnostic ignored "-Wunused-const-variable"\
#endif\
#if GMP_NUMB_BITS == 32\
-#include "curve448/ecc-curve448-32.h"\
+#include "ecc/ecc-curve448-32.h"\
#elif GMP_NUMB_BITS == 64\
-#include "curve448/ecc-curve448-64.h"\
+#include "ecc/ecc-curve448-64.h"\
#else\
#error unsupported configuration\
#endif
@@ -156,9 +156,9 @@ for f in $IMPORTS; do
# pragma GCC diagnostic ignored "-Wunused-const-variable"\
#endif\
#if GMP_NUMB_BITS == 32\
-#include "curve448/ecc-gost-gc256b-32.h"\
+#include "ecc/ecc-gost-gc256b-32.h"\
#elif GMP_NUMB_BITS == 64\
-#include "curve448/ecc-gost-gc256b-64.h"\
+#include "ecc/ecc-gost-gc256b-64.h"\
#else\
#error unsupported configuration\
#endif
@@ -173,9 +173,9 @@ for f in $IMPORTS; do
# pragma GCC diagnostic ignored "-Wunused-const-variable"\
#endif\
#if GMP_NUMB_BITS == 32\
-#include "curve448/ecc-gost-gc512a-32.h"\
+#include "ecc/ecc-gost-gc512a-32.h"\
#elif GMP_NUMB_BITS == 64\
-#include "curve448/ecc-gost-gc512a-64.h"\
+#include "ecc/ecc-gost-gc512a-64.h"\
#else\
#error unsupported configuration\
#endif
diff --git a/lib/nettle/Makefile.am b/lib/nettle/Makefile.am
index f13cba4a8e..f22ea4f858 100644
--- a/lib/nettle/Makefile.am
+++ b/lib/nettle/Makefile.am
@@ -100,54 +100,54 @@ libcrypto_la_SOURCES += gost_keywrap.c
endif
if NEED_CURVE448
-curve448_generated_headers = \
- curve448/ecc-curve448-32.h curve448/ecc-curve448-64.h
+ecc_generated_headers = \
+ ecc/ecc-curve448-32.h ecc/ecc-curve448-64.h
-BUILT_SOURCES = $(curve448_generated_headers)
-EXTRA_DIST = $(curve448_generated_headers) curve448/eccdata.stamp
+BUILT_SOURCES = $(ecc_generated_headers)
+EXTRA_DIST = $(ecc_generated_headers) ecc/eccdata.stamp
-noinst_PROGRAMS = curve448/eccdata$(EXEEXT)
+noinst_PROGRAMS = ecc/eccdata$(EXEEXT)
-curve448_eccdata_SOURCES = curve448/eccdata.c
-curve448_eccdata_CFLAGS = $(GMP_CFLAGS)
-curve448_eccdata_LDADD = $(GMP_LIBS) ../../gl/libgnu.la
+ecc_eccdata_SOURCES = ecc/eccdata.c
+ecc_eccdata_CFLAGS = $(GMP_CFLAGS)
+ecc_eccdata_LDADD = $(GMP_LIBS) ../../gl/libgnu.la
-curve448/eccdata.stamp: $(curve448_eccdata_SOURCES)
- $(AM_V_GEN)$(MAKE) $(AM_MAKEFLAGS) curve448/eccdata$(EXEEXT) && touch $@
+ecc/eccdata.stamp: $(ecc_eccdata_SOURCES)
+ $(AM_V_GEN)$(MAKE) $(AM_MAKEFLAGS) ecc/eccdata$(EXEEXT) && touch $@
-curve448/ecc-curve448-32.h: curve448/eccdata.stamp
- $(AM_V_GEN)curve448/eccdata$(EXEEXT) curve448 38 6 32 > $@T && mv $@T $@
+ecc/ecc-curve448-32.h: ecc/eccdata.stamp
+ $(AM_V_GEN)ecc/eccdata$(EXEEXT) curve448 38 6 32 > $@T && mv $@T $@
-curve448/ecc-curve448-64.h: curve448/eccdata.stamp
- $(AM_V_GEN)curve448/eccdata$(EXEEXT) curve448 38 6 64 > $@T && mv $@T $@
+ecc/ecc-curve448-64.h: ecc/eccdata.stamp
+ $(AM_V_GEN)ecc/eccdata$(EXEEXT) curve448 38 6 64 > $@T && mv $@T $@
libcrypto_la_SOURCES += \
- curve448/write-le64.c \
- curve448/nettle-write.h curve448/gmp-glue.h curve448/gmp-glue.c
+ ecc/write-le64.c \
+ ecc/nettle-write.h ecc/gmp-glue.h ecc/gmp-glue.c
libcrypto_la_SOURCES += \
- curve448/sha3.c curve448/sha3.h curve448/sha3-256.c \
- curve448/sha3-permute.c curve448/sha3-internal.h \
- curve448/shake256.c
+ ecc/sha3.c ecc/sha3.h ecc/sha3-256.c \
+ ecc/sha3-permute.c ecc/sha3-internal.h \
+ ecc/shake256.c
libcrypto_la_SOURCES += \
- curve448/ecc-internal.h \
- curve448/ecc-add-eh.c curve448/ecc-add-ehh.c curve448/ecc-dup-eh.c \
- curve448/ecc-eh-to-a.c curve448/ecc-mul-a-eh.c curve448/ecc-mul-g-eh.c \
- curve448/ecc-mul-m.c curve448/ecc-mod.c curve448/ecc-mod-arith.c \
- curve448/ecc-mod-inv.c \
- curve448/ecc-a-to-j.c \
- curve448/sec-tabselect.c curve448/cnd-copy.c curve448/sec-add-1.c \
- curve448/ecc-curve448.c $(curve448_genereated_headers) \
- curve448/curve448-eh-to-x.c curve448/curve448.h curve448/curve448-mul.c \
- curve448/curve448-mul-g.c
+ ecc/ecc-internal.h \
+ ecc/ecc-add-eh.c ecc/ecc-add-ehh.c ecc/ecc-dup-eh.c \
+ ecc/ecc-eh-to-a.c ecc/ecc-mul-a-eh.c ecc/ecc-mul-g-eh.c \
+ ecc/ecc-mul-m.c ecc/ecc-mod.c ecc/ecc-mod-arith.c \
+ ecc/ecc-mod-inv.c \
+ ecc/ecc-a-to-j.c \
+ ecc/sec-tabselect.c ecc/cnd-copy.c ecc/sec-add-1.c \
+ ecc/ecc-curve448.c $(ecc_genereated_headers) \
+ ecc/curve448-eh-to-x.c ecc/curve448.h ecc/curve448-mul.c \
+ ecc/curve448-mul-g.c
libcrypto_la_SOURCES += \
- curve448/eddsa.h curve448/eddsa-compress.c curve448/eddsa-decompress.c \
- curve448/eddsa-expand.c curve448/eddsa-hash.c curve448/eddsa-internal.h \
- curve448/eddsa-pubkey.c curve448/eddsa-sign.c curve448/eddsa-verify.c \
- curve448/ed448-shake256.c curve448/ed448-shake256-pubkey.c \
- curve448/ed448-shake256-sign.c curve448/ed448-shake256-verify.c
+ ecc/eddsa.h ecc/eddsa-compress.c ecc/eddsa-decompress.c \
+ ecc/eddsa-expand.c ecc/eddsa-hash.c ecc/eddsa-internal.h \
+ ecc/eddsa-pubkey.c ecc/eddsa-sign.c ecc/eddsa-verify.c \
+ ecc/ed448-shake256.c ecc/ed448-shake256-pubkey.c \
+ ecc/ed448-shake256-sign.c ecc/ed448-shake256-verify.c
endif
if NEED_CHACHA
diff --git a/lib/nettle/pk.c b/lib/nettle/pk.c
index f236cef3db..eec6a5fc7d 100644
--- a/lib/nettle/pk.c
+++ b/lib/nettle/pk.c
@@ -51,8 +51,8 @@
#if HAVE_CURVE448
#include <nettle/curve448.h>
#else
-#include "curve448/curve448.h"
-#include "curve448/eddsa.h"
+#include "ecc/curve448.h"
+#include "ecc/eddsa.h"
#endif
#include <nettle/eddsa.h>
#include <nettle/version.h>