From 462bcc859de89905faeb0c031657369c94ce1bb5 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 4 Jun 2019 04:39:19 -0400 Subject: [PATCH] Update Poly1305 nonce length check --- poly1305.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poly1305.cpp b/poly1305.cpp index 9f3f97aa..354d76c4 100644 --- a/poly1305.cpp +++ b/poly1305.cpp @@ -283,7 +283,7 @@ template void Poly1305_Base::Resynchronize(const byte *nonce, int nonceLength) { CRYPTOPP_ASSERT(nonceLength == -1 || nonceLength == (int)BLOCKSIZE); - nonceLength == -1 ? nonceLength = BLOCKSIZE : nonceLength; + if (nonceLength == -1) { nonceLength = BLOCKSIZE; } // Encrypt the nonce, stash in m_nk m_cipher.ProcessBlock(nonce, m_nk.begin());