Comments, constants and whitespace
parent
abc92b2e74
commit
bbc6ea5355
|
|
@ -74,8 +74,7 @@ void AuthenticatedSymmetricCipherBase::Resynchronize(const byte *iv, int length)
|
|||
|
||||
void AuthenticatedSymmetricCipherBase::Update(const byte *input, size_t length)
|
||||
{
|
||||
if (length == 0)
|
||||
return;
|
||||
if (length == 0) {return;}
|
||||
|
||||
switch (m_state)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -78,11 +78,14 @@ protected:
|
|||
virtual void AuthenticateLastConfidentialBlock() {}
|
||||
virtual void AuthenticateLastFooterBlock(byte *mac, size_t macSize) =0;
|
||||
|
||||
// State_AuthUntransformed: authentication is applied to plain text (Authenticate-then-Encrypt)
|
||||
// State_AuthTransformed: authentication is applied to cipher text (Encrypt-then-Authenticate)
|
||||
enum State {State_Start, State_KeySet, State_IVSet, State_AuthUntransformed, State_AuthTransformed, State_AuthFooter};
|
||||
State m_state;
|
||||
unsigned int m_bufferedDataLength;
|
||||
lword m_totalHeaderLength, m_totalMessageLength, m_totalFooterLength;
|
||||
|
||||
AlignedSecByteBlock m_buffer;
|
||||
lword m_totalHeaderLength, m_totalMessageLength, m_totalFooterLength;
|
||||
unsigned int m_bufferedDataLength;
|
||||
State m_state;
|
||||
};
|
||||
|
||||
NAMESPACE_END
|
||||
|
|
|
|||
1
ccm.cpp
1
ccm.cpp
|
|
@ -11,7 +11,6 @@ NAMESPACE_BEGIN(CryptoPP)
|
|||
void CCM_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs ¶ms)
|
||||
{
|
||||
BlockCipher &blockCipher = AccessBlockCipher();
|
||||
|
||||
blockCipher.SetKey(userKey, keylength, params);
|
||||
|
||||
if (blockCipher.BlockSize() != REQUIRED_BLOCKSIZE)
|
||||
|
|
|
|||
|
|
@ -913,7 +913,7 @@ public:
|
|||
//! <pre> if (m_cipher.IsLastBlockSpecial())
|
||||
//! {
|
||||
//! size_t reserve = 2*m_cipher.MandatoryBlockSize();
|
||||
//! space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, length, length+reserve);
|
||||
//! space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, length+reserve);
|
||||
//! length = m_cipher.ProcessLastBlock(space, length+reserve, inString, length);
|
||||
//! AttachedTransformation()->Put(space, length);
|
||||
//! return;
|
||||
|
|
|
|||
2
eax.cpp
2
eax.cpp
|
|
@ -36,7 +36,7 @@ void EAX_Base::AuthenticateLastHeaderBlock()
|
|||
{
|
||||
CRYPTOPP_ASSERT(m_bufferedDataLength == 0);
|
||||
MessageAuthenticationCode &mac = AccessMAC();
|
||||
unsigned int blockSize = mac.TagSize();
|
||||
const unsigned int blockSize = mac.TagSize();
|
||||
|
||||
mac.Final(m_buffer);
|
||||
xorbuf(m_buffer+blockSize, m_buffer, blockSize);
|
||||
|
|
|
|||
|
|
@ -690,7 +690,7 @@ void StreamTransformationFilter::LastPut(const byte *inString, size_t length)
|
|||
if (m_cipher.IsLastBlockSpecial())
|
||||
{
|
||||
size_t reserve = 2*m_cipher.MandatoryBlockSize();
|
||||
space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, length, length+reserve);
|
||||
space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, length+reserve);
|
||||
length = m_cipher.ProcessLastBlock(space, length+reserve, inString, length);
|
||||
AttachedTransformation()->Put(space, length);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue