From 1e796b2e0eef043d511116ba7a36f34dd3420878 Mon Sep 17 00:00:00 2001 From: Mike Hamburg Date: Tue, 1 Mar 2016 17:14:39 -0800 Subject: [PATCH] fix some warns from gcc --- src/per_curve/eddsa.tmpl.c | 2 +- src/per_curve/eddsa.tmpl.hxx | 2 +- src/shake.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/per_curve/eddsa.tmpl.c b/src/per_curve/eddsa.tmpl.c index d621bca..839b9bd 100644 --- a/src/per_curve/eddsa.tmpl.c +++ b/src/per_curve/eddsa.tmpl.c @@ -3,10 +3,10 @@ * @brief EdDSA routines. */ +#include "word.h" #include #include #include -#include "word.h" #include #define API_NAME "$(c_ns)" diff --git a/src/per_curve/eddsa.tmpl.hxx b/src/per_curve/eddsa.tmpl.hxx index e5382de..3d0e79d 100644 --- a/src/per_curve/eddsa.tmpl.hxx +++ b/src/per_curve/eddsa.tmpl.hxx @@ -70,7 +70,7 @@ private: } if (SUPPORTS_CONTEXTS) { - uint8_t dom[2] = {2, context_.size() }; + uint8_t dom[2] = {2, (uint8_t)context_.size() }; update(dom,2); update(context_); } diff --git a/src/shake.c b/src/shake.c index 84c5640..e33ed8d 100644 --- a/src/shake.c +++ b/src/shake.c @@ -270,7 +270,7 @@ size_t decaf_sponge_max_output_bytes ( ) { return (s->params->max_out == 0xFF) ? SIZE_MAX - : ((200-s->params->rate)/2); + : (size_t)((200-s->params->rate)/2); } DEFSHAKE(128)