diff options
author | Jeffrey Walton <noloader@gmail.com> | 2018-07-11 11:40:25 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-07-11 11:40:25 -0400 |
commit | b3fe24b8b558fba0f32e24bc095b4e6b24528385 (patch) | |
tree | 8b225296e1ca40d88f9107097f4b85b726e95a08 /validat1.cpp | |
parent | 1e77a72ed6ed6dc88cb7a8443899e3fa11fd0c78 (diff) | |
download | cryptopp-git-b3fe24b8b558fba0f32e24bc095b4e6b24528385.tar.gz |
Remove CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS support (GH #682)
We were able to gut CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS for everything except Rijndael. Rijndael uses unaligned accesses on x86 to harden against timing attacks.
There's a little more to CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS and Rijndael. If we remove unaligned access then AliasedWithTable hangs in an endless loop on non-AESNI machines. So care must be taken when trying to remove the vestige from Rijndael.
Diffstat (limited to 'validat1.cpp')
-rw-r--r-- | validat1.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/validat1.cpp b/validat1.cpp index 16b5fa92..77dba93f 100644 --- a/validat1.cpp +++ b/validat1.cpp @@ -281,19 +281,8 @@ bool TestSettings() std::cout << "Library version (library): " << v1 << ", header version (app): " << v2 << "\n";
#endif
-#ifdef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS
- // Don't assert the alignment of testvals. That's what this test is for.
- byte testvals[10] = {1,2,2,3,3,3,3,2,2,1};
- if (*(word32 *)(void *)(testvals+3) == 0x03030303 && *(word64 *)(void *)(testvals+1) == W64LIT(0x0202030303030202))
- std::cout << "passed: Unaligned data access (CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS).\n";
- else
- {
- std::cout << "FAILED: Unaligned data access gave incorrect results.\n";
- pass = false;
- }
-#else
- std::cout << "passed: Aligned data access (no CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS).\n";
-#endif
+ // CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS removed at Issue 682.
+ std::cout << "passed: Aligned data access.\n";
if (sizeof(byte) == 1)
std::cout << "passed: ";
|