Clear elevated warnings in ARIA and HIGHT

Related to fixes from GH #1235 and GH #1234
This commit is contained in:
Jeffrey Walton 2023-09-30 13:52:56 -04:00
parent 4e09f1e436
commit 47222de4b7
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
3 changed files with 8 additions and 16 deletions

View File

@ -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");

View File

@ -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
{
@ -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
{

View File

@ -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");