From bb9d39797578cfbb0d5ea2a708eee661480e3673 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 14 Aug 2017 16:55:01 +0200 Subject: [PATCH 1/2] default ChaCha to ChaCha20 --- src/stream/chacha/chacha_setup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stream/chacha/chacha_setup.c b/src/stream/chacha/chacha_setup.c index e3a7f40..e34370b 100644 --- a/src/stream/chacha/chacha_setup.c +++ b/src/stream/chacha/chacha_setup.c @@ -35,6 +35,8 @@ int chacha_setup(chacha_state *st, const unsigned char *key, unsigned long keyle LTC_ARGCHK(key != NULL); LTC_ARGCHK(keylen == 32 || keylen == 16); + if (rounds == 0) rounds = 20; + LOAD32L(st->input[4], key + 0); LOAD32L(st->input[5], key + 4); LOAD32L(st->input[6], key + 8); From 1fa8caff6c91797f4a4cb450a6d162f8e181c1c8 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 16 Aug 2017 11:52:40 +0200 Subject: [PATCH 2/2] fix call to gettimeofday() as of `man gettimeofday` "The use of the timezone structure is obsolete; the tz argument should normally be specified as NULL." --- tests/test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test.c b/tests/test.c index 3cac645..212dc14 100644 --- a/tests/test.c +++ b/tests/test.c @@ -73,8 +73,7 @@ static ulong64 epoch_usec(void) return cur_time; #else struct timeval tv; - struct timezone tz; - gettimeofday(&tv, &tz); + gettimeofday(&tv, NULL); return (ulong64)(tv.tv_sec) * 1000000 + (ulong64)(tv.tv_usec); /* get microseconds */ #endif }