From 772a9e68cf11753b7af76aeda8b190e79bf6d3e8 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Fri, 1 Jun 2018 20:59:04 +0200 Subject: [PATCH 1/2] make _sha256 a static function --- src/stream/salsa20/xsalsa20_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream/salsa20/xsalsa20_test.c b/src/stream/salsa20/xsalsa20_test.c index 683ab0d7e..a7040250a 100644 --- a/src/stream/salsa20/xsalsa20_test.c +++ b/src/stream/salsa20/xsalsa20_test.c @@ -19,7 +19,7 @@ #ifdef LTC_XSALSA20 #ifdef LTC_SHA256 -int _sha256(unsigned char *hash, const unsigned char *data, const int datalen) { +static int _sha256(unsigned char *hash, const unsigned char *data, const int datalen) { hash_state md; sha256_init(&md); sha256_process(&md, data, datalen); From 57bffbaa82350626e1905f0138f37ffe0b91ff18 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Fri, 1 Jun 2018 21:02:58 +0200 Subject: [PATCH 2/2] remove useless initialization --- src/stream/salsa20/xsalsa20_setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stream/salsa20/xsalsa20_setup.c b/src/stream/salsa20/xsalsa20_setup.c index d89d65e2f..94133a7f3 100644 --- a/src/stream/salsa20/xsalsa20_setup.c +++ b/src/stream/salsa20/xsalsa20_setup.c @@ -29,7 +29,7 @@ static const char * const constants = "expand 32-byte k"; /* use modified salsa20 doubleround (no final addition as in salsa20) */ static void _xsalsa20_doubleround(ulong32 *x, int rounds) { - int i = 0; + int i; for (i = rounds; i > 0; i -= 2) { /* columnround */ @@ -64,7 +64,7 @@ int xsalsa20_setup(salsa20_state *st, const unsigned char *key, unsigned long ke const int sti[] = {0, 5, 10, 15, 6, 7, 8, 9}; /* indices used to build subkey fm x */ ulong32 x[64]; /* input to & output fm doubleround */ unsigned char subkey[32]; - int i = 0; + int i; LTC_ARGCHK(st != NULL); LTC_ARGCHK(key != NULL);