Cleared analysis warning on use of boolean in arithmetic expression

pull/239/head
Jeffrey Walton 2016-07-23 19:37:17 -04:00
parent eba3f83327
commit 7378a1b86d
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
// chacha.cpp - written and placed in the public domain by Jeffrey Walton. // chacha.cpp - written and placed in the public domain by Jeffrey Walton.
// Copyright assigned to the Crypto++ project. // Copyright assigned to the Crypto++ project.
// Based on Wei Dai's Salsa20 and Bernstein's reference ChaCha // Based on Wei Dai's Salsa20 and Bernstein's reference ChaCha
// family implementation at http://cr.yp.to/chacha.html. // family implementation at http://cr.yp.to/chacha.html.
#include "pch.h" #include "pch.h"
@ -141,7 +141,7 @@ void ChaCha_Policy<R>::OperateKeystream(KeystreamOperation operation, byte *outp
#endif #endif
++m_state[12]; ++m_state[12];
m_state[13] += !!(m_state[12] == 0); m_state[13] += static_cast<word32>(m_state[12] == 0);
} }
} }

View File

@ -1,6 +1,6 @@
// chacha.h - written and placed in the public domain by Jeffrey Walton. // chacha.h - written and placed in the public domain by Jeffrey Walton.
// Copyright assigned to the Crypto++ project. // Copyright assigned to the Crypto++ project.
// Based on Wei Dai's Salsa20 and Bernstein's reference ChaCha // Based on Wei Dai's Salsa20 and Bernstein's reference ChaCha
// family implementation at http://cr.yp.to/chacha.html. // family implementation at http://cr.yp.to/chacha.html.
//! \file chacha.h //! \file chacha.h