From 10bb28b27ee5771709ef86024504b6e8d34e1336 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 18 Sep 2017 18:15:53 +0200 Subject: [PATCH] One more COMPILER_ASSERT() --- .../xchacha20poly1305/secretstream_xchacha20poly1305.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c b/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c index 0d5687ef..49ef411e 100644 --- a/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c +++ b/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c @@ -135,6 +135,8 @@ crypto_secretstream_xchacha20poly1305_push crypto_onetimeauth_poly1305_final(&poly1305_state, mac); 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++) { STATE_INONCE(state)[i] ^= mac[i]; }