Commit Graph

266 Commits

Author SHA1 Message Date
Jeffrey Walton
df86e69902
Add specialization for SafeConvert 2023-06-23 00:13:16 -04:00
Jeffrey Walton
ddb8f36e88
Fix use of <x86intrin.h> for MSVC (GH #1198)
It seems Microsoft now defines GCC defines, like __BMI__
2023-04-15 18:21:03 -04:00
Jeffrey Walton
f5f63850f9
Use std namespace for memset, memcpy, memcmp (#1204) 2023-04-15 16:45:02 -04:00
Jeffrey Walton
c07c53ae41
Cleanup after merging PR #1043 2022-02-14 09:08:10 -05:00
ejl103
e06bac5bfc
Fix issue with VS runtime checks for data truncation (#1043)
When running VS with the 'c' runtime check on for data truncation (see https://docs.microsoft.com/en-us/cpp/build/reference/rtc-run-time-error-checks?view=msvc-160)

This code will throw errors because the 64 bit ptr gets truncated to a 32bit value. Normally I'd disable this using the pragma specifically for this code, but sadly that doesn't work for template functions, so I have come up with a way to get the appropriate masking type for any template combinations and using the recommended way to silence the error without impacting the quality of the generated code.

This code could be more concise in modern C++ but it seems the project expects to support C++03 so this should work fine there.

All tests passed locally for me on Windows (some asserts but verified they were the same before my changes)
2022-02-14 09:02:13 -05:00
Jeffrey Walton
47a6d46db7
Clear unused variable warnings 2022-01-13 03:45:43 -05:00
Jeffrey Walton
10bba4e54d
Add word128 overloads to misc.h 2022-01-13 03:09:28 -05:00
Jeffrey Walton
dc8e27c400
Update documentation 2022-01-13 03:08:10 -05:00
Jeffrey Walton
8f7304b61e
Add ByteReverse(word128 value)
This speeds up XTS mode on x86_64 by 0.11 cpb
2022-01-12 10:26:25 -05:00
Jeffrey Walton
62d7819062
Update documentation 2021-03-10 01:07:12 -05:00
Jeffrey Walton
3a74e072a5
Fix spelling 2021-03-10 00:55:57 -05:00
Jeffrey Walton
f7e6af6344
Add EnumToInt conversion macro for enum-enum conversion warnings (GH #1016) 2021-03-09 22:51:19 -05:00
Jeffrey Walton
9fe5ccfbee
Revert e235ac57e8 (GH #992)
These damn aligned arrays are going to be the death of us...
2020-12-28 21:32:29 -05:00
Jeffrey Walton
e235ac57e8
Use pointer-to-T in IsAligned<T> (GH #992) 2020-12-28 07:12:28 -05:00
Jeffrey Walton
a0e960059f
Update documentation 2020-12-25 00:49:48 -05:00
Jeffrey Walton
e61f5e0c79
Update documentation 2020-12-25 00:43:01 -05:00
Jeffrey Walton
b20bd360fc
Update documentation 2020-12-25 00:40:54 -05:00
Jeffrey Walton
ac6987f3ae
Use \return and \throw consitently in the docs 2020-12-07 23:35:10 -05:00
Jeffrey Walton
2ec97f4676
Fix Clang version numbers for memset_z 2020-09-15 00:37:47 -04:00
Jeffrey Walton
a6ca1f3195
Update documentation (GH #966) 2020-09-15 00:34:39 -04:00
Jeffrey Walton
2c6e4b17d7
Use define CRYPTOPP_CXX11_STATIC_INIT name 2020-08-07 19:11:47 -04:00
Jeffrey Walton
36c9ecd66d
Remove __BIGGEST_ALIGNMENT__ from GetAlignmentOf 2020-08-06 06:19:25 -04:00
Jeffrey Walton
3f73f709b8
Use CRYPTOPP_CXX11_ATOMIC define 2020-08-06 03:08:37 -04:00
Jeffrey Walton
66d7a2a604
Fix define CRYPTOPP_CXX17_STATIC_ASSERT name
That's a C++17 feature, not C++11
2020-08-05 23:29:10 -04:00
Jeffrey Walton
4183eaa514
Fix spelling 2020-07-07 15:36:39 -04:00
Jeffrey Walton
96172f95ab
Whitespace check-in 2020-05-11 13:15:41 -04:00
Jeffrey Walton
53c03d2b3c
Clean GCC 10 Analyzer warnings 2020-05-11 12:49:15 -04:00
Jeffrey Walton
a647cbb00f
Clean GCC 10 Analyzer warnings 2020-05-10 18:44:24 -04:00
Jeffrey Walton
680956e134
Clean GCC 10 Analyzer warnings 2020-05-10 01:25:39 -04:00
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