From c4fe67b6335ba62d5d9a09592fb5ddb116a89b84 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 12 Jul 2017 15:53:11 -0600 Subject: [PATCH] build for ed25519 only --- src/include.am | 3 +++ wolfcrypt/src/fe_operations.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/include.am b/src/include.am index d3fc04266..1e2d11c6b 100644 --- a/src/include.am +++ b/src/include.am @@ -242,6 +242,9 @@ src_libwolfssl_la_SOURCES += wolfcrypt/src/fe_low_mem.c endif else src_libwolfssl_la_SOURCES += wolfcrypt/src/ge_operations.c +if !BUILD_FEMATH +src_libwolfssl_la_SOURCES += wolfcrypt/src/fe_operations.c +endif if BUILD_CURVE25519_SMALL src_libwolfssl_la_SOURCES += wolfcrypt/src/fe_operations.c endif diff --git a/wolfcrypt/src/fe_operations.c b/wolfcrypt/src/fe_operations.c index f6d77faa6..7da9b2f50 100755 --- a/wolfcrypt/src/fe_operations.c +++ b/wolfcrypt/src/fe_operations.c @@ -45,7 +45,8 @@ #include "fe_x25519_128.i" #else -#ifdef HAVE_CURVE25519 +#if defined(HAVE_CURVE25519) || \ + (defined(HAVE_ED25519) && !defined(ED25519_SMALL)) /* fe means field element. Here the field is \Z/(2^255-19). @@ -573,7 +574,8 @@ void fe_sub(fe h,const fe f,const fe g) } -#ifdef HAVE_CURVE25519 +#if defined(HAVE_CURVE25519) || \ + (defined(HAVE_ED25519) && !defined(ED25519_SMALL)) /* Ignores top bit of h. */