Update comments

This commit is contained in:
Jeffrey Walton 2019-01-30 01:45:09 -05:00
parent 38f694924f
commit c1ad534038
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
3 changed files with 9 additions and 1 deletions

View File

@ -316,6 +316,7 @@ std::string ChaCha_Policy::AlgorithmProvider() const
void ChaCha_Policy::CipherSetKey(const NameValuePairs &params, const byte *key, size_t length)
{
CRYPTOPP_ASSERT(key); CRYPTOPP_ASSERT(length == 16 || length == 32);
CRYPTOPP_UNUSED(key); CRYPTOPP_UNUSED(length);
m_rounds = params.GetIntValueWithDefault(Name::Rounds(), 20);
if (m_rounds != 20 && m_rounds != 12 && m_rounds != 8)
@ -337,7 +338,7 @@ void ChaCha_Policy::CipherSetKey(const NameValuePairs &params, const byte *key,
void ChaCha_Policy::CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length)
{
CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length);
CRYPTOPP_ASSERT(length==8);
CRYPTOPP_ASSERT(length==8); CRYPTOPP_UNUSED(length);
GetBlock<word32, LittleEndian> get(IV);
m_state[12] = m_state[13] = 0;

View File

@ -8,6 +8,12 @@
NAMESPACE_BEGIN(CryptoPP)
// RekeyCipherAndMac is heavier-weight than we like. The Authenc framework was
// predicated on BlcokCiphers, where the key and key schedule could be
// calculated independent of the IV being used. However, the ChaCha and
// ChaCha20Poly1305 construction cannot disgorge key setup and IV. Even a
// simple Resync() forces us to regenerate the initial state for both
// ChaCha20 and Poly1305.
void ChaCha20Poly1305_Base::RekeyCipherAndMac(const byte *userKey, size_t keylength, const NameValuePairs &params)
{
// Derive MAC key

View File

@ -120,6 +120,7 @@ protected:
};
/// \brief ChaCha20Poly1305 cipher final implementation
/// \tparam T_ForwardTransform flag indicating cipher direction
/// \details ChaCha20Poly1305 is an authenticated encryption scheme that combines
/// ChaCha20TLS and Poly1305TLS. The scheme is defined in RFC 8439, section 2.8,
/// AEAD_CHACHA20_POLY1305 construction, and uses the IETF versions of ChaCha