Add compilation-time poly1305 structure size checks

This commit is contained in:
Frank Denis 2015-11-13 23:12:20 +01:00
parent 7561a25d5a
commit 8bced53601

View File

@ -64,6 +64,10 @@ static int
crypto_onetimeauth_poly1305_donna_init(crypto_onetimeauth_poly1305_state *state,
const unsigned char *key)
{
(void) sizeof(int[sizeof (crypto_onetimeauth_poly1305_state) >=
sizeof (poly1305_context) ? 1 : -1]);
(void) sizeof(int[sizeof (poly1305_context) >=
sizeof (poly1305_state_internal_t) ? 1 : -1]);
poly1305_init((poly1305_context *) state, key);
return 0;