Update Poly1305 nonce length check

pull/853/head
Jeffrey Walton 2019-06-04 04:39:19 -04:00
parent a644008679
commit 462bcc859d
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 1 additions and 1 deletions

View File

@ -283,7 +283,7 @@ template <class T>
void Poly1305_Base<T>::Resynchronize(const byte *nonce, int nonceLength) void Poly1305_Base<T>::Resynchronize(const byte *nonce, int nonceLength)
{ {
CRYPTOPP_ASSERT(nonceLength == -1 || nonceLength == (int)BLOCKSIZE); CRYPTOPP_ASSERT(nonceLength == -1 || nonceLength == (int)BLOCKSIZE);
nonceLength == -1 ? nonceLength = BLOCKSIZE : nonceLength; if (nonceLength == -1) { nonceLength = BLOCKSIZE; }
// Encrypt the nonce, stash in m_nk // Encrypt the nonce, stash in m_nk
m_cipher.ProcessBlock(nonce, m_nk.begin()); m_cipher.ProcessBlock(nonce, m_nk.begin());