Commit Graph

2980 Commits (cfb63decec771d660394d7fbf8b5c7b566a09232)

Author SHA1 Message Date
Jeffrey Walton cfb63decec
Guard probe functions
This broke Aarch64
2017-09-12 05:49:38 -04:00
Jeffrey Walton d748d4cfbe
Update header guards for x86 2017-09-12 05:39:33 -04:00
Jeffrey Walton 17bf824790
Guard <arm_acle.h> include for GCC 4.8
Use system includes for <arm_neon.h> and <arm_acle.h>
2017-09-12 05:29:51 -04:00
Jeffrey Walton 81a272b046
Update comments 2017-09-12 00:30:48 -04:00
Jeffrey Walton 7fb34e9b08
Add Power8 AES encryption
This is the forward direction on encryption only.  Crypto++ uses the "Equivalent Inverse Cipher" (FIPS-197, Section 5.3.5, p.23), and it is not compatible with IBM hardware. The library library will need to re-work the decryption key scheduling routines. (We may be able to work around it another way, but I have not investigated it).
2017-09-11 22:52:22 -04:00
Jeffrey Walton 9c9d5ebe87
Undef vector, bool and pixel 2017-09-11 22:39:59 -04:00
Jeffrey Walton 120b415e27
Clear compile error on AIX
Truncation due to -1
2017-09-11 04:10:02 -04:00
Jeffrey Walton e2072ae635
Update documentation 2017-09-11 03:43:37 -04:00
Jeffrey Walton fb78afba29
Add PowerPC support to cpu.h and validate.cpp 2017-09-11 03:05:04 -04:00
Jeffrey Walton 9276b95221
Add Power8 support to Makefile 2017-09-09 20:33:06 -04:00
Jeffrey Walton 66c84a9af4
Fix failed feature detections under IBM XL C/C++ compiler 2017-09-09 18:44:08 -04:00
Jeffrey Walton ba569b55ca
Reduce IBM XL C/C++ compiler to -O2
Early versions of IBM XL C/C++ for AIX, V13.1 fail some self tests, like TEA and XTEA
2017-09-09 17:22:42 -04:00
Jeffrey Walton e6f19111e0
Fix IBM XL C/C++ compiler version output in test script 2017-09-09 16:26:16 -04:00
Jeffrey Walton 263c38d681
Avoid pthread gear for IBM XL C/C++ compiler on AIX 2017-09-09 16:25:15 -04:00
Jeffrey Walton 38de6b0436
Fix RTTI and PIC under IBM XL C/C++ on AIX 2017-09-09 16:24:01 -04:00
Jeffrey Walton b974c7f98e
Avoid -pipe for IBM XL C/C++ compiler 2017-09-09 15:10:32 -04:00
Jeffrey Walton 2118ce8fea
Add Power8 support to cryptest.sh 2017-09-09 14:56:47 -04:00
Deadpikle 3771bc1305 Check for old vs new LLVM include dir (#492) 2017-09-08 21:28:24 -04:00
Deadpikle b14d65850d Fix missing header for Android cpu features (#489)
Thank you very much.
2017-09-08 15:43:06 -04:00
Jeffrey Walton b6f79af343
Clear GCC warnings with -Wall -Wextra 2017-09-05 18:03:46 -04:00
Jeffrey Walton f19b23d5b5
Clear GCC warnings with -Wall -Wextra 2017-09-05 16:50:23 -04:00
Jeffrey Walton 09023bf45e
Align buffers for Poly1305 and VMAC 2017-09-05 16:43:29 -04:00
Jeffrey Walton 37e02f9e0e
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
2017-09-05 16:28:00 -04:00
Jeffrey Walton 23b939c62b
Clear warnings under GCC with -Wall -Wextra 2017-09-05 12:23:12 -04:00
Jeffrey Walton b0f3b8ce17
Aligned buffers in AuthenticatedSymmetricCipherBase 2017-09-04 20:36:43 -04:00
Jeffrey Walton b18f74130b
Aligned buffers in CTR mode 2017-09-04 20:36:08 -04:00
Jeffrey Walton e2933070b6
Removed alignment asserts
Rijndael class will assert when it detects a problem.
2017-09-04 20:35:15 -04:00
Jeffrey Walton efe88c043b
Use aligned buffer for datatest.cpp 2017-09-04 20:07:47 -04:00
Jeffrey Walton a2223356b0
Use aligned buffer for CMAC 2017-09-04 19:49:45 -04:00
Jeffrey Walton d0eefdf32a
Use aligned buffer for Poly1305 nonce 2017-09-04 19:28:19 -04:00
Jeffrey Walton fe0a5ee8e8
Warn of under-aligned buffers when using AES in debug mode
This commit supports the upcoming AltiVec and Power8 processor. This commit affects a number of classes due to the ubiquitous use of AES. The commit adds debug asserts to warn of under-aligned and misaligned buffers in debug builds.
2017-09-04 12:01:44 -04:00
Jeffrey Walton 75aef9bded
Fixup under-aligned buffers when using AES on AltiVec and Power8
This commit supports the upcoming AltiVec and Power8 processor. This commit affects a number of classes due to the ubiquitous use of AES. The commit provides the data alignment requirements.
2017-09-04 11:21:47 -04:00
Jeffrey Walton 32cc92e048
Fixup under-aligned buffers for stream ciphers on AltiVec and Power8
This commit supports the upcoming AltiVec and Power8 processor support for stream ciphers. This commit affects GlobalRNG() most because its an AES-based generator. The commit favors AlignedSecByteBlock over SecByteBlock in places where messages are handled on the AltiVec and Power8 processor data paths. The data paths include all block cipher modes of operation, and some filters like FilterWithBufferedInput.

Intel and ARM processors are tolerant of under-aligned buffers when using crypto instructions. AltiVec and Power8 are less tolerant, and they simply ignore the three low-order bits to ensure an address is aligned. The AltiVec and Power8 have caused a fair number of wild writes on the stack and in the heap.

Testing on a 64-bit Intel Skylake show a marked improvement in performance. We suspect GCC is generating better code since it knows the alignment of the pointers, and does not have to emit fixup code for under-aligned and mis-aligned data. Testing on an mid-2000s 32-bit VIA C7-D with SSE2+SSSE3 showed no improvement, and no performance was lost.
2017-09-04 11:03:10 -04:00
Jeffrey Walton 6b1a56cf72
Fixup under-aligned buffers for DefaultEncryptors and DefaultDecryptors on AltiVec and Power8
This commit supports the upcoming AltiVec and Power8 processor support for DefaultEncryptors and DefaultDecryptors. The commit favors AlignedSecByteBlock over SecByteBlock in places where messages are handled on the AltiVec and Power8 processor data paths. The data paths include all block cipher modes of operation, and some filters like FilterWithBufferedInput.

Intel and ARM processors are tolerant of under-aligned buffers when using crypto intstructions. AltiVec and Power8 are less tolerant, and they simply ignore the three low-order bits to ensure an address is aligned. The AltiVec and Power8 have caused a fair number of wild writes on the stack and in the heap.

Testing on a 64-bit Intel Skylake show a marked improvement in performance. We suspect GCC is generating better code since it knows the alignment of the pointers, and does not have to emit fixup code for under-aligned and mis-aligned data. Testing on an mid-2000's 32-bit VIA C7-D with SSE2+SSSE3 showed no improvement, and no performance was lost.
2017-09-04 10:47:55 -04:00
Jeffrey Walton 9c2a1c74fe
Fixup under-aligned buffers for AltiVec and Power8
This commit supports the upcoming AltiVec and Power8 processor support. The commit favors AlignedSecByteBlock over SecByteBlock in places where messages are handled on the AltiVec and Power8 processor data paths. The data paths include all block cipher modes of operation, and some filters like

Intel and ARM processors are tolerant of under-aligned buffers when using crypto intstructions. AltiVec and Power8 are less tolerant, and they simply ignore the three low-order bits to ensure an address is aligned. The AltiVec and Power8 have caused a fair number of wild writes on the stack and in the heap.

Testing on a 64-bit Intel Skylake show a marked improvement in performance. We suspect GCC is generating better code since it knows the alignment of the pointers, and does not have to emit fixup code for under-aligned and mis-aligned data. Here are some data points:

  SecByteBlock
    - Poly1305: 3.4 cpb
    - Blake2s: 6.7 cpb
    - Blake2b: 4.5 cpb
    - SipHash-2-4: 3.1 cpb
    - SipHash-4-8: 3.5 cpb
    - ChaCha20: 7.4 cpb
    - ChaCha12: 4.6 cpb
    - ChaCha8: 3.5 cpb

  AlignedSecByteBlock
    - Poly1305: 2.9 cpb
    - Blake2s: 5.5. cpb
    - Blake2b: 3.9 cpb
    - SipHash-2-4: 1.9 cpb
    - SipHash-4-8: 3.3 cpb
    - ChaCha20: 6.0 cpb
    - ChaCha12: 4.0 cpb
    - ChaCha8: 2.9 cpb

Testing on an mid-2000's 32-bit VIA C7-D with SSE2+SSSE3 showed no improvement, and no performance was lost.
2017-09-04 10:24:24 -04:00
Jeffrey Walton 8578383e2c
Switch to static_cast 2017-09-03 20:33:01 -04:00
Jeffrey Walton e7974c7915
Fix unaligned data in self test
AltiVec and Power8 are brutal. The SIMD units just mask-off the lower 3 address bits. They make the buffer aligned whethere it is aligned or not
2017-09-03 11:17:57 -04:00
Jeffrey Walton b9e871d1e8
Add PPC, PPC64, AltiVec and Power8 awareness
We are going to try AltiVec/Powe8 crypto. It appears to be a lot like ARMv8-a crypto
2017-09-02 19:25:37 -04:00
Jeffrey Walton 4a28391495
Back-off assert in SecBlock
Since removing the allocator overloards that handled the wipe mark, we have to route deallocate into the standard one. The standard one fires an assert for [now] normal operation
2017-09-02 19:22:53 -04:00
Jeffrey Walton a57cd5e193
Update test script 2017-09-02 06:18:08 -04:00
Jeffrey Walton 5b12be29e6
Update test script 2017-09-01 20:38:57 -04:00
Jeffrey Walton 3525fd48da
Remove MOVBE intrinsics
GCC never defines __MOVBE__
2017-09-01 20:38:32 -04:00
Jeffrey Walton d2ad6751d5
Clear uninitialized variable warnings under xlC 2017-09-01 20:37:23 -04:00
Jeffrey Walton 602fa05825
Cleared unused variable warning under MSC 2017-09-01 14:19:48 -04:00
Jeffrey Walton 6544f75769
Clear strict aliasing rule violation in BLAKE2
There was no aliasing violation in practice. We used a  to assign the right pointer. If the compiler would have removed the unneeded assignment based on T_64bit, then we would not have been flagged.
2017-09-01 11:36:22 -04:00
Jeffrey Walton 069ae2a179
Fix missing object factory of xlC on AIX 2017-09-01 03:58:45 -04:00
Jeffrey Walton 29cf783458
Clear xLC "1540-1102 (W) "e" might be used before it is set" 2017-09-01 03:19:43 -04:00
Jeffrey Walton 14a5221d82
Remove unneeded Debug tests
These tests are effectively performed in MDC, SEAL and OldRandomPool
2017-09-01 02:37:41 -04:00
Jeffrey Walton b47de6150f
Remove unneeded deallocate (GH #485)
This should have been yanked when we removed the same for allocate
2017-08-31 22:50:09 -04:00
Jeffrey Walton 55a5dd8b85
Add core to clean rule 2017-08-31 12:15:39 -04:00