Commit Graph

3959 Commits

Author SHA1 Message Date
Jeffrey Walton
39b1f60de5
Fix compile under XLC 2018-08-13 00:16:05 -04:00
Jeffrey Walton
e0a35cf18a
Fix compile under XLC 2018-08-13 00:15:06 -04:00
Jeffrey Walton
89476e280d
Cleanup adv-simd.h for ARM 2018-08-12 19:51:50 -04:00
Jeffrey Walton
7f374faf52
Cleanup adv-simd.h for x86 2018-08-12 19:04:14 -04:00
Jeffrey Walton
6c621f91ce
Add POWER8 SIMON-128 implementation
Performance went from about 30 to 40 cpb to 5.5 to 9 cpb, depending on endian-ness
2018-08-12 09:21:09 -04:00
Jeffrey Walton
aa806f3475
Add SPECK-128 provider for POWER8 2018-08-12 04:40:10 -04:00
Jeffrey Walton
3e26437249
Remove debug statement
Thus slipped by during commit 898dab99b8
2018-08-12 04:24:08 -04:00
Jeffrey Walton
898dab99b8
Add POWER8 SPECK-128 implementation
Performance went from about 14 cpb to 2-3 cpb, depending on endian-ness
2018-08-12 04:08:33 -04:00
Jeffrey Walton
dd4f87fa11
Clear IBM XLC warnings on PowerPC 2018-08-12 04:06:06 -04:00
Jeffrey Walton
afe72c50f0
Add VectorSub and VectorSwapWords 2018-08-12 04:05:14 -04:00
Jeffrey Walton
3d6c8d9589
Update comments 2018-08-12 01:12:00 -04:00
Jeffrey Walton
8d62b500cc
Add validat9.cpp to filter list 2018-08-11 23:05:58 -04:00
Jeffrey Walton
d109ce09d0
Update comments and function names
Someone trying to make sense of POWER8 GCM is bound to be confused even with the expanded comments and updated function names
2018-08-11 06:40:21 -04:00
Jeffrey Walton
6993d1d0bd
Update comments 2018-08-11 00:55:52 -04:00
Jeffrey Walton
78d3a279dc
Remove specializations for VectorShiftLeft and VectorShiftRight 2018-08-10 23:29:20 -04:00
Jeffrey Walton
555f4742c7
Fix buffering and unusual tag output due to ostringstream 2018-08-10 06:40:44 -04:00
Jeffrey Walton
94eff2cdd6
Remove INLINE used for debugging
We needed to switch inlining off manually. GDB was not stepping into code for us. No longer needed
2018-08-10 05:19:08 -04:00
Jeffrey Walton
23e0ee44a0
Cleanup GCM code
I always thought the SSE code in GCM_ReverseHashBufferIfNeeded_CLMUL was a wart
2018-08-10 04:42:30 -04:00
Jeffrey Walton
1c224c8798
Switch to vector shifts instead of vector merge 2018-08-10 04:27:49 -04:00
Jeffrey Walton
a2a520e5b9
Cleanup GCM mode 2018-08-10 01:57:14 -04:00
Jeffrey Walton
8c21b6af05
Use shifts for VectorGetLow 2018-08-10 01:25:59 -04:00
Jeffrey Walton
eddc357981
Use shifts for VectorGetLow 2018-08-10 01:24:32 -04:00
Jeffrey Walton
b44de10e18
Cleanup Aarch64 GCM mode 2018-08-10 01:00:26 -04:00
Jeffrey Walton
9f2d65409a
Add POWER8 GCM mode (GH #698)
Commit 3ed38e42f6 added the POWER8 infrastructure for GCM mode. It also added GCM_SetKeyWithoutResync_VMULL, GCM_Multiply_VMULL and GCM_Reduce_VMULL. This commit adds the remainder, which includes GCM_AuthenticateBlocks_VMULL.
GCC is OK on Linux (ppc64-le) and AIX (ppc64-be). We may need some touchups for XLC compiler
2018-08-09 23:28:49 -04:00
Jeffrey Walton
989c3bfbf2
Update comments 2018-08-09 18:18:40 -04:00
Jeffrey Walton
99ab11d1ed
Add TestAltivecOps for Debug builds 2018-08-09 17:23:35 -04:00
Jeffrey Walton
1b5422eb49
Update documentation 2018-08-09 08:16:46 -04:00
Jeffrey Walton
3ed38e42f6
Add POWER8 GCM mode (GH #698)
GCM_SetKeyWithoutResync_VMULL, GCM_Multiply_VMULL and GCM_Reduce_VMULL work as expected on Linux (ppc64-le) and AIX (ppc64-be). We are still working on GCM_AuthenticateBlocks_VMULL.
2018-08-09 08:09:13 -04:00
Jeffrey Walton
5b89e774cc Add Altivec vector extraction tests 2018-08-09 00:06:42 -04:00
Jeffrey Walton
13b6dac31d
Remove temporary variable 2018-08-08 21:48:07 -04:00
Jeffrey Walton
ce5b6c9e23
Fix return value for Altivec VectorLoad 2018-08-08 21:31:25 -04:00
Jeffrey Walton
048c2721fb
Remove unneeded defines from cpu.cpp 2018-08-08 20:55:00 -04:00
Jeffrey Walton
bcf05a6c6b
Add additional PowerPC self tests 2018-08-08 20:52:50 -04:00
Jeffrey Walton
0464641069
Remove unneeded enum from VectorShiftLeftVectorShiftRight 2018-08-08 20:17:14 -04:00
Jeffrey Walton
00e7d02a8a
Fix Altive VectorStore on little-endian
Remove unneeded VectorLeftShift(a,b) and VectorRightShift(a,b)
2018-08-08 19:59:14 -04:00
Jeffrey Walton
96405e14ec
Fix VectorShiftRight on PowerPC 2018-08-08 05:06:58 -04:00
Jeffrey Walton
4c30f57d1b
Update comments 2018-08-06 23:04:10 -04:00
Jeffrey Walton
d4428d7f1c
Add VectorLoad and VectorStore test code
Applies to POWER4 and above only
2018-08-06 22:19:59 -04:00
Jeffrey Walton
a4ebb75538
Update comments 2018-08-06 18:37:25 -04:00
Jeffrey Walton
194307308c
Cleanup VPMSUM probes 2018-08-06 18:06:32 -04:00
Jeffrey Walton
2ec9c9963c
Update documentation 2018-08-06 06:47:57 -04:00
Jeffrey Walton
9ff731824b
Prepare for POWER8 carryless multiplies using vpmsum 2018-08-06 05:40:38 -04:00
Jeffrey Walton
6cd7f83346
Cleanup PPC vector functions
The Crypto++ functions follow IBM's lead and provide VectorLoad, VectorLoadBE, VectorStore, and VectorStoreBE. Additionally, VectorLoadKey was removed in favor of vanilla VectorLoad.
2018-08-06 05:15:12 -04:00
Jeffrey Walton
9c27143522
Whitespace check-in 2018-08-05 13:31:25 -04:00
Jeffrey Walton
58b7abe106
Update comments 2018-08-05 12:32:36 -04:00
Jeffrey Walton
1dd0e321a6
Rework Makefile and ppc-simd.h for XLC and LLVM front-end changes 2018-08-05 05:39:42 -04:00
Tanzinul Islam
da00422d3c Fix build with Embarcadero C++Builder 10.2.3 (#696)
Fix two compilation errors encountered with C++Builder (Starter Edition):

 - In `cpu.cpp`, 0ccdc197b introduced a dependency on `_xgetbv()` from `<immintrin.h>` that doesn't exist on C++Builder. Enlist it for the workaround, similar to SunCC in 692ed2a2b.

 - In `adv-simd.h`, `<pmmintrin.h>` is being #included under the `CRYPTOPP_SSE2_INTRIN_AVAILABLE` macro. This header, [which apparently provides SSE3 intrinsics](https://stackoverflow.com/a/11228864/1433768), is not shipped with C++Builder. (This section of code was recently downgraded from a SSSE3 to a SSE2 block in 09c8ae28, followed by moving away from `<immintrin.h>` in bc8da71a, followed by reintroducing the SSSE3 check in d1e646a5.) Split the SSE2 and SSSE3 cases such that `<pmmintrin.h>` is not #included for SSE2. This seems safe to do, because some `git grep` analysis shows that:
    - `adv-simd.h` is not #included by any other header, but only directly #included by some `.cpp` files.
    - Among those `.cpp` files, only `sm4-simd.cpp` has a `CRYPTOPP_SSE2_INTRIN_AVAILABLE` preprocessor block, and there it again includes the other two headers (`<emmintrin.h>` and `<xmmintrin.h>`).

NOTE: I was compiling via the IDE after [setting up a project file](https://github.com/tanzislam/cryptopals/wiki/Importing-into-Embarcadero-C%E2%94%BC%E2%94%BCBuilder-Starter-10.2#using-the-crypto-library). My compilation command was effectively:

```
bcc32c.exe -DCRYPTOPP_NO_CXX11 -DCRYPTOPP_DISABLE_SSSE3 -D__SSE2__ -D__SSE__ -D__MMX__
```
2018-08-04 22:54:36 -04:00
Jeffrey Walton
e82ee1c6f0
Fix typo in SM4 recipe on PowerPC 2018-08-04 20:28:31 -04:00
Jeffrey Walton
aee00b69ad
Clean *.lst files created by XLC 2018-08-04 20:18:50 -04:00
Jeffrey Walton
9ce1648f83
Update comments 2018-08-03 16:16:08 -04:00