From 57170058092205ff31e90db2e68aceea0db0cde6 Mon Sep 17 00:00:00 2001 From: Michael Hamburg Date: Tue, 2 May 2017 17:57:24 -0700 Subject: [PATCH] dont look for immintrin on GCC pre-4.4. Also dont build with -maes; need to autoconfig other flags --- Makefile | 2 +- src/GENERATED/include/decaf/ed255.hxx | 4 +--- src/GENERATED/include/decaf/ed448.hxx | 4 +--- src/include/word.h | 6 +++++- src/per_curve/eddsa.tmpl.hxx | 4 +--- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 40833be..bbb41d0 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ endif TODAY = $(shell date "+%Y-%m-%d") #FIXME ARCHFLAGS -ARCHFLAGS ?= -maes -mavx2 -mbmi2 #TODO +ARCHFLAGS ?= -mavx2 -mbmi2 #TODO ifeq ($(CC),clang) WARNFLAGS_C += -Wgcc-compat diff --git a/src/GENERATED/include/decaf/ed255.hxx b/src/GENERATED/include/decaf/ed255.hxx index ea629aa..7d17fed 100644 --- a/src/GENERATED/include/decaf/ed255.hxx +++ b/src/GENERATED/include/decaf/ed255.hxx @@ -149,9 +149,7 @@ public: inline SecureBuffer sign ( const Block &message, const Block &context = NO_CONTEXT() - ) const /* TODO: this exn spec tickles a Clang bug? - * throw(LengthException, std::bad_alloc) - */ { + ) const /* throw(LengthException, std::bad_alloc) */ { if (context.size() > 255) { throw LengthException(); } diff --git a/src/GENERATED/include/decaf/ed448.hxx b/src/GENERATED/include/decaf/ed448.hxx index 1c79887..48cda65 100644 --- a/src/GENERATED/include/decaf/ed448.hxx +++ b/src/GENERATED/include/decaf/ed448.hxx @@ -149,9 +149,7 @@ public: inline SecureBuffer sign ( const Block &message, const Block &context = NO_CONTEXT() - ) const /* TODO: this exn spec tickles a Clang bug? - * throw(LengthException, std::bad_alloc) - */ { + ) const /* throw(LengthException, std::bad_alloc) */ { if (context.size() > 255) { throw LengthException(); } diff --git a/src/include/word.h b/src/include/word.h index f06aa16..7c7644a 100644 --- a/src/include/word.h +++ b/src/include/word.h @@ -36,7 +36,11 @@ extern int posix_memalign(void **, size_t, size_t); #if defined(__ARM_NEON__) #include #elif defined(__SSE2__) -#include + #if !defined(__GNUC__) || __clang__ || __GNUC__ >= 5 || (__GNUC__==4 && __GNUC_MINOR__ >= 4) + #include + #else + #include + #endif #endif #if (ARCH_WORD_BITS == 64) diff --git a/src/per_curve/eddsa.tmpl.hxx b/src/per_curve/eddsa.tmpl.hxx index 1c6ae54..5d0d566 100644 --- a/src/per_curve/eddsa.tmpl.hxx +++ b/src/per_curve/eddsa.tmpl.hxx @@ -133,9 +133,7 @@ public: inline SecureBuffer sign ( const Block &message, const Block &context = NO_CONTEXT() - ) const /* TODO: this exn spec tickles a Clang bug? - * throw(LengthException, std::bad_alloc) - */ { + ) const /* throw(LengthException, std::bad_alloc) */ { if (context.size() > 255) { throw LengthException(); }