Commit Graph

237 Commits

Author SHA1 Message Date
Jeffrey Walton
f6ff499035
Clear signed/unsigned warnings under Clang 2019-10-05 21:16:07 -04:00
Jeffrey Walton
589c25264a Don't add semicolon to CRYPTOPP_CONSTANT abd DOCUMENTED_TYPEDEF (GH #889)
This issue is a recurring issue. Let's try fixing it in the #define this time.
2019-10-03 19:40:53 -04:00
Jeffrey Walton
366fdce86f Add BytePtr and ConstBytePtr overloads for SecByteBlock (GH #890) 2019-10-03 04:12:16 -04:00
Jeffrey Walton
1190da17ea Avoid circular dependency using AlignedAllocate (GH #885) 2019-09-28 18:22:11 -04:00
Jeffrey Walton
739e5799e3 Whitespace check-in 2019-07-27 15:56:15 -04:00
Jeffrey Walton
769643bbe1
Fix macro paste in CRYPTOPP_ASSERT_JOIN 2019-07-14 19:09:05 -04:00
Jeffrey Walton
388a2e6ded
Fix macro paste in CRYPTOPP_ASSERT_JOIN 2019-07-14 19:04:52 -04:00
Jeffrey Walton
f5881d121a
CRYPTOPP_CXX11_STATIC_ASSERT -> CRYPTOPP_CXX14_STATIC_ASSERT
WHoops, this is a C++14 feature
2019-07-14 19:02:58 -04:00
Jeffrey Walton
002e794ae2
Use C++ static_assert from N3928 when available 2019-07-14 18:28:51 -04:00
Jeffrey Walton
5de1089c8c
Update documentation 2019-07-14 12:50:50 -04:00
Jeffrey Walton
e8b07b162f
Avoid preprocessor error in SIZE_MAX (GH #864) 2019-07-14 00:52:30 -04:00
Jeffrey Walton
195cd6e7c8
Update documentation 2019-07-06 16:06:27 -04:00
Jeffrey Walton
c3d4e79a09
Use CRYPTOPP_CXX11_DELETED_FUNCTIONS in NotCopyable 2019-07-01 13:27:51 -04:00
Jeffrey Walton
d8122cec16
Avoid ARM rev on Aarch64
This broke Aarch64
2019-06-04 21:17:13 -04:00
Jeffrey Walton
9538f2d715
Fix compile on iOS 2019-06-01 08:05:39 -04:00
Jeffrey Walton
8e27c6b3fa
Fix OS X compile with Clang later than 6.0
It looks like Apple Clang 6.0 does not provide _blsr_u32 and friends. Later versions of Clang defines _blsr_u32 and it causes a stream of warnings.
2019-05-31 23:33:17 -04:00
Jeffrey Walton
392ec3465e
Fix OS X compile with Clang 6.0 2019-05-31 23:03:24 -04:00
Jeffrey Walton
a2e7c26f6c
Add 16-bit rev16 and rbit 2019-05-28 02:50:58 -04:00
Jeffrey Walton
623059f28c
Use ARM rev and rbit when appropriate
We tried to add a ByteReverse(word64) and BitReverse(word64) overloads but GCC was producing bad code for it.
2019-05-27 14:27:12 -04:00
Jeffrey Walton
9a3c1e351d
Clear Valgrind finding in IncrementCounterByOne
The single buffer IncrementCounterByOne generated a Valgrind finding on ARM. This commit uses the same pattern for both overloads in case Valgrind wants to fire on the two-buffer version.
2019-05-25 19:49:49 -04:00
Jeffrey Walton
f90c162b68
Fix IncrementCounterByOne
This was introduced earlier in the day when clearing a Valgrind finding. It tested good with the self tests. However, we double process byte[0] if there's a carry.
2019-05-25 07:02:32 -04:00
Jeffrey Walton
92df2a685f
Clear Valgrind warnings on ARM
I don't believe these should have been findings. They were clear on x86, Aarch64 and PowerPC.
2019-05-25 03:41:05 -04:00
Jeffrey Walton
9dcc26c582
Prepare for Crypto++ 8.2 release
Make ConstBytePtr return non-NULL pointer
2019-04-28 19:37:23 -04:00
Jeffrey Walton
ec1aa8874c
Prepare for Crypto++ 8.2 release
Fix SHAKE-128 and SHAKE-256 tests
2019-04-28 19:09:45 -04:00
Jeffrey Walton
04e5939c8d
Fix spelling 2019-01-31 18:37:41 -05:00
Jeffrey Walton
416f519f50
Move NumericLimitsMin and NumericLimitsMax to CryptoPP namespace (GH #793) 2019-01-31 00:05:00 -05:00
Jeffrey Walton
b29faeab58
Add -Wno-unused-function to misc.h (GH #793)
This was added to misc.h due to the noise created by NumericLimitsMin and NumericLimitsMax. It should make it easier to remove -Wno-unused-function from config.h.
2019-01-30 20:52:21 -05:00
Jeffrey Walton
fdfcb2a172
Make AlignedAllocate available in simulator debug builds (GH #779, PR #780)
* Make AlignedAllocate available in simulator debug builds (GH #779)

* Use CRYPTOPP_CONSTANT for rotate params
2019-01-11 16:37:26 -05:00
Marcel Raad
1a4b851ac1 Fix clang warnings (GH #771) 2019-01-02 12:05:26 -05:00
Jeffrey Walton
4b295f1f32
Use const_cast instead of reinterpret_cast 2018-12-04 22:12:07 -05:00
Jeffrey Walton
7832ae3733
Switch to uintptr_t for IsAlignedOn
I thought this might be part of the problem for https://groups.google.com/d/msg/cryptopp-users/sHCHSjM7scY/PkcSbIo-DQAJ but it did not help. However, the uintptr_t is the proper cast here.
2018-12-04 21:42:23 -05:00
Jeffrey Walton
652d0e42bf
Use __IBM_ATTRIBUTES and __IBM_ALIGNOF__ from IBM compiler manual 2018-11-22 19:18:08 -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
e185cbd803 Revert "Sync CRYPTOPP_{BIG|LITTLE}_ENDIAN with Autotools"
This reverts commit 04306f86ac. It broke GCC 4.8 on PowerPC.
2018-10-28 03:42:50 -04:00
Jeffrey Walton
04306f86ac
Sync CRYPTOPP_{BIG|LITTLE}_ENDIAN with Autotools 2018-10-27 07:30:15 -04:00
Jeffrey Walton
3063c6e1d9
Whitespace check-in 2018-10-20 06:11:46 -04:00
Jeffrey Walton
180b39facc
Disable SecureWipe specializations when CRYPTOPP_DISABLE_ASM (GH #719) 2018-10-20 05:54:49 -04:00
Jeffrey Walton
4fb9fbf5ac
Update comments 2018-08-24 12:19:42 -04:00
Jeffrey Walton
beed647df2
Update assert 2018-08-24 09:25:19 -04:00
Jeffrey Walton
1bbbfb6b75
Fix partial specializations for FixedSizeAllocatorWithCleanup (PR #710)
Commit afbd3e60f6 effectively treated a symptom and not the underlying problem. The problem was linkers on 32-bit systems ignore CRYPTOPP_ALIGN_DAT(16) passed down by the compiler and align to 8-bytes or less. We have to use Wei's original code in some places. It is not a bad thing, but the bit fiddling is something we would like to contain a little more by depending more on language or platform features.

This commit keeps the original changes which improve partial specializations; but fixes 32-bit linker behavior by effectively reverting afbd3e60f6 and e054d36dc8. We also add more comments so the next person has understands why things are done they way they are.
2018-08-24 08:13:23 -04:00
Jeffrey Walton
afbd3e60f6
Fix alignment on Win32 and Solaris Sparc (PR #709)
These fixes were interesting in a morbid sort of way. I thought the FixedSizeAllocatorWithCleanup specializations faithfully reproduced semantics but I was wrong on Win32 and Sparc. Also see Commit e054d36dc8.

It seems there was another requirement or dependency that we missed, but it was not readily apparent. If I am parsing results correctly (which I may not be), it appears the bit twiddling using 8 byte alignment had more influence on alignment than I originally thought based on use of CRYPTOPP_BOOL_ALIGN16 and T_Align16. Or maybe the alignment attributes specified by CRYPTOPP_ALIGN_DATA are not being honored like they should for stack allocations.

This check-in avoids some uses of x86 movdqa (aligned) in favor of movdqu (unaligned). The uses were concentrated on memory operands which were 8-byte aligned instead of 16-byte aligned. It is not clear to me how the specializations lost 8-bytes of alignment. The check-in also enlists CRYPTOPP_ASSERT to tell us when there's a problem so we don't need to go hunting for bugs.
2018-08-23 14:42:29 -04:00
Jeffrey Walton
d4f86d7320
Add SunCC code path to GetAlignmentOf
It looks like GetAlignmentOf was returning the "UnsignedMin(4U, sizeof(T))" for SunCC. It was causing SIGBUSes on Sparc when T=word64. OpenCSW provided access to their build farm and we were able to test "__alignof__(T)" back to an early SunCC on Solaris 9.
2018-07-21 06:29:20 -04:00
Jeffrey Walton
414c5c5438
Fix Tiger crash on Sparc (GH #690)
Man, Sparc does not mess around with unaligned buffers. Without -xmemalign=4i the hardware wants 8-byte aligned word64's so it can use the high performance 64-bit move or add.
Since we do not use -xmemalign we get the default behavior of either -xmemalgin=8i or -xmemalgin=8s. It shoul dnot matter to us since we removed unaligned data access at GH #682.
2018-07-20 20:12:54 -04:00
Jeffrey Walton
25179e00d3
Fix PtrByteDiff cast
A quick testing pass that loaded the code with asserts caused a compile failure
2018-07-12 09:37:43 -04:00
Jeffrey Walton
b3fe24b8b5
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.
2018-07-11 11:40:25 -04:00
Jeffrey Walton
722d3e38c1
Avoid cast in PtrDiff
ptrdiff_t is the return type
2018-07-10 11:55:50 -04:00
Jeffrey Walton
50f99ae802
Increase use of ptrdiff_t when performing pointer math 2018-07-10 09:21:52 -04:00
Jeffrey Walton
c6c44aa5d1
Add PtrAdd and PtrSub helper functions
This helps contain UB on pointer subtraction by ensuring a ptrdiff_t is used. The code is a little uglier but it is also more portable.
2018-07-10 05:00:02 -04:00
Marcel Raad
7c1d296283 Fix clang warnings in headers (#655)
* remove superfluous semicolon

* Remove C-style casts from public headers

clang warns about them with -Wold-style-cast. It also warns about
implicitly casting away const with -Wcast-qual. Fix both by removing
unnecessary casts and converting the remaining ones to C++ casts.
2018-05-10 19:59:21 -04:00
Ilja
c2e4ee60b3 Remove extra ;s (GH #605) 2018-03-26 11:36:54 -04:00