aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-08-30 07:49:46 -0400
committerJack Lloyd <[email protected]>2016-08-30 07:49:46 -0400
commit81eb15531bc236086a94b62e688d6b27d50f1ed5 (patch)
tree93302fcf87be0c8136471742da11a30a3328ca9d /src
parent5739c41504f8193b71e3b0ff6fbe9a508f3ece6a (diff)
Fix header guard, macro tidy
Diffstat (limited to 'src')
-rw-r--r--src/lib/pubkey/newhope/newhope.cpp4
-rw-r--r--src/lib/pubkey/newhope/newhope.h8
2 files changed, 7 insertions, 5 deletions
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 <botan/rng.h>
@@ -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)));