summaryrefslogtreecommitdiff
path: root/rijndael.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-09-05 16:28:00 -0400
committerJeffrey Walton <noloader@gmail.com>2017-09-05 16:28:00 -0400
commit37e02f9e0e2ee627f0f95b7bc0a09f4ba1ce562e (patch)
treec8b8cc1e9b0b56998eed479f29aa6f3da33f1755 /rijndael.cpp
parent23b939c62b7f497d6f99bfe97ad639b35287ac61 (diff)
downloadcryptopp-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 'rijndael.cpp')
-rw-r--r--rijndael.cpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/rijndael.cpp b/rijndael.cpp
index 81576cdb..3c2a2cad 100644
--- a/rijndael.cpp
+++ b/rijndael.cpp
@@ -220,15 +220,6 @@ void Rijndael::Base::FillDecTable()
s_TdFilled = true;
}
-unsigned int Rijndael::Base::OptimalDataAlignment() const
-{
-#if CRYPTOPP_BOOL_ALIGN16
- return 16;
-#else
- return GetAlignmentOf<word32>();
-#endif
-}
-
#if (CRYPTOPP_AESNI_AVAILABLE)
extern void Rijndael_UncheckedSetKey_SSE4_AESNI(const byte *userKey, size_t keyLen, word32* rk);
extern void Rijndael_UncheckedSetKeyRev_AESNI(word32 *key, unsigned int rounds);
@@ -351,11 +342,6 @@ void Rijndael::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLen, c
void Rijndael::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
{
- CRYPTOPP_ASSERT(IsAlignedOn( m_key, OptimalDataAlignment()));
- CRYPTOPP_ASSERT(IsAlignedOn( inBlock, OptimalDataAlignment()));
- CRYPTOPP_ASSERT(IsAlignedOn(xorBlock, OptimalDataAlignment()));
- CRYPTOPP_ASSERT(IsAlignedOn(outBlock, OptimalDataAlignment()));
-
#if CRYPTOPP_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) || CRYPTOPP_AESNI_AVAILABLE
# if (CRYPTOPP_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_RIJNDAEL_ASM)
if (HasSSE2())
@@ -446,11 +432,6 @@ void Rijndael::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock
void Rijndael::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
{
- CRYPTOPP_ASSERT(IsAlignedOn( m_key, OptimalDataAlignment()));
- CRYPTOPP_ASSERT(IsAlignedOn( inBlock, OptimalDataAlignment()));
- CRYPTOPP_ASSERT(IsAlignedOn(xorBlock, OptimalDataAlignment()));
- CRYPTOPP_ASSERT(IsAlignedOn(outBlock, OptimalDataAlignment()));
-
#if CRYPTOPP_AESNI_AVAILABLE
if (HasAESNI())
{
@@ -1098,11 +1079,6 @@ Rijndael::Enc::Enc() { }
#if CRYPTOPP_ENABLE_ADVANCED_PROCESS_BLOCKS
size_t Rijndael::Enc::AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const
{
- CRYPTOPP_ASSERT(IsAlignedOn( m_key, OptimalDataAlignment()));
- CRYPTOPP_ASSERT(IsAlignedOn( inBlocks, OptimalDataAlignment()));
- CRYPTOPP_ASSERT(IsAlignedOn(xorBlocks, OptimalDataAlignment()));
- CRYPTOPP_ASSERT(IsAlignedOn(outBlocks, OptimalDataAlignment()));
-
#if CRYPTOPP_AESNI_AVAILABLE
if (HasAESNI())
return Rijndael_Enc_AdvancedProcessBlocks_AESNI(m_key, m_rounds, inBlocks, xorBlocks, outBlocks, length, flags);
@@ -1166,11 +1142,6 @@ size_t Rijndael::Enc::AdvancedProcessBlocks(const byte *inBlocks, const byte *xo
size_t Rijndael::Dec::AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const
{
- CRYPTOPP_ASSERT(IsAlignedOn( m_key, OptimalDataAlignment()));
- CRYPTOPP_ASSERT(IsAlignedOn( inBlocks, OptimalDataAlignment()));
- CRYPTOPP_ASSERT(IsAlignedOn(xorBlocks, OptimalDataAlignment()));
- CRYPTOPP_ASSERT(IsAlignedOn(outBlocks, OptimalDataAlignment()));
-
#if CRYPTOPP_AESNI_AVAILABLE
if (HasAESNI())
return Rijndael_Dec_AdvancedProcessBlocks_AESNI(m_key, m_rounds, inBlocks, xorBlocks, outBlocks, length, flags);