diff --git a/crypto_sign/dilithium2/clean/poly.c b/crypto_sign/dilithium2/clean/poly.c index 18c759b1..e7383389 100644 --- a/crypto_sign/dilithium2/clean/poly.c +++ b/crypto_sign/dilithium2/clean/poly.c @@ -296,11 +296,10 @@ static unsigned int rej_uniform(uint32_t *a, void PQCLEAN_DILITHIUM2_CLEAN_poly_uniform(poly *a, const uint8_t seed[SEEDBYTES], uint16_t nonce) { - unsigned int i, ctr; + size_t ctr, off; size_t buflen = POLY_UNIFORM_BUFLEN; uint8_t buf[POLY_UNIFORM_BUFLEN + 2]; stream128_state state; - size_t off; stream128_init(&state, seed, nonce); stream128_squeezeblocks(buf, POLY_UNIFORM_NBLOCKS, &state); @@ -309,7 +308,7 @@ void PQCLEAN_DILITHIUM2_CLEAN_poly_uniform(poly *a, while (ctr < N) { off = buflen % 3; - for (i = 0; i < off; ++i) { + for (size_t i = 0; i < off; ++i) { buf[i] = buf[buflen - off + i]; } diff --git a/crypto_sign/dilithium3/clean/poly.c b/crypto_sign/dilithium3/clean/poly.c index 0d363285..65bde358 100644 --- a/crypto_sign/dilithium3/clean/poly.c +++ b/crypto_sign/dilithium3/clean/poly.c @@ -296,11 +296,10 @@ static unsigned int rej_uniform(uint32_t *a, void PQCLEAN_DILITHIUM3_CLEAN_poly_uniform(poly *a, const uint8_t seed[SEEDBYTES], uint16_t nonce) { - unsigned int i, ctr; + size_t ctr, off; size_t buflen = POLY_UNIFORM_BUFLEN; uint8_t buf[POLY_UNIFORM_BUFLEN + 2]; stream128_state state; - size_t off; stream128_init(&state, seed, nonce); stream128_squeezeblocks(buf, POLY_UNIFORM_NBLOCKS, &state); @@ -309,7 +308,7 @@ void PQCLEAN_DILITHIUM3_CLEAN_poly_uniform(poly *a, while (ctr < N) { off = buflen % 3; - for (i = 0; i < off; ++i) { + for (size_t i = 0; i < off; ++i) { buf[i] = buf[buflen - off + i]; } diff --git a/crypto_sign/dilithium4/clean/poly.c b/crypto_sign/dilithium4/clean/poly.c index 632fe7be..dff9093b 100644 --- a/crypto_sign/dilithium4/clean/poly.c +++ b/crypto_sign/dilithium4/clean/poly.c @@ -296,11 +296,10 @@ static unsigned int rej_uniform(uint32_t *a, void PQCLEAN_DILITHIUM4_CLEAN_poly_uniform(poly *a, const uint8_t seed[SEEDBYTES], uint16_t nonce) { - unsigned int i, ctr; + size_t ctr, off; size_t buflen = POLY_UNIFORM_BUFLEN; uint8_t buf[POLY_UNIFORM_BUFLEN + 2]; stream128_state state; - size_t off; stream128_init(&state, seed, nonce); stream128_squeezeblocks(buf, POLY_UNIFORM_NBLOCKS, &state); @@ -309,7 +308,7 @@ void PQCLEAN_DILITHIUM4_CLEAN_poly_uniform(poly *a, while (ctr < N) { off = buflen % 3; - for (i = 0; i < off; ++i) { + for (size_t i = 0; i < off; ++i) { buf[i] = buf[buflen - off + i]; } diff --git a/test/duplicate_consistency/dilithium3_clean.yml b/test/duplicate_consistency/dilithium3_clean.yml index 1145e238..57a38b3a 100644 --- a/test/duplicate_consistency/dilithium3_clean.yml +++ b/test/duplicate_consistency/dilithium3_clean.yml @@ -41,7 +41,7 @@ consistency_checks: - stream.h - symmetric.h - source: - scheme: dilithium2 + scheme: dilithium3 implementation: avx2 files: - api.h diff --git a/test/duplicate_consistency/dilithium4_clean.yml b/test/duplicate_consistency/dilithium4_clean.yml index afa91d6b..96eb0cbe 100644 --- a/test/duplicate_consistency/dilithium4_clean.yml +++ b/test/duplicate_consistency/dilithium4_clean.yml @@ -40,7 +40,7 @@ consistency_checks: - stream.h - symmetric.h - source: - scheme: dilithium2 + scheme: dilithium4 implementation: avx2 files: - api.h @@ -51,4 +51,3 @@ consistency_checks: - stream.c - stream.h - symmetric.h - diff --git a/test/test_valgrind.py b/test/test_valgrind.py index 9a7a2c18..df3606e8 100644 --- a/test/test_valgrind.py +++ b/test/test_valgrind.py @@ -26,7 +26,7 @@ def valgrind_supports_exit_early(): @pytest.mark.parametrize( 'implementation,test_dir,impl_path, init, destr', - [(impl, *helpers.isolate_test_files(impl.path(), 'test_functest_')) + [(impl, *helpers.isolate_test_files(impl.path(), 'test_valgrind_')) for impl in pqclean.Scheme.all_supported_implementations()], ids=[str(impl) for impl in pqclean.Scheme.all_supported_implementations()], )