Commit Graph

189 Commits (320c68ecbf7f986b401e250fab124fd2effa5dc0)

Author SHA1 Message Date
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
Jeffrey Walton 63d038fa18
Update documentation
The commit also adds an assert on memcpy_s pointers. GCC 8 claims the pointers are the same. We think it is a spurious finding. The assert never fired during test.
2018-02-22 08:01:08 -05:00
Jeffrey Walton 2816efe188
Clear GCC -Wstrict-overflow warning
This is a false positive when "T=int" or "T=long". "value" is reduced by division so it converges to 0. It is never less than 0.
2018-01-20 19:37:58 -05:00
Jeffrey Walton befd04312d
Remove unneeded Doxygen directive 2018-01-19 14:31:20 -05:00
Jeffrey Walton aa7f6c47d1
Update documentation 2018-01-13 07:14:21 -05:00
Jeffrey Walton a9d6604ee9
Update documentation 2018-01-12 09:04:12 -05:00
Jeffrey Walton 751252b2d9
Update documentation 2018-01-12 08:54:07 -05:00
Kirit Sælensminde 59b94d2bbf C++17 compatible lambda expressions to replace `bind2nd` (#559)
* Conditionally use a lambda rather than the older `bind2nd` style.

* Duplicate the if statements.

* Centralise the conditional compilation to an implementation of find_if_not.

* Refactoring of name and code placement after review.

* Use `FindIfNot` where appropriate.

* Remove whitespace.
2018-01-12 08:38:56 -05:00
Jeffrey Walton 195ac2c7c9
Refactor rijndael-simd.cpp and simon.simd.cpp to use adv-simd.h 2017-12-10 11:09:50 -05:00
Jeffrey Walton 61ec50dabe
Change Doxygen comment style from //! to ///
Also see https://groups.google.com/forum/#!topic/cryptopp-users/A7-Xt5Knlzw
2017-11-29 10:54:33 -05:00
Jeffrey Walton dcd27e8a1f
Update documentation 2017-11-24 18:58:31 -05:00
Jeffrey Walton 3b80ead695
Add rotlConstant and rotrConstant
The template functions take the rotate amount as a template parameter, which will allow the constexpr to propagate into the rotate expression. It should avoid some of the compile problems we were seeing under Clang and C++11
2017-11-24 17:37:55 -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 24a19b7a18
Cleanup use of BMI intrinsics under GCC and compatibles 2017-10-09 21:14:21 -04:00
Jeffrey Walton 69fd4a040d
Update documentation 2017-09-27 06:24:58 -04:00
Jeffrey Walton 3525fd48da
Remove MOVBE intrinsics
GCC never defines __MOVBE__
2017-09-01 20:38:32 -04:00
Jeffrey Walton 1267c75369
Fix constexpr issues under GCC 4.1.2 found on CentOS 5 2017-08-17 18:35:06 -04:00
Jeffrey Walton 2c9a3039e8
Update documentation
This cleanup was performed using Clang and -Wdocumentation -Wno-documentation-deprecated-sync
2017-07-27 19:15:21 -04:00
Jeffrey Walton c90a63196a
Add StringWiden function
StringWiden converts a narrow C-style string to a wide string. It serves the opposite role of StringNarrow function. The function is useful on Windows platforms where the OS favors wide functions with the UTF-16 character set. For example, the Data Proction API (DPAPI) allows a description, but its a wide character C-string. There is no narrwo version of the API.
2017-03-17 04:57:38 -04:00
Jeffrey Walton 46c9cc725c
Use C++03 Singleton on select Microsoft platforms (Issues 372, 373, 389, 391)
We are back to the "... one object may end up being memory leaked" if faced with concurrent initialization
2017-03-15 06:20:45 -04:00
Jeffrey Walton 006ca5f860
Updated documentation 2017-03-11 01:42:06 -05:00
Jeffrey Walton 5efb019d8b
Add C++ nullptr support (Issue 383) 2017-03-01 06:10:06 -05:00
Jeffrey Walton 26e2e12b6a
Fix typo 2017-02-16 20:57:31 -05:00
Jeffrey Walton 5bbdcaf243
Fix compile under MFC project 2017-02-16 20:55:02 -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 d4c247a1fd
Add MOVBE support
MOVBE is a modest gain over BSWAP. Though its guarded by CRYPTOPP_MOVBE_AVAILABLE, we cannot detect availability with a preprocessor macro. That is, GCC does not provide __MOVBE__ or similar. It has to be enabled manually
2017-01-24 04:26:00 -05:00
Jeffrey Walton 1d391c190d
Make NumericLimitsMin and NumericLimitsMax available to MSVC (Issue 364) 2017-01-15 19:36:36 -05:00
Jeffrey Walton b274f06202
Fix RoundUpToMultipleOf for Apple Clang 6.0 (Issue 364)
Also see Issue 360 and http://stackoverflow.com/q/41666815
2017-01-15 19:14:42 -05:00
Jeffrey Walton 781e63ba7c
Fix RoundUpToMultipleOf (Issue 360)
Thanks to Boldizsár Lipka
2017-01-10 22:05:53 -05:00
klemens 5a5c633073 spelling fixes 2016-12-27 18:34:57 +01:00
Jeffrey Walton a274a64058
Fix compile under Visual Studio .Net (Issue 342) 2016-12-03 18:44:48 -05:00
Jeffrey Walton ba75834ae9
Removed VC++ 5.0 and 6.0 workarounds (Issue 342) 2016-12-03 05:05:56 -05:00
Jeffrey Walton 40230dd3bf
Removed MAINTAIN_BACKWARDS_COMPATIBILITY_562 (Issue 70) 2016-12-03 00:32:07 -05:00
Jeffrey Walton 6eb2792bc2
Silence select conversion warnings (Issue 340) 2016-12-02 14:47:31 -05:00
Jeffrey Walton 1ba8142195
Guard XOR of optional xorBlock. Updated documentation 2016-11-14 03:48:21 -05:00
Jeffrey Walton f7df2de284
Switch to PutWord for rdrand.cpp 2016-11-14 02:21:02 -05:00
Jeffrey Walton ea1157d8f5
Macro cleanup under Visual Studio .Net 2016-11-14 01:23:12 -05:00
Jeffrey Walton 8518d22760
Change to file scope statics for Zero(), One(), Two() (Thanks DB, Issue 310) 2016-09-29 21:10:11 -04:00
Jeffrey Walton 6af5b8424f
Removed likely and unlikely macros
Benchmarking showed the use of the macros slowed things down. Profile guided bracnh reordering, committed at dc99266599a0e72d, provided a better benefit
2016-09-28 18:18:55 -04:00
Jeffrey Walton 6bf0d32279
Used CRYPTOPP_UNLIKELY on gf2n.cpp hotspot 2016-09-27 20:58:17 -04:00
Jeffrey Walton 7ae1267673 Add CRYPTOPP_LIKELY and CRYPTOPP_UNLIKELY macros 2016-09-27 20:47:31 -04:00
Jeffrey Walton 91020ce3ba Cleared signed/unsigned warning under Visual Studio (Related to Issue 295) 2016-09-21 22:10:03 -04:00
Jeffrey Walton 6bfa0d9ab0 Cleared Coverity finding CID 170383 (INTEGER_OVERFLOW) (295)
ModPowerOf2 was changed to include a saturating subtract. Unintuitively, the code got faster rather than slower. The saturating operation appears to have helped the optimizer
2016-09-21 21:50:02 -04:00
Jeffrey Walton 1dd3fae316 Updated documentation 2016-09-20 15:57:45 -04:00
Jeffrey Walton 51423972b1 Updated documentation 2016-09-19 23:18:19 -04:00
Jeffrey Walton 002509a9a9 Updated comments 2016-09-18 03:53:57 -04:00
Jeffrey Walton 3815b908ab Add ossig.h. Move SignalHandler to ossig.h
This avoids a circular dependency between misc.h and trap.h. It also allows us to logically segregate and group code to replace C++ handlers, like set_terminate
2016-09-17 12:23:02 -04:00
Jeffrey Walton 399a1546de Add CRYPTOPP_ASSERT (Issue 277, CVE-2016-7420)
trap.h and CRYPTOPP_ASSERT has existed for over a year in Master. We deferred on the cut-over waiting for a minor version bump (5.7). We have to use it now due to CVE-2016-7420
2016-09-16 11:27:15 -04:00
Jeffrey Walton 5790163abc Use __BIGGEST_ALIGNMENT__ only if its smaller than sizeof\(T\) 2016-09-13 22:28:03 -04:00