summaryrefslogtreecommitdiff
path: root/strciphr.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-07-12 07:05:18 -0400
committerJeffrey Walton <noloader@gmail.com>2018-07-12 07:05:18 -0400
commite580ed588a1c8372a3e54f8081356f64cce53888 (patch)
treee43f679c2ce20a075862e335760c5559eef08a79 /strciphr.cpp
parent7eb0535a98f2c3548ef93d62f7a00de138bac4bc (diff)
downloadcryptopp-git-e580ed588a1c8372a3e54f8081356f64cce53888.tar.gz
Disable same buffer for in and out on ARM A-32 (GH #683)
Diffstat (limited to 'strciphr.cpp')
-rw-r--r--strciphr.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/strciphr.cpp b/strciphr.cpp
index 73d7d698..3f3bbc10 100644
--- a/strciphr.cpp
+++ b/strciphr.cpp
@@ -195,6 +195,8 @@ void CFB_CipherTemplate<BASE>::ProcessData(byte *outString, const byte *inString
if (!length) {return;}
}
+ // TODO: Figure out what is happening on ARM A-32. x86, Aarch64 and PowerPC are OK.
+#if !defined(__arm__)
if (policy.CanIterate() && length >= bytesPerIteration && IsAlignedOn(outString, alignment))
{
const CipherDir cipherDir = GetCipherDir(*this);
@@ -202,7 +204,9 @@ void CFB_CipherTemplate<BASE>::ProcessData(byte *outString, const byte *inString
policy.Iterate(outString, inString, cipherDir, length / bytesPerIteration);
else
{
- // GCC and Clang does not like this on ARM.
+ // GCC and Clang does not like this on ARM. If we create
+ // an aligned temp input buffer, memcpy inString to it,
+ // and then use the temp input then things are [mostly] OK.
memcpy(outString, inString, length);
policy.Iterate(outString, outString, cipherDir, length / bytesPerIteration);
}
@@ -210,6 +214,7 @@ void CFB_CipherTemplate<BASE>::ProcessData(byte *outString, const byte *inString
outString = PtrAdd(outString, length - length % bytesPerIteration);
length %= bytesPerIteration;
}
+#endif
while (length >= bytesPerIteration)
{