diff options
author | Jeffrey Walton <noloader@gmail.com> | 2017-09-05 16:28:00 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2017-09-05 16:28:00 -0400 |
commit | 37e02f9e0e2ee627f0f95b7bc0a09f4ba1ce562e (patch) | |
tree | c8b8cc1e9b0b56998eed479f29aa6f3da33f1755 /cmac.cpp | |
parent | 23b939c62b7f497d6f99bfe97ad639b35287ac61 (diff) | |
download | cryptopp-git-37e02f9e0e2ee627f0f95b7bc0a09f4ba1ce562e.tar.gz |
Revert AltiVec and Power8 commits
The strategy of "cleanup under-aligned buffers" is not scaling well. Corner cases are still turing up. The library has some corner-case breaks, like old 32-bit Intels. And it still has not solved the AltiVec and Power8 alignment problems.
For now we are backing out the changes and investigating other strategies
Diffstat (limited to 'cmac.cpp')
-rw-r--r-- | cmac.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
@@ -77,8 +77,7 @@ void CMAC_Base::Update(const byte *input, size_t length) return;
BlockCipher &cipher = AccessCipher();
- const unsigned int blockSize = cipher.BlockSize();
- const unsigned int alignment = cipher.OptimalDataAlignment();
+ unsigned int blockSize = cipher.BlockSize();
if (m_counter > 0)
{
@@ -101,20 +100,7 @@ void CMAC_Base::Update(const byte *input, size_t length) if (length > blockSize)
{
CRYPTOPP_ASSERT(m_counter == 0);
- const byte* is = input; // m_reg is always aligned
-
- AlignedSecByteBlock i;
- if (!IsAlignedOn(input, alignment))
- {
- i.Assign(input, length);
- is = i.begin();
- }
-
- // size_t leftOver = 1 + cipher.AdvancedProcessBlocks(m_reg, input, m_reg, length-1,
- // BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput);
- const int flags = BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput;
- size_t leftOver = 1 + cipher.AdvancedProcessBlocks(m_reg, is, m_reg, length-1, flags);
-
+ size_t leftOver = 1 + cipher.AdvancedProcessBlocks(m_reg, input, m_reg, length-1, BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput);
input += (length - leftOver);
length = leftOver;
}
|