From 81eb15531bc236086a94b62e688d6b27d50f1ed5 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Tue, 30 Aug 2016 07:49:46 -0400 Subject: Fix header guard, macro tidy --- src/lib/pubkey/newhope/newhope.cpp | 4 ++++ src/lib/pubkey/newhope/newhope.h | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/lib/pubkey/newhope/newhope.cpp b/src/lib/pubkey/newhope/newhope.cpp index fac0c13f3..d367cc982 100644 --- a/src/lib/pubkey/newhope/newhope.cpp +++ b/src/lib/pubkey/newhope/newhope.cpp @@ -19,6 +19,7 @@ typedef newhope_poly poly; // Don't change this :) #define PARAM_Q 12289 +#define PARAM_N 1024 #define NEWHOPE_POLY_BYTES 1792 #define NEWHOPE_SEED_BYTES 32 @@ -604,3 +605,6 @@ void newhope_shareda(unsigned char *sharedkey, const poly *sk, const unsigned ch } } + +#undef PARAM_N +#undef PARAM_Q diff --git a/src/lib/pubkey/newhope/newhope.h b/src/lib/pubkey/newhope/newhope.h index 541b17481..189833f8d 100644 --- a/src/lib/pubkey/newhope/newhope.h +++ b/src/lib/pubkey/newhope/newhope.h @@ -9,8 +9,8 @@ * Botan is released under the Simplified BSD License (see license.txt) */ -#ifndef NEWHOPE_H -#define NEWHOPE_H +#ifndef BOTAN_NEWHOPE_H__ +#define BOTAN_NEWHOPE_H__ #include @@ -21,13 +21,11 @@ namespace Botan { * Currently pubkey.h does not support a 2-phase KEM scheme of * the sort NEWHOPE exports. */ -#define PARAM_N 1024 - #define NEWHOPE_SENDABYTES 1824 #define NEWHOPE_SENDBBYTES 2048 typedef struct { - uint16_t coeffs[PARAM_N]; + uint16_t coeffs[1024]; } newhope_poly __attribute__ ((aligned (32))); -- cgit v1.2.3