diff --git a/src/encauth/chachapoly/chacha20poly1305_decrypt.c b/src/encauth/chachapoly/chacha20poly1305_decrypt.c index e62dd6a..bc8b6c1 100644 --- a/src/encauth/chachapoly/chacha20poly1305_decrypt.c +++ b/src/encauth/chachapoly/chacha20poly1305_decrypt.c @@ -29,7 +29,8 @@ int chacha20poly1305_decrypt(chachapoly_state *st, const unsigned char *in, unsi LTC_ARGCHK(st != NULL); if (st->aadflg) { - if ((padlen = 16 - (st->aadlen % 16)) < 16) { + padlen = 16 - (st->aadlen % 16); + if (padlen < 16) { if ((err = poly1305_process(&st->poly, padzero, padlen)) != CRYPT_OK) return err; } st->aadflg = 0; /* no more AAD */