From df8cc4967090538af85ee0de12f61a921b4ebbe9 Mon Sep 17 00:00:00 2001 From: "Matthias J. Kannwischer" Date: Tue, 15 Oct 2019 15:13:39 +0200 Subject: [PATCH] fix kyber-90s warning if size_t is not 32 bits --- crypto_kem/kyber1024-90s/avx2/aes256ctr.c | 1 + crypto_kem/kyber1024-90s/clean/aes256ctr.c | 2 +- crypto_kem/kyber512-90s/avx2/aes256ctr.c | 1 + crypto_kem/kyber512-90s/clean/aes256ctr.c | 2 +- crypto_kem/kyber768-90s/avx2/aes256ctr.c | 1 + crypto_kem/kyber768-90s/clean/aes256ctr.c | 2 +- 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crypto_kem/kyber1024-90s/avx2/aes256ctr.c b/crypto_kem/kyber1024-90s/avx2/aes256ctr.c index b7dbd90d..5f69a4bc 100644 --- a/crypto_kem/kyber1024-90s/avx2/aes256ctr.c +++ b/crypto_kem/kyber1024-90s/avx2/aes256ctr.c @@ -174,3 +174,4 @@ void PQCLEAN_KYBER102490S_AVX2_aes256ctr_prf(uint8_t *out, } } } + diff --git a/crypto_kem/kyber1024-90s/clean/aes256ctr.c b/crypto_kem/kyber1024-90s/clean/aes256ctr.c index 8b799dbf..2af282ae 100644 --- a/crypto_kem/kyber1024-90s/clean/aes256ctr.c +++ b/crypto_kem/kyber1024-90s/clean/aes256ctr.c @@ -91,5 +91,5 @@ void PQCLEAN_KYBER102490S_CLEAN_aes256xof_absorb(aes256xof_ctx *s, const uint8_t **************************************************/ void PQCLEAN_KYBER102490S_CLEAN_aes256xof_squeezeblocks(uint8_t *out, size_t nblocks, aes256xof_ctx *s) { aes256_ctr_xof(out, nblocks * 64, s->iv, s->ctr, &s->sk_exp); - s->ctr += 4 * nblocks; + s->ctr += (uint32_t) (4 * nblocks); } diff --git a/crypto_kem/kyber512-90s/avx2/aes256ctr.c b/crypto_kem/kyber512-90s/avx2/aes256ctr.c index 1a8128e4..768c6ec1 100644 --- a/crypto_kem/kyber512-90s/avx2/aes256ctr.c +++ b/crypto_kem/kyber512-90s/avx2/aes256ctr.c @@ -174,3 +174,4 @@ void PQCLEAN_KYBER51290S_AVX2_aes256ctr_prf(uint8_t *out, } } } + diff --git a/crypto_kem/kyber512-90s/clean/aes256ctr.c b/crypto_kem/kyber512-90s/clean/aes256ctr.c index 4c5f3f1e..fcf2af5c 100644 --- a/crypto_kem/kyber512-90s/clean/aes256ctr.c +++ b/crypto_kem/kyber512-90s/clean/aes256ctr.c @@ -91,5 +91,5 @@ void PQCLEAN_KYBER51290S_CLEAN_aes256xof_absorb(aes256xof_ctx *s, const uint8_t **************************************************/ void PQCLEAN_KYBER51290S_CLEAN_aes256xof_squeezeblocks(uint8_t *out, size_t nblocks, aes256xof_ctx *s) { aes256_ctr_xof(out, nblocks * 64, s->iv, s->ctr, &s->sk_exp); - s->ctr += 4 * nblocks; + s->ctr += (uint32_t) (4 * nblocks); } diff --git a/crypto_kem/kyber768-90s/avx2/aes256ctr.c b/crypto_kem/kyber768-90s/avx2/aes256ctr.c index 7a2d3a15..d44e5b76 100644 --- a/crypto_kem/kyber768-90s/avx2/aes256ctr.c +++ b/crypto_kem/kyber768-90s/avx2/aes256ctr.c @@ -174,3 +174,4 @@ void PQCLEAN_KYBER76890S_AVX2_aes256ctr_prf(uint8_t *out, } } } + diff --git a/crypto_kem/kyber768-90s/clean/aes256ctr.c b/crypto_kem/kyber768-90s/clean/aes256ctr.c index b7a0b620..555da919 100644 --- a/crypto_kem/kyber768-90s/clean/aes256ctr.c +++ b/crypto_kem/kyber768-90s/clean/aes256ctr.c @@ -91,5 +91,5 @@ void PQCLEAN_KYBER76890S_CLEAN_aes256xof_absorb(aes256xof_ctx *s, const uint8_t **************************************************/ void PQCLEAN_KYBER76890S_CLEAN_aes256xof_squeezeblocks(uint8_t *out, size_t nblocks, aes256xof_ctx *s) { aes256_ctr_xof(out, nblocks * 64, s->iv, s->ctr, &s->sk_exp); - s->ctr += 4 * nblocks; + s->ctr += (uint32_t) (4 * nblocks); }