Commit Graph

95 Commits

Author SHA1 Message Date
Jeffrey Walton
a89a27b72c
Attempt to keep Clang out of other compiler paths (GH #147) 2023-06-25 18:28:11 -04:00
Jeffrey Walton
f5f63850f9
Use std namespace for memset, memcpy, memcmp (#1204) 2023-04-15 16:45:02 -04:00
Jeffrey Walton
01a18bdbcb
Fix inline ASM on x86 (GH #1142) 2022-08-21 21:31:35 -04:00
Jeffrey Walton
d01ab643e9
Update GCC clobber list for SHA-256 and SHA-512 (PR #1139)
* Clear documentation warning

* Update GCC clobber list for SHA-256 and SHA-512
  Also see PR #1133 and GH #1134
2022-08-06 01:24:29 -04:00
v1ne
e59577b49e
Mark clobbered registers as clobbered in GCM mode (GH #1133)
This resolves failing AES-GCM tests on amd64 with GCC 11 on Linux
with SSE2 on and other CPU features off.

While here, remove unused r11 and clobber ebx unconditionally.

Co-authored-by: v1ne <v1ne2go@gmail.com>
2022-07-29 04:24:02 -04:00
Jeffrey Walton
fee14910ea
Move M128_CAST and CONST_M128_CAST to config_asm.h 2021-04-20 01:48:03 -04:00
Jeffrey Walton
a7f2796dda
Update comments 2019-07-21 22:21:10 -04:00
Jeffrey Walton
39418a8512
Use PowerPC unaligned loads and stores with Power8 (GH #825, PR #826)
Use PowerPC unaligned loads and stores with Power8. Formerly we were using Power7 as the floor because the IBM POWER Architecture manuals said unaligned loads and stores were available. However, some compilers generate bad code for unaligned loads and stores using `-march=power7`, so bump to a known good.
2019-04-27 20:35:01 -04:00
Jeffrey Walton
8769302a8b
Add CRYPTOPP_DISABLE_MIXED_ASM define and feature test (GH #756, PR #757) 2018-12-05 13:22:10 -05:00
Jeffrey Walton
bbc5c63d33
Drop GCM to POWER7 on PowerPC
GCM can do some bulk XOR's using the SIMD unit. However, we still need loads and stores to be fast. Fast loads and stores of unaligned data requires the VSX unit
2018-11-17 00:41:49 -05:00
Jeffrey Walton
c601213ce1
Sync CRYPTOPP_{BIG|LITTLE}_ENDIAN with Autotools
Autotools sets up its config.h file with the '#define XXX 0' or '#define XXX 1' pattern. This check-in makes the sources Autotools aware. We need to verify CMake does the same
2018-10-28 04:24:22 -04:00
Jeffrey Walton
c24f17b7a2
Fix compiler crash in Visual Studio .Net (2002 and 2003) 2018-08-20 08:24:12 -04:00
Jeffrey Walton
01779726db
Use consistent suffix for SSE2 ASM 2018-08-20 07:16:59 -04:00
Jeffrey Walton
4282f94712
Disable X32 inline assembly (GH #686, PR #704)
Also use CRYPTOPP_DISABLE_XXX_ASM consistently. The pattern is needed for Clang which still can't compile Intel assembly language. Also see http://llvm.org/bugs/show_bug.cgi?id=24232.
2018-08-18 04:44:53 -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
e1433536bc
Use CRYPTOPP_DISABLE_INTEL_ASM for Clang in GCM
Clang 6.0 is still broke. It cannot compile a simple "neg %rcx" using Intel syntax
2018-07-16 19:40:56 -04:00
Jeffrey Walton
bd9ca55c44
Cleanup gcm.cpp after Commit 9d954efcde 2018-07-16 09:48:35 -04:00
Jeffrey Walton
c3107d2519
Fix "impossible constraint in \\asm\" on i686
gcm.cpp:89:50: error: impossible constraint in \\asm\
          : "=xm" (a[0]) : "xm"(b[0]), "xm"(c[0]));
2017-11-24 05:49:56 -05:00
Jeffrey Walton
dbd79a1e49
Fix GCC inline asm register constraint for SSE register
Also see https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html
2017-11-17 01:01:12 -05:00
Jeffrey Walton
7f7131dc55
Fix GCM_Xor16_SSE2 for 32-bit MSVC compiles 2017-11-16 23:07:30 -05:00
Jeffrey Walton
8b52a03d08
Fix SunCC 12.2 compiler crash with GCM_Xor16_SSE2
SunCC 12.3 through 12.5 still cannot handle CLMUL, though. It would be nice if Sun fixed the regression.
2017-11-16 02:38:53 -05:00
Jeffrey Walton
6f83a4fb7d
Switch to intrinsic operation instead of casts for GCM SSE2 XOR's 2017-11-15 23:05:30 -05:00
Jeffrey Walton
69c8a4f9c6
Prefix IS_LITTLE_ENDIAN and IS_BIG_ENDIAN with CRYPTOPP 2017-11-10 14:15:30 -05:00
Jeffrey Walton
7c667bc71e
Fix SunCC crash when compiling GCM 2017-08-27 06:16:04 -04:00
Jeffrey Walton
5c6a32ba0f
Support Base Implementation + SIMD implementation on Solaris (PR #461) 2017-08-24 19:17:21 -04:00
Jeffrey Walton
7851a0d510 Remove BOOL macro value (GH #462)
Currently the CRYPTOPP_BOOL_XXX macros set the macro value to 0 or 1. If we remove setting the 0 value (the #else part of the expression), then the self tests speed up by about 0.3 seconds. I can't explain it, but I have observed it repeatedly.
This check-in prepares for the removal in Upstream master
2017-08-20 21:25:29 -04:00
Jeffrey Walton
a1b3102eab
Update comments 2017-08-19 01:35:36 -04:00
Jeffrey Walton
a9534a7cf3
Use CRYPTOPP_SSE2_INTRIN_AVAILABLE for consistent naming 2017-08-18 02:11:41 -04:00
Jeffrey Walton
e2c377effd Split source files to support Base Implementation + SIMD implementation (GH #461)
Split source files to support Base Implementation + SIMD implementation
2017-08-17 12:33:43 -04:00
Jeffrey Walton
74d21068a1
Fix more Clang problems
I wish this god damn compiler would stop pretending to be other compilers when it can't consume the same program. Even the GCC devs have told the LLVM devs to stop ding that crap
2017-08-17 10:45:43 -04:00
Jeffrey Walton
df280a509a
Disable Carryless Multiplies for Clang
Clang causes too many problems. Early versions of the compiler simply crashes. Later versions of the compiler still have trouble with Intel ASM and still produce incorrect results on occassion. Additionally, we have to special case the integrated assemvler. Its making a mess of the code and causing self test failures
2017-08-16 22:10:53 -04:00
Jeffrey Walton
863bf9133c
Cleanup casts due to Clang 2017-08-13 06:32:09 -04:00
Jeffrey Walton
f02bf91ee5
Revert 95ee8975b4 and 7d21cdd54e (Issue 408)
This broke some OS X builds. We need more testing. Ugh...
2017-08-13 04:31:17 -04:00
Jeffrey Walton
95ee8975b4
Use blockSize in error message thrown 2017-08-12 20:29:33 -04:00
Jeffrey Walton
7d21cdd54e
Convert GCM to use runtime blocksize checking (Issue 408)
GCM is still only defined for 16-byte ciphers, but this is where we need to be when we add the larger polynomials
2017-08-12 16:14:29 -04:00
Jeffrey Walton
5efb019d8b
Add C++ nullptr support (Issue 383) 2017-03-01 06:10:06 -05:00
Jeffrey Walton
81b1a18063
Change file preamble to include "originally written by Wei Dai"
We have made a fair number of changes, and we don't want WD to receive credit for issues he was not part of
2017-01-27 07:05:45 -05:00
Jeffrey Walton
14f5305c92
VEXT_8 -> VEXT_U8 2017-01-22 20:53:19 -05:00
Jeffrey Walton
f2132a81c1
Comments and whitespace checkin 2017-01-20 19:41:20 -05:00
Jeffrey Walton
74328f93a8
Fix "error: impossible constraint in asm" under Aarch64 (Issue 366) 2017-01-20 18:48:11 -05:00
Jeffrey Walton
4f725eddc1
Call vrev64q_u8 after vld1q_u8 2017-01-19 07:37:54 -05:00
Jeffrey Walton
bbf13b77e7
Switch to vext and remove unnecessary casts 2017-01-19 06:22:38 -05:00
Jeffrey Walton
b129818c35
Add GCC inline ASM for PMULL and PMULL2
The macros that invoke GCC inline ASM have better code generation and speedup GCM ops by about 70 MiB/s on an Opteron 1100. The intrinsics are still available for Windows platforms and Visual Studio 2017 and above
2017-01-19 02:38:00 -05:00
Jeffrey Walton
4f2bb7664f
Avoid C-style casts for NEON vectors
Switch to ARM vector casts like vreinterpretq_u8_u64
2017-01-16 17:12:44 -05:00
Jeffrey Walton
c80502102a
Breakout __ARM_FEATURE_CRYPTO into PMULL, AES and SHA for Apple Clang (Issue 362)
It appears Apple Clang disgorges carryless multiply (PMULL) from Crypto (AES and SHA). The breakout added CRYPTOPP_BOOL_ARM_PMULL_INTRINSICS_AVAILABLE for PMULL, and retained CRYPTOPP_BOOL_ARM_CRYPTO_INTRINSICS_AVAILABLE for AES and SHA only
2017-01-15 00:22:14 -05:00
Jeffrey Walton
56a91ca197
Remove last of macros targtting _MSC_VER 1200 (Issue 342) 2016-12-03 21:31:22 -05:00
Jeffrey Walton
33a59b8bd1 Reference 226 and 284 bugs in workaround since the gyrations are not readily apparent 2016-09-18 11:57:57 -04:00
Jeffrey Walton
2d0e388d9a Fix SunCC 12.5 failed validation in gcm.cpp (Issue 284) 2016-09-18 11:45:12 -04:00
Jeffrey Walton
4fb75a8f4d Fix SunCC 12.3 - 12.5 crash in gcm.cpp
/opt/developerstudio12.5/bin/CC -DNDEBUG -g2 -O2 -m64 -native -KPIC -template=no%extdef -c gcm.cpp

assertion failed in function pr_post_process_node() @ preopt.c:3868
assert(nd_eq_(scope_first_stmt_(node), first_s))

CC: ube failed for gcm.cpp
2016-09-18 10:26:57 -04:00
Jeffrey Walton
8f33054545 Revert "Fix SunCC 12.3 - 12.5 crash in gcm.cpp"
This reverts commit 519b41e47e. Additional testing cruft was included in the commit.
2016-09-18 10:23:10 -04:00