Skip to content

Commit bbc6ea5

Browse files
committed
Comments, constants and whitespace
1 parent abc92b2 commit bbc6ea5

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

authenc.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ void AuthenticatedSymmetricCipherBase::Resynchronize(const byte *iv, int length)
7474

7575
void AuthenticatedSymmetricCipherBase::Update(const byte *input, size_t length)
7676
{
77-
if (length == 0)
78-
return;
77+
if (length == 0) {return;}
7978

8079
switch (m_state)
8180
{

authenc.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,14 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedSymmetricCipherBase : public
7878
virtual void AuthenticateLastConfidentialBlock() {}
7979
virtual void AuthenticateLastFooterBlock(byte *mac, size_t macSize) =0;
8080

81+
// State_AuthUntransformed: authentication is applied to plain text (Authenticate-then-Encrypt)
82+
// State_AuthTransformed: authentication is applied to cipher text (Encrypt-then-Authenticate)
8183
enum State {State_Start, State_KeySet, State_IVSet, State_AuthUntransformed, State_AuthTransformed, State_AuthFooter};
82-
State m_state;
83-
unsigned int m_bufferedDataLength;
84-
lword m_totalHeaderLength, m_totalMessageLength, m_totalFooterLength;
84+
8585
AlignedSecByteBlock m_buffer;
86+
lword m_totalHeaderLength, m_totalMessageLength, m_totalFooterLength;
87+
unsigned int m_bufferedDataLength;
88+
State m_state;
8689
};
8790

8891
NAMESPACE_END

ccm.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ NAMESPACE_BEGIN(CryptoPP)
1111
void CCM_Base::SetKeyWithoutResync(const byte *userKey, size_t keylength, const NameValuePairs &params)
1212
{
1313
BlockCipher &blockCipher = AccessBlockCipher();
14-
1514
blockCipher.SetKey(userKey, keylength, params);
1615

1716
if (blockCipher.BlockSize() != REQUIRED_BLOCKSIZE)

cryptlib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE StreamTransformation : public Algorithm
913913
//! <pre> if (m_cipher.IsLastBlockSpecial())
914914
//! {
915915
//! size_t reserve = 2*m_cipher.MandatoryBlockSize();
916-
//! space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, length, length+reserve);
916+
//! space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, length+reserve);
917917
//! length = m_cipher.ProcessLastBlock(space, length+reserve, inString, length);
918918
//! AttachedTransformation()->Put(space, length);
919919
//! return;

eax.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void EAX_Base::AuthenticateLastHeaderBlock()
3636
{
3737
CRYPTOPP_ASSERT(m_bufferedDataLength == 0);
3838
MessageAuthenticationCode &mac = AccessMAC();
39-
unsigned int blockSize = mac.TagSize();
39+
const unsigned int blockSize = mac.TagSize();
4040

4141
mac.Final(m_buffer);
4242
xorbuf(m_buffer+blockSize, m_buffer, blockSize);

filters.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ void StreamTransformationFilter::LastPut(const byte *inString, size_t length)
690690
if (m_cipher.IsLastBlockSpecial())
691691
{
692692
size_t reserve = 2*m_cipher.MandatoryBlockSize();
693-
space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, length, length+reserve);
693+
space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, length+reserve);
694694
length = m_cipher.ProcessLastBlock(space, length+reserve, inString, length);
695695
AttachedTransformation()->Put(space, length);
696696
return;

0 commit comments

Comments
 (0)