Commit Graph

3212 Commits

Author SHA1 Message Date
Jeffrey Walton
3bd01f73ba
Add Power8 SHA256 and SHA512 support (GH #513) 2017-09-22 08:58:50 -04:00
Jeffrey Walton
375d5e18b3
Clear Doxygen warnings 2017-09-22 08:09:05 -04:00
Jeffrey Walton
8b2bf5ed88 Add Power8 SHA support
This provides the functions needed for an implementation. It does not provide the implementation itself

Signed-off-by: Jeffrey Walton <noloader@gmail.com>
2017-09-22 07:44:18 -04:00
Jeffrey Walton
2f1b60676f
Remove static from functions
Static was an artifact from being in rijndael-simd.cpp
2017-09-22 06:42:05 -04:00
Jeffrey Walton
e725ebadd0
Fix Power8 compile error on AIX with XL C/C++
Add documentation
2017-09-22 06:20:19 -04:00
Jeffrey Walton
1057f89363
Move Power8 crypto functions into ppc-crypto.h 2017-09-22 05:23:29 -04:00
Jeffrey Walton
3e55817819
Add C++ templates for additional Vector ops
Removed lower-level C-like functions such as Store8x16 and Store64x2
2017-09-22 04:15:33 -04:00
Jeffrey Walton
441e944a66
Switch to vec_vsx_ld, remove unaligned loads
Partially unroll loop Rijndael_UncheckedSetKey_POWER8 loop. It saves about another 60 cycles
2017-09-22 02:53:08 -04:00
Jeffrey Walton
d9592a303c
Updated comments 2017-09-21 21:45:23 -04:00
Jeffrey Walton
dabad4b409
Cleanup asserts and casts 2017-09-21 20:55:35 -04:00
Jeffrey Walton
1edea5a80f
Vectorize tail of Rijndael_UncheckedSetKey_POWER8 2017-09-21 20:02:40 -04:00
Jeffrey Walton
e43c0eee74
Fold ConditionalByteReverse for non-Power8 paths 2017-09-21 19:17:42 -04:00
Jeffrey Walton
f763bf3da6
Updated comments 2017-09-21 12:08:54 -04:00
Jeffrey Walton
e78464a1af
Enable little endian Rijndael_UncheckedSetKey_POWER8 using built-ins
The problem was vec_sld is endian sensitive. The built-in required more than us setting up arguments to ensure the vsx load resulted in a big endian value. Thanks to Paul R on Stack Overflow for sharing the information that IBM did not provide. Also see http://stackoverflow.com/q/46341923/608639
2017-09-21 09:56:37 -04:00
Jeffrey Walton
dfeae9e983
Guard compile assert for Borland/Embarcadero (GH #512) 2017-09-21 02:01:04 -04:00
Jeffrey Walton
c6b096ddd4
Move Rijndael_UncheckedSetKey_POWER8 prior to GetUserKey call
Arg... GetUserKey was performing a 32-bit word reverse. It was part of the problem on little endian machines
2017-09-21 01:08:44 -04:00
Jeffrey Walton
9fd5d023f9
Load r5 mask once for key expansion 2017-09-20 20:27:58 -04:00
Jeffrey Walton
e4498a105e
Use ::time() and ::log() instead of std::time() and std::log() (GH #512)
The 35c0fa82fd change broke GCC 4.8
2017-09-20 18:43:51 -04:00
Jeffrey Walton
4b7549a990
Use 'static const int' for constant Borland/Embarcadero (GH #512) 2017-09-20 18:18:51 -04:00
Jeffrey Walton
35c0fa82fd
Use <time.h> for Borland/Embarcadero (GH #512) 2017-09-20 18:10:07 -04:00
Jeffrey Walton
c5a427d690
Add PowerPC VectorLoadKeyUnaligned for AES-192
Make internal functions static. We get better optimizations depsice using unnamed namespaces
Add PowerPC uint32x4 functions for handling 32-bit rcon and mask
2017-09-20 08:57:53 -04:00
Jeffrey Walton
c94d076aa1 Move r1 write to caller; remove from Rijndael_Subkey_POWER8
Signed-off-by: Jeffrey Walton <noloader@gmail.com>
2017-09-20 04:38:53 -04:00
Jeffrey Walton
5159d0803d
Add Power8 key expansion for big endian
This is AES-128 key expansion for big endian. Little endian has a bug in it so it can't be enabled at the moment. GDB is acting up on GCC112, so I've had trouble investigating it
2017-09-20 03:34:54 -04:00
Jeffrey Walton
6102333fc3
Add CRYPTOPP_NO_CPU_FEATURE_PROBES (GH #511)
We determine machine capabilities by performing an os/platform *query* first, like getauxv(). If the *query* fails, we move onto a cpu *probe*. The cpu *probe* tries to exeute an instruction and then catches a SIGILL on Linux or the exception EXCEPTION_ILLEGAL_INSTRUCTION on Windows. Some OSes fail to hangle a SIGILL gracefully, like Apple OSes. Apple machines corrupt memory and variables around the probe.
2017-09-19 21:08:37 -04:00
Jeffrey Walton
6440921723
Add Rijndael_UncheckedSetKey_POWER8
We are going to attempt to perform key setup using Power8 in-core vector instructions
2017-09-19 04:55:15 -04:00
Jeffrey Walton
3290711a82
Clear duplicate symbol warning from AIX linker 2017-09-18 21:05:26 -04:00
Jeffrey Walton
923cf95571
ByteReverseArray → ReverseByteArrayLE 2017-09-18 18:40:19 -04:00
Jeffrey Walton
2c18fe8af8
Refactor LoadT() and StoreT(). Add separate ReverseT() for little endian machines
The refactoring has no effect on little endian machines. However, on big endian GCC119 using GCC 7.1 the performance improved by 2.5x for ECB and CTR modes:

BEFORE:

<TR><TH>AES/CTR (128-bit key)<TD>2723<TD>1.4<TD>0.163<TD>670
<TR><TH>AES/CTR (192-bit key)<TD>2560<TD>1.5<TD>0.175<TD>719
<TR><TH>AES/CTR (256-bit key)<TD>2728<TD>1.4<TD>0.183<TD>749
<TR><TH>AES/CBC (128-bit key)<TD>1204<TD>3.2<TD>0.135<TD>554
<TR><TH>AES/CBC (192-bit key)<TD>1066<TD>3.7<TD>0.148<TD>605
<TR><TH>AES/CBC (256-bit key)<TD>948<TD>4.1<TD>0.155<TD>635
<TR><TH>AES/OFB (128-bit key)<TD>1019<TD>3.8<TD>0.158<TD>648
<TR><TH>AES/CFB (128-bit key)<TD>949<TD>4.1<TD>0.192<TD>787
<TR><TH>AES/ECB (128-bit key)<TD>3564<TD>1.1<TD>0.082<TD>337

AFTER:

<TR><TH>AES/CTR (128-bit key)<TD>6484<TD>0.6<TD>0.163<TD>677
<TR><TH>AES/CTR (192-bit key)<TD>5641<TD>0.7<TD>0.176<TD>728
<TR><TH>AES/CTR (256-bit key)<TD>5005<TD>0.8<TD>0.183<TD>761
<TR><TH>AES/CBC (128-bit key)<TD>1223<TD>3.2<TD>0.135<TD>559
<TR><TH>AES/CBC (192-bit key)<TD>1080<TD>3.7<TD>0.147<TD>611
<TR><TH>AES/CBC (256-bit key)<TD>966<TD>4.1<TD>0.155<TD>642
<TR><TH>AES/OFB (128-bit key)<TD>1057<TD>3.7<TD>0.158<TD>656
<TR><TH>AES/CFB (128-bit key)<TD>1217<TD>3.3<TD>0.186<TD>774
<TR><TH>AES/ECB (128-bit key)<TD>7289<TD>0.5<TD>0.082<TD>342
2017-09-18 18:15:25 -04:00
Jeffrey Walton
1661ff127a
Fix dead code strip test on AIX 2017-09-18 02:45:03 -04:00
Jeffrey Walton
cc855dd181
Update cryptest-android.sh file with LLVM 2017-09-18 02:26:50 -04:00
Jeffrey Walton
f0c2324f6b
Fix armeabi and armv7-a for Android (GH #509) 2017-09-17 20:07:53 -04:00
Jeffrey Walton
09f1a2fb38
Add i686 and x86_64 specific flags (GH #508) 2017-09-17 15:33:41 -04:00
Deadpikle
723d87c9b5 Make sure _SC_LEVEL1_DCACHE_LINESIZE is defined (#507) 2017-09-17 14:34:05 -04:00
Jeffrey Walton
7097546cfc
Fix "X causes a section type conflict with Y" for GCC on AIX (GH #499)
These surfaced during testing with cryptest.sh
2017-09-17 07:08:14 -04:00
Jeffrey Walton
3e237540fe
Query sysconf for _SC_LEVEL1_DCACHE_LINESIZE on ARM and PPC 2017-09-17 02:39:41 -04:00
Jeffrey Walton
a835443b34
Fix compile on CentOS 6 with GCC 4.7
The system uses Glibc 2.12, which is below 2.16 required for getauxv
2017-09-17 00:41:48 -04:00
Jeffrey Walton
8f6afb3079
Fix -pipe warning under SunCC 2017-09-16 22:09:50 -04:00
Jeffrey Walton
f3c04dbcb7
Remove CMake testing support (GH #506)
CMake can now be found at http://www.cryptopp.com/wiki/CMake. The Cmake project files are now maintianed by the community.
2017-09-16 21:23:35 -04:00
Jeffrey Walton
913a9e60d3
Remove CMake from library sources (GH #506)
CMake can now be found at http://www.cryptopp.com/wiki/CMake. The Cmake project files are now maintianed by the community.
2017-09-16 21:09:40 -04:00
Jeffrey Walton
1c740b0a09
Add sunset message to CMakeList.txt file
The commit also attempts to avoid the shell command for Windows machines.
If no one has patches to offer for the outstanding CMake bugs, then this is the version that will be moved to the Wiki Patch Page. The community will have to tend to the outstanding bugs when someone with domain experience can work them
2017-09-16 18:33:07 -04:00
Jeffrey Walton
da0dc66952
Route Borland/Embarcadero into MS inline ASM code for CPUID
The inline ASM code now uses local variables to save the EAX-EDX registers, and then copies the locals into the function parameters. It side steps problems with calling conventions
2017-09-16 18:03:24 -04:00
Jeffrey Walton
7464cbba51
Update README to sync with Crypto++ website
* Switch from cryptolounge.com to Crypto++ wiki
* Add latest algorithms
2017-09-16 16:30:32 -04:00
Jeffrey Walton
30d519c0bc
Use -O3 for IBM XL C/C++ (GH #502)
We held back XL C/C++ due to warnings and self test failures. Since clearing Issue 502, we are OK for -O3 so we can live with the warnings.
2017-09-16 08:22:25 -04:00
Jeffrey Walton
fc0867827e
Fix TEA and XTE hand with IBM XL C/C++ compiler (GH #503)
It looks like Sun compilers had problems with the loop in the past, too. The Sun workarounds did not help with XL C/C++, however.
2017-09-16 08:20:35 -04:00
Jeffrey Walton
4670e3d5bc Revert "Use -O3 for IBM XL C/C++ (GH #502)"
This reverts commit aa348abd15. It caused a hang in the TEA algorithm. Also see GH #503.
2017-09-16 05:55:37 -04:00
Jeffrey Walton
aa348abd15
Use -O3 for IBM XL C/C++ (GH #502)
We held back XL C/C++ due to warnings and self test failures. Since clearing Issue 502, we are OK for -O3 so we can live with the warnings.
2017-09-16 02:19:06 -04:00
Jeffrey Walton
205ebe0871
Add missing newline to IA-32 config output
Avoid flushing stream for config line items
Use memcpy in std:: namespace
2017-09-16 01:36:45 -04:00
Jeffrey Walton
2814842b97
Switch to CRYPTOPP_CONSTANT for cpu flags 2017-09-16 01:21:14 -04:00
Jeffrey Walton
5296e087ad
Fix func/subfunc parameter names (GH #502) 2017-09-16 00:19:14 -04:00
Jeffrey Walton
7bdb62b336
Fix bad SHA152 hash under IBM XL C/C++ compiler (GH #502) 2017-09-15 18:33:05 -04:00