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
Jeffrey Walton
27b27475e9
Use __BIGGEST_ALIGNMENT__ over sizeof(T), if __BIGGEST_ALIGNMENT__ is available
...
__BIGGEST_ALIGNMENT__ is provided by some compilers, like GCC and ICC (but not Clang). It is usually 16 on 64-bit platforms; and it is usually 8 on 32-bit platforms
2016-09-12 06:34:00 -04:00
Jeffrey Walton
89809b7d59
Removed experimental rotlImmediate and rotrImmediate
2016-09-07 15:02:23 -04:00
Jeffrey Walton
a534ccb1bc
Stub-out a rotlImmediate and rotrImmediate providing shift/rotate amount as a template parameter.
...
Also see http://stackoverflow.com/q/39314690 and http://stackoverflow.com/q/39284065
2016-09-04 06:44:33 -04:00
Jeffrey Walton
a327717618
Guard _blsr_u64 and _tzcnt_u64 on __x86_64__
2016-07-21 18:04:05 -04:00
Jeffrey Walton
7ec3b29df6
Fix missing BMI/BMI2 instrinsics under GCC on Solaris (Issue 230)
2016-07-20 01:17:55 -04:00
Jeffrey Walton
9154975b1a
Updated documentation
2016-07-17 22:16:30 -04:00
Jeffrey Walton
4fd51eb06c
Add vec_swap for compilers which do not support std::swap'ing SSE and NEON types
2016-07-17 21:25:55 -04:00
Jeffrey Walton
6c0b120072
Go back to Commit 66ada4cc61
2016-07-06 14:39:18 -04:00
Mouse
9ed99eabb9
Restore PR #217
...
Restore merge of PR #217
2016-07-06 12:19:44 -04:00
Mouse
efd1b9e3d5
Revert "Merge remote-tracking branch 'upstream/master'" - shouldn't be merged by me
...
This reverts commit b48866631a , reversing
changes made to 2733630a3f .
2016-07-06 12:14:12 -04:00
Mouse
87be783cd1
Revert "Merge remote-tracking branch 'upstream/master'" - not intended to be merged by me
...
This reverts commit 762c315566 , reversing
changes made to b48866631a .
2016-07-06 12:01:28 -04:00
Jeffrey Walton
fb72dbc8cb
Add MacPorts GCC compiler and Clang integrated assembler support. This is a merge of the development branch 'clang-ia'
2016-07-05 02:48:27 -04:00
Mouse
e36270fa7c
Do not re-define macros already provided by native compiler
2016-07-04 13:11:15 -04:00
Jeffrey Walton
0f8871c9c9
Updated documentation
2016-07-03 01:53:55 -04:00
Jeffrey Walton
7d02a3c74d
Fix undeclared identifiers '_tzcnt_u32' and '__blsr_u32' under Clang (Issue 205)
2016-06-26 06:28:07 -04:00
Jeffrey Walton
e961c2da5b
Merge Atomics branch into Master
2016-06-06 22:08:04 -04:00
Jeffrey Walton
432db09b72
Removed CRYPTOPP_DISABLE_ASM from __BMI__ check
2016-05-25 17:48:16 -04:00
Jeffrey Walton
733c78ba23
Relocate ARM defines to contribute to CRYPTOPP_BOOL_ALIGN16
2016-05-21 15:50:04 -04:00
Jeffrey Walton
6a6027c2cd
Include "cpu.h" rather than <immintrin.h> directly to avoid compile error when using GCC and -mno-sse<N>
2016-05-21 08:32:23 -04:00
Jeffrey Walton
b1a7ada564
Merge branch 'atomics' into windows-store
2016-05-16 18:49:05 -04:00
Jeffrey Walton
d2fada4417
Merge branch 'master' into atomics
2016-05-15 00:08:47 -04:00
Jeffrey Walton
e5d2f4a71a
Merge branch 'master' into windows-store
2016-05-15 00:08:22 -04:00
Jeffrey Walton
be0d838e11
Updated documentation
2016-05-15 00:04:28 -04:00
Jeffrey Walton
58656e4bac
Updated documentation
2016-05-15 00:03:58 -04:00
Jeffrey Walton
d294b4290b
Add changes for Windows Sotre that went missing with my clumsy Git skills
2016-05-09 03:07:57 -04:00
Jeffrey Walton
8bb9197adc
Add atomics support
2016-05-02 23:38:10 -04:00
Jeffrey Walton
1ce593357f
Cleared compile errors under Visual Studio .Net compilers
2016-04-29 10:25:18 -04:00
Jeffrey Walton
1d4967b5fc
Updated to use BLSR intrinsic from SSE4/BMI when available
2016-04-26 17:13:15 -04:00
Jeffrey Walton
5c41ccb8fb
Enable tzcnt intrinsic for GCC when BMI is defined
2016-04-25 07:20:37 -04:00
Jeffrey Walton
412a41faa0
Enable tzcnt intrinsic for GCC when AVX2 is defined
2016-04-25 06:24:06 -04:00
Enrico Pisko
90748eb3c2
replaced special character which caused warning C4819 with other system encoding
2016-04-25 10:16:59 +02:00
Jeffrey Walton
f4877218fa
Updated documentation
2016-04-24 22:20:25 -04:00
Jeffrey Walton
c82f0a0d6a
Updated documentation
2016-04-21 04:08:06 -04:00
Jeffrey Walton
f71b9c4894
Updated documentation
2016-01-31 22:18:25 -05:00
Jeffrey Walton
3a3fae8b8b
Fixed potential ODR violation of non-member function StringNarrow
2016-01-30 14:01:20 -05:00
Jeffrey Walton
47cf7aca3e
Cleared -Wconversion warnings (Issue 126)
2016-01-28 15:26:57 -05:00
Jeffrey Walton
66359e8532
Updated documentation
2016-01-26 17:12:42 -05:00
Jeffrey Walton
fa05fa6e40
Updated documentation
2016-01-26 16:08:09 -05:00
Jeffrey Walton
8723adb857
Updated documentation
2016-01-26 13:46:44 -05:00
Jeffrey Walton
b53def3736
Cleared -Wcast-align with unaligned access (Issue 122)
2016-01-26 10:43:51 -05:00
Jeffrey Walton
1f1fecce88
Cleared -Wcast-align (Issue 122)
2016-01-25 19:28:55 -05:00
Jeffrey Walton
2b7dba4fa6
Suppressed false positives on -Wcast-align warning
2016-01-14 19:08:56 -05:00
Crayon2000
0d483f3092
Reverted file format to UTF-8 (No BOM)
...
Format was changed in my last commit.
2016-01-11 23:32:35 -05:00
Crayon2000
c31b96b11b
To use wcstombs with C++Builder we need to include stdlib.h
...
wcstombs was supported in C++Builder 2010 : http://docwiki.embarcadero.com/RADStudio/2010/en/Wcstombs
2016-01-11 23:28:54 -05:00
Jeffrey Walton
298988a5b9
Crypto++ 5.6.3 check-in
2015-11-22 19:17:15 -05:00
Jeffrey Walton
62618fda97
Revert botched "Crypto++ 5.6.3 check-in". Corruption due to VMware adding garbage to the end of some source files during drag and drop from guest to host.
...
This reverts commit c454358122 .
2015-11-22 19:11:31 -05:00
Jeffrey Walton
c454358122
Crypto++ 5.6.3 check-in
2015-11-20 19:15:33 -05:00
Jeffrey Walton
6ac1e46a1f
Cleared issues 11,12,13 (Clang integrated assembler), 58 (RC rollup), 66 (Coverity rollup)
2015-11-18 15:32:28 -05:00
Jeffrey Walton
48809d4e85
CRYPTOPP 5.6.3 RC6 checkin
2015-11-05 01:59:46 -05:00
Alberto Curro
1d5bcc08fb
Fixes the warning on IntToString about comparison of unsigned and signed values, when boost::uint32_t and boost::uint64_t are used with the function
2015-10-01 14:35:45 +01:00
Jeffrey Walton
973e48744b
Removed guard on memcpy_s call to memcpy. All the Undefined Behavior has been removed. The CRYPTOPP_ASSERT remains to guard the use of the functions, as does Clang/GCC Undefined Behavior sanitizer
2015-08-03 19:20:27 -04:00
Jeffrey Walton
b44546be11
Revert "Hid inline assembly behind a macro". The MEMORY_BARRIER code is OK, and the use of inline assembly code is OK to tame the optimizer is OK; but its confusing because the interactions are not readily apparent.
2015-08-01 19:00:31 -04:00
Jeffrey Walton
390d27b6cd
Hid inline assembly behind a macro
2015-08-01 18:02:03 -04:00
Jeffrey Walton
e9c086aaac
Added assert. Thanks to Jean-Pierre Münch for the suggestion
2015-07-30 18:58:11 -04:00
Jeffrey Walton
77206baf56
Whitespace checkin
2015-07-30 13:07:33 -04:00
Jeffrey Walton
264018e8ec
Suppressed "sign comparison" warning under GCC and Clang
2015-07-30 09:14:43 -04:00
Jeffrey Walton
33e6a62c5e
Reverted to previous SafeConvert code. Its not as efficient as it could be, but it is darn sure correct. Self-tests for the verification to follow
2015-07-30 08:38:28 -04:00
Jeffrey Walton
414b673706
Added test for T1 is signed
2015-07-29 22:37:36 -04:00
Jeffrey Walton
2936447d05
Updated IntToString and SafeConvert to squash the "signed/unsigned" warnings once and for all. Removed the specializations that caused more trouble than they were worth. (If all platforms offered size_t and ssizeT the same way, specializations would have been the preferred solution
2015-07-29 06:33:41 -04:00
Jeffrey Walton
ef318d5423
Fixed compiler errors on Apple due to cross product of {C++03,C++11} x {libc++, libstdc++}. It included bringing in the correct <memory> in <stdcpp.h>, and then only including <stdcpp.h> when <memory> was needed.
2015-07-27 16:01:55 -04:00
Jeffrey Walton
c42947e19b
Rearranged includes for consistency after testing
2015-07-27 13:03:18 -04:00
Jeffrey Walton
5eff653a54
Added guard and specialization for APple with and without "-std=c++11"
2015-07-27 12:40:06 -04:00
Jeffrey Walton
30b706316b
Cleared "signed/unsigned" warning introduced by 1997c21b37 under GCC. The ultimate fix is to guard the std::streamsize specialization to ensure Microsoft compilers don't see it
2015-07-26 13:56:45 -04:00
Jeffrey Walton
1997c21b37
Cleared "explicit specialization has already been defined" under MSVC and Visual Studio 2015
2015-07-26 11:27:36 -04:00
Jeffrey Walton
d3b2c03e4e
Added missing specialization for i386. Added comment on why we were specializing
2015-07-25 02:06:52 -04:00
Jeffrey Walton
35b213c085
Cleared "unused parameter" warning with GCC 5.1 and -Wextra
2015-07-23 19:30:14 -04:00
Jeffrey Walton
504ba0ea87
Cleared "comparison between signed and unsigned integer" warning in SafeConvert by providing template specializations
2015-07-23 18:15:29 -04:00
Jeffrey Walton
07e8319478
Cleared "unused function" warning when using GCC with -Wall
2015-07-23 14:21:06 -04:00
Jeffrey Walton
b2d9be1b80
Cleared "unused variable" warning when using CRYPTOPP_STATIC_ASSERT under GCC. The "__attribute__ ((unused)" was present in GCC 2.95, so it will be available for the GCC's we support. Non-GCC's will get the non-decorated assert
2015-07-23 12:30:13 -04:00
Jeffrey Walton
ac0f94c23a
Removed branch from rotlVariable. The mask ensures it stays well defined
2015-07-23 04:06:10 -04:00
Jeffrey Walton
1303f4bdcc
Cutover to CRYPTOPP_ASSERT in misc.h. Posix's behavior of "let's crash the program by raising SIGABRT" in Debug builds has got to be one of the most questionable decisions in the history of computing. The new behavior: if there's a SIGTRAP handler somewhere, then the handler will be invoked. Some platforms, like Apple and Microsoft, provide a default SIGTRAP handler. If there's no SIGTRAP handler, then the program will crash just like it raised a SIGABRT. In this case, there's no effective change in behavior
2015-07-23 03:39:13 -04:00
Jeffrey Walton
e6300f52e2
Removed template specializations for Clang using preprocessor for rotFixed due to LLVM Bug 24226. Removed asserts from __rlwinm because the mask ensures the operation is well defined (see the comments in ppc_intrinsics.h)
2015-07-23 01:53:45 -04:00
Jeffrey Walton
2441817708
Improved comment for GCC_DIAGNOSTIC_AWARE
2015-07-21 19:02:11 -04:00
Jeffrey Walton
88f94ed358
Cleared behavior that relied upon undefined behavior
2015-07-19 14:35:30 -04:00
Jeffrey Walton
e874cd2ef8
Fixed spelling error in header comments
2015-07-19 10:57:12 -04:00
Jeffrey Walton
5bd61dcc92
Added inline assembly for left and right rotate under GCC on x86/x86_64
2015-07-19 08:31:58 -04:00
Jeffrey Walton
8cef820ac8
Cleared UBsan error based on undefined shift. Tightened behaviors based on offline conversation with Wei and Denis. One shift error remains due to use of rotVariable by Cast. The UB will be cleared shortly, when specializations using GCC assembler is checked in
2015-07-17 22:21:01 -04:00
Jeffrey Walton
5f299d76a0
Cleared UBsan error on non-null pointers being used with memcpy and memmove from library functions memcpy_s and memmove_s
2015-07-17 21:09:42 -04:00
Jeffrey Walton
172cce3974
Added source code documentation on the rotFixed, rotVariable and rotMod functions
2015-07-17 07:40:16 -04:00
Jeffrey Walton
e7eee759bb
Cleared UBsan errors under GCC 5.1. Cleared signed/unsigned warnings under Visual Studio
2015-07-17 07:16:01 -04:00
Jeffrey Walton
828c550389
Cleared C4242 warning uder Visual Studio
2015-07-13 23:59:01 -04:00
Jeffrey Walton
01caf892e0
Whitespcae check-in
2015-07-13 23:20:36 -04:00
Jeffrey Walton
9bf0eed0f6
Cleared crash with GCC 4.8 and above and -O3. In a nutshell, it was due to vectorization and alignment violations agains the vmovdqa instruction
2015-07-13 22:53:16 -04:00
Jeffrey Walton
b5ed163c87
Cleared UBSan warnings reported by Jonathan Wakely. Cleared many issues reported in GitHub Issue 4 (its a rollup of -fsanitize=undefined)
2015-07-13 20:37:34 -04:00