From 46c2fb4a4ac58fcd43fbc337ab7812b9cb304aba Mon Sep 17 00:00:00 2001 From: Mike Hamburg Date: Sat, 6 Sep 2014 22:54:57 -0700 Subject: [PATCH] A few adjustments on contributed patches. Undo the INTRINSIC changes from David Leon Gil. Turn precomputed keys back on by default. Change #ifdef to #if for checking sigs. --- include/goldilocks.h | 7 ++++++- src/goldilocks.c | 2 +- src/include/config.h | 2 +- src/include/intrinsics.h | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/goldilocks.h b/include/goldilocks.h index 7043809..2c3919c 100644 --- a/include/goldilocks.h +++ b/include/goldilocks.h @@ -17,6 +17,11 @@ #define GOLDI_IMPLEMENT_PRECOMPUTED_KEYS 1 #endif +#ifndef GOLDI_IMPLEMENT_SIGNATURES +/** If nonzero, implement signatures. */ +#define GOLDI_IMPLEMENT_SIGNATURES 1 +#endif + /** The size of the Goldilocks field, in bits. */ #define GOLDI_FIELD_BITS 448 @@ -207,7 +212,7 @@ goldilocks_shared_secret ( const struct goldilocks_public_key_t *your_pubkey ) __attribute__((warn_unused_result,nonnull(1,2,3),visibility ("default"))); -#ifdef GOLDI_IMPLEMENT_SIGNATURES +#if GOLDI_IMPLEMENT_SIGNATURES /** * @brief Sign a message. * diff --git a/src/goldilocks.c b/src/goldilocks.c index af70d1c..94ba665 100644 --- a/src/goldilocks.c +++ b/src/goldilocks.c @@ -306,7 +306,7 @@ goldilocks_shared_secret ( ); } -#ifdef GOLDI_IMPLEMENT_SIGNATURES +#if GOLDI_IMPLEMENT_SIGNATURES static void goldilocks_derive_challenge( word_t challenge[GOLDI_FIELD_WORDS], diff --git a/src/include/config.h b/src/include/config.h index 4a98087..bf5e384 100644 --- a/src/include/config.h +++ b/src/include/config.h @@ -65,7 +65,7 @@ * @brief Whether or not to define and implement functions * working with pre-computed keys. */ -#define GOLDI_IMPLEMENT_PRECOMPUTED_KEYS 0 +#define GOLDI_IMPLEMENT_PRECOMPUTED_KEYS 1 /** * @brief ECDH adds public keys into the hash, to prevent diff --git a/src/include/intrinsics.h b/src/include/intrinsics.h index 46df9da..88e90d0 100644 --- a/src/include/intrinsics.h +++ b/src/include/intrinsics.h @@ -19,7 +19,7 @@ /** @brief Macro to make a function static, forcibly inlined and possibly unused. */ #define INTRINSIC \ - static inline __attribute__((__gnu_inline__, __always_inline__)) + static __inline__ __attribute__((__gnu_inline__, __always_inline__, unused)) #define GEN 1 /**< @brief Intrinsics field has been generated. */ #define SSE2 2 /**< @brief Machine supports SSE2 */