From cd62591ade98d19e20c38c7492210a3d57b60f4b Mon Sep 17 00:00:00 2001 From: lucaderi Date: Mon, 8 Jun 2020 00:01:28 +0200 Subject: [PATCH] CentOS6 fixes --- Makefile.in | 2 +- tools/Makefile.in | 2 +- transform_speck.c | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index e4fed52..e27686b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -7,7 +7,7 @@ GIT_COMMITS=@GIT_COMMITS@ CC?=gcc DEBUG?=-g3 -OPTIMIZATION?=-O3 -march=native +OPTIMIZATION?=-O3 #-march=native WARN?=-Wall #Ultrasparc64 users experiencing SIGBUS should try the following gcc options diff --git a/tools/Makefile.in b/tools/Makefile.in index ff7fe6d..7df143c 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -1,6 +1,6 @@ CC?=gcc DEBUG?=-g3 -OPTIMIZATION?=-O2 -march=native +OPTIMIZATION?=-O2 #-march=native WARN?=-Wall INSTALL=install diff --git a/transform_speck.c b/transform_speck.c index e7c0c63..9e00e77 100644 --- a/transform_speck.c +++ b/transform_speck.c @@ -54,7 +54,9 @@ static int transop_deinit_speck(n2n_trans_op_t *arg) { static void set_speck_iv(transop_speck_t *priv, n2n_speck_ivec_t ivec) { // keep in mind the following condition: N2N_SPECK_IVEC_SIZE % sizeof(rand_value) == 0 ! uint32_t rand_value; - for (uint8_t i = 0; i < N2N_SPECK_IVEC_SIZE; i += sizeof(rand_value)) { + uint8_t i; + + for (i = 0; i < N2N_SPECK_IVEC_SIZE; i += sizeof(rand_value)) { rand_value = rand(); // CONCERN: rand() is not considered cryptographicly secure, REPLACE later memcpy(ivec + i, &rand_value, sizeof(rand_value)); }