Skip to content

Commit

Permalink
Clear elevated warnings in ARIA and HIGHT
Browse files Browse the repository at this point in the history
Related to fixes from GH #1235 and GH #1234
  • Loading branch information
noloader committed Sep 30, 2023
1 parent 4e09f1e commit 47222de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
7 changes: 0 additions & 7 deletions datatest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,13 +819,6 @@ void TestSymmetricCipherWithInplaceEncryption(TestData &v, const NameValuePairs
}
}

// Most block ciphers don't specify BlockPaddingScheme. Kalyna uses it
// in test vectors. 0 is NoPadding, 1 is ZerosPadding, 2 is PkcsPadding,
// 3 is OneAndZerosPadding, etc. Note: The machinery is wired such that
// paddingScheme is effectively latched. An old paddingScheme may be
// unintentionally used in a subsequent test.
int paddingScheme = pairs.GetIntValueWithDefault(Name::BlockPaddingScheme(), 0);

const std::string plainText = GetDecodedDatum(v, "Plaintext");
const std::string cipherText = GetDecodedDatum(v, "Ciphertext");

Expand Down
16 changes: 8 additions & 8 deletions hight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ void HIGHT::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, b
outBlock[5] = static_cast<byte>(m_xx[6] ^ xorBlock[5]);
outBlock[7] = static_cast<byte>(m_xx[0] ^ xorBlock[7]);

outBlock[0] = static_cast<byte>(m_xx[1] + m_rkey[4] ^ xorBlock[0]);
outBlock[2] = static_cast<byte>(m_xx[3] ^ m_rkey[5] ^ xorBlock[2]);
outBlock[4] = static_cast<byte>(m_xx[5] + m_rkey[6] ^ xorBlock[4]);
outBlock[6] = static_cast<byte>(m_xx[7] ^ m_rkey[7] ^ xorBlock[6]);
outBlock[0] = static_cast<byte>((m_xx[1] + m_rkey[4]) ^ xorBlock[0]);
outBlock[2] = static_cast<byte>((m_xx[3] ^ m_rkey[5]) ^ xorBlock[2]);
outBlock[4] = static_cast<byte>((m_xx[5] + m_rkey[6]) ^ xorBlock[4]);
outBlock[6] = static_cast<byte>((m_xx[7] ^ m_rkey[7]) ^ xorBlock[6]);
}
else
{
Expand Down Expand Up @@ -275,10 +275,10 @@ void HIGHT::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, b
outBlock[5] = static_cast<byte>(m_xx[5] ^ xorBlock[5]);
outBlock[7] = static_cast<byte>(m_xx[7] ^ xorBlock[7]);

outBlock[0] = static_cast<byte>(m_xx[0] - m_rkey[0] ^ xorBlock[0]);
outBlock[2] = static_cast<byte>(m_xx[2] ^ m_rkey[1] ^ xorBlock[2]);
outBlock[4] = static_cast<byte>(m_xx[4] - m_rkey[2] ^ xorBlock[4]);
outBlock[6] = static_cast<byte>(m_xx[6] ^ m_rkey[3] ^ xorBlock[6]);
outBlock[0] = static_cast<byte>((m_xx[0] - m_rkey[0]) ^ xorBlock[0]);
outBlock[2] = static_cast<byte>((m_xx[2] ^ m_rkey[1]) ^ xorBlock[2]);
outBlock[4] = static_cast<byte>((m_xx[4] - m_rkey[2]) ^ xorBlock[4]);
outBlock[6] = static_cast<byte>((m_xx[6] ^ m_rkey[3]) ^ xorBlock[6]);
}
else
{
Expand Down
1 change: 0 additions & 1 deletion modes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ void CFB_ModePolicy::CipherResynchronize(const byte *iv, size_t length)

void CFB_ModePolicy::SetFeedbackSize(unsigned int feedbackSize)
{
CRYPTOPP_ASSERT(feedbackSize >= 0);
CRYPTOPP_ASSERT(feedbackSize <= BlockSize());
if (feedbackSize > BlockSize())
throw InvalidArgument("CFB_Mode: invalid feedback size");
Expand Down

0 comments on commit 47222de

Please sign in to comment.