One more COMPILER_ASSERT()

This commit is contained in:
Frank Denis 2017-09-18 18:15:53 +02:00
parent 2ce41de29b
commit 10bb28b27e

View File

@ -135,6 +135,8 @@ crypto_secretstream_xchacha20poly1305_push
crypto_onetimeauth_poly1305_final(&poly1305_state, mac); crypto_onetimeauth_poly1305_final(&poly1305_state, mac);
sodium_memzero(&poly1305_state, sizeof poly1305_state); sodium_memzero(&poly1305_state, sizeof poly1305_state);
COMPILER_ASSERT(crypto_onetimeauth_poly1305_BYTES >=
crypto_secretstream_xchacha20poly1305_INONCEBYTES);
for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) { for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) {
STATE_INONCE(state)[i] ^= mac[i]; STATE_INONCE(state)[i] ^= mac[i];
} }