From 92489775959c9988c58720ff8b59649a7476769a Mon Sep 17 00:00:00 2001 From: Michael Baentsch Date: Fri, 27 Mar 2020 07:24:29 +0100 Subject: [PATCH] Wshadow at Dilithium/avx2 --- crypto_sign/dilithium2/avx2/Makefile | 2 +- crypto_sign/dilithium2/avx2/fips202x4.c | 2 +- crypto_sign/dilithium3/avx2/Makefile | 2 +- crypto_sign/dilithium3/avx2/fips202x4.c | 2 +- crypto_sign/dilithium4/avx2/Makefile | 2 +- crypto_sign/dilithium4/avx2/fips202x4.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crypto_sign/dilithium2/avx2/Makefile b/crypto_sign/dilithium2/avx2/Makefile index c363416b..12418161 100644 --- a/crypto_sign/dilithium2/avx2/Makefile +++ b/crypto_sign/dilithium2/avx2/Makefile @@ -12,7 +12,7 @@ HEADERS = alignment.h api.h params.h sign.h polyvec.h poly.h packing.h ntt.h \ CFLAGS=-O3 -Wall -Wextra -Wpedantic -Wvla -Werror \ -Wmissing-prototypes -Wredundant-decls -std=c99 \ - -Wcast-align \ + -Wcast-align -Werror=shadow\ -mavx2 -mbmi -mpopcnt -I../../../common $(EXTRAFLAGS) all: $(LIB) diff --git a/crypto_sign/dilithium2/avx2/fips202x4.c b/crypto_sign/dilithium2/avx2/fips202x4.c index ebf7344b..9fe44d0c 100644 --- a/crypto_sign/dilithium2/avx2/fips202x4.c +++ b/crypto_sign/dilithium2/avx2/fips202x4.c @@ -43,7 +43,7 @@ static void keccak_absorb4x(__m256i *s, uint8_t t3[200]; uint64_t *ss = (uint64_t *)s; - for (size_t i = 0; i < 25; ++i) { + for (i = 0; i < 25; ++i) { s[i] = _mm256_xor_si256(s[i], s[i]); } diff --git a/crypto_sign/dilithium3/avx2/Makefile b/crypto_sign/dilithium3/avx2/Makefile index 58f6c43d..8f4e1dff 100644 --- a/crypto_sign/dilithium3/avx2/Makefile +++ b/crypto_sign/dilithium3/avx2/Makefile @@ -12,7 +12,7 @@ HEADERS = alignment.h api.h params.h sign.h polyvec.h poly.h packing.h ntt.h \ CFLAGS=-O3 -Wall -Wextra -Wpedantic -Wvla -Werror \ -Wmissing-prototypes -Wredundant-decls -std=c99 \ - -Wcast-align \ + -Wcast-align -Werror=shadow\ -mavx2 -mbmi -mpopcnt -I../../../common $(EXTRAFLAGS) all: $(LIB) diff --git a/crypto_sign/dilithium3/avx2/fips202x4.c b/crypto_sign/dilithium3/avx2/fips202x4.c index 04d32836..7df19546 100644 --- a/crypto_sign/dilithium3/avx2/fips202x4.c +++ b/crypto_sign/dilithium3/avx2/fips202x4.c @@ -43,7 +43,7 @@ static void keccak_absorb4x(__m256i *s, uint8_t t3[200]; uint64_t *ss = (uint64_t *)s; - for (size_t i = 0; i < 25; ++i) { + for (i = 0; i < 25; ++i) { s[i] = _mm256_xor_si256(s[i], s[i]); } diff --git a/crypto_sign/dilithium4/avx2/Makefile b/crypto_sign/dilithium4/avx2/Makefile index 9fd9f482..e0df80cc 100644 --- a/crypto_sign/dilithium4/avx2/Makefile +++ b/crypto_sign/dilithium4/avx2/Makefile @@ -12,7 +12,7 @@ HEADERS = alignment.h api.h params.h sign.h polyvec.h poly.h packing.h ntt.h \ CFLAGS=-O3 -Wall -Wextra -Wpedantic -Wvla -Werror \ -Wmissing-prototypes -Wredundant-decls -std=c99 \ - -Wcast-align \ + -Wcast-align -Werror=shadow\ -mavx2 -mbmi -mpopcnt -I../../../common $(EXTRAFLAGS) all: $(LIB) diff --git a/crypto_sign/dilithium4/avx2/fips202x4.c b/crypto_sign/dilithium4/avx2/fips202x4.c index d8ddd54b..61bb8c94 100644 --- a/crypto_sign/dilithium4/avx2/fips202x4.c +++ b/crypto_sign/dilithium4/avx2/fips202x4.c @@ -43,7 +43,7 @@ static void keccak_absorb4x(__m256i *s, uint8_t t3[200]; uint64_t *ss = (uint64_t *)s; - for (size_t i = 0; i < 25; ++i) { + for (i = 0; i < 25; ++i) { s[i] = _mm256_xor_si256(s[i], s[i]); }