Commit Graph

4054 Commits (4fb9fbf5ac8a0659f1b8dd5cbbbb3aa666f4cb19)

Author SHA1 Message Date
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 243673c32a
Add notes on -stdlib=libc++ for MacOS 2018-08-24 04:43:12 -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 e054d36dc8
Add partial specializations for FixedSizeAllocatorWithCleanup
This allocator still has some demons buried inside due to the bit fiddling. This commit should isolate the demons to aligned stack allocations when an alignment facility from the platform or OS is not available. That is, we use CRYPTOPP_ALIGN_DATA when we can because it is most reliable.
We can tell when things have gone sideways using Debug builds. The CRYPTOPP_ASSERT(m_allocated) will fire on destruction because the flag gets overwritten.
2018-08-23 07:08:34 -04:00
Jeffrey Walton 8382b49a1f
Fix compile using Nmake
LNK2019: unresolved external symbol CryptoPP::KeccakF1600(...)
2018-08-23 05:01:31 -04:00
Jeffrey Walton f3238742b2
Fix compile with IBM XLC
-pthread was causing "xlC: 1501-210 (W) command option t contains an incorrect subargument"
2018-08-23 04:56:45 -04:00
Jeffrey Walton 099883777d
Use ANONYMOUS_NAMESPACE_END 2018-08-23 01:11:45 -04:00
Jeffrey Walton 8c450a9f7a
Avoid Singleton when possible (GH #708)
Also clear several sign conversion warnings
2018-08-22 16:36:05 -04:00
Jeffrey Walton 0ba3687c39
Update comments 2018-08-22 14:46:30 -04:00
Jeffrey Walton af17fdf91b
Add -Wno-deprecated for PPC tests due to vec_ld and vec_st 2018-08-22 10:12:24 -04:00
Jeffrey Walton 4ab06b7803
Update Visual Studio 2005 project files 2018-08-22 03:17:04 -04:00
Jeffrey Walton 40d75271ec
Add keccakc.h and keccakc.cpp to Filelist.txt 2018-08-22 00:54:19 -04:00
Jeffrey Walton b9a6034a81
Add keccakc.h and keccakc.cpp for shared F1600 2018-08-22 00:40:30 -04:00
Jeffrey Walton 60c5146c5e
Update comments in integer.cpp 2018-08-21 15:10:22 -04:00
Jeffrey Walton a65cf70ff8
Update comments in integer.cpp 2018-08-21 15:03:20 -04:00
Jeffrey Walton 81f8c48faf
Avoid std::call_once (GH #707)
This commit also favors init priorities over C++ dynamic initialization. After the std::call_once problems on Sparc and PowerPC I'm worried about problems with Dynamic Initialization and Destruction with Concurrency.
We also do away with supressing warnings and use CRYPTOPP_UNUSED instead.
2018-08-21 12:53:10 -04:00
Jeffrey Walton 6b93c284fe
Use bitwise not 0 for last block flag 2018-08-21 11:25:39 -04:00
Jeffrey Walton a9c5c56d21
Switch to SaturatingSubtract to guard against wrap on user parameters 2018-08-21 11:21:20 -04:00
Jeffrey Walton 4a86ad67bf
Clear initialization warning due to non-trivial destructor 2018-08-21 10:45:44 -04:00
Jeffrey Walton 899236b99c
Tweak Makefile test to compile but not link (GH #707) 2018-08-21 06:28:28 -04:00
Jeffrey Walton c3dd09b93e
Update messages in cryptest.sh 2018-08-20 22:53:39 -04:00
Jeffrey Walton 87493974c7
Add Power8 VMULL tests to cryptest.sh 2018-08-20 22:48:38 -04:00
Jeffrey Walton c0b1116082
Fix compile on Visual Studio 2005 without service packs 2018-08-20 15:22:48 -04:00
Jeffrey Walton cb5795482d
Update Visual Studio 2005 project files 2018-08-20 15:12:35 -04:00
Jeffrey Walton 8db82708e3
Clear conversion wanrings under MSVC 2018-08-20 15:05:42 -04:00
Jeffrey Walton cb6f93c2ba
Update Visual Studio 2005 project files 2018-08-20 14:58:11 -04:00
Jeffrey Walton 3ad077ad82
Clear conversion wanrings under MSVC 2018-08-20 14:08:27 -04:00
Jeffrey Walton 2f906a031b
Clear conversion wanrings under MSVC 2018-08-20 14:01:05 -04:00
Jeffrey Walton 37828ff0ef
Clear conversion wanrings under MSVC 2018-08-20 13:58:58 -04:00
Jeffrey Walton d47f69acf3
Fix SecBlock ELEMS_MAX in Visual Studio .Net (2002 and 2003) 2018-08-20 12:52:33 -04:00
Jeffrey Walton d1a582e81a
Add /DEBUG to cryptest.nmake linker options 2018-08-20 11:42:57 -04:00
Jeffrey Walton c25a1e354d
Clear conversion wanrings under MSVC 2018-08-20 10:44:36 -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 3e9a5f17d2
Disable C4231 in Visual Studio 2005 project files 2018-08-20 07:27:07 -04:00
Jeffrey Walton 01779726db
Use consistent suffix for SSE2 ASM 2018-08-20 07:16:59 -04:00
Jeffrey Walton 8c5a558663
Update Visual Studio 2005 project files 2018-08-20 07:15:17 -04:00
Jeffrey Walton 874f79c320
Fix compile on Visual Studio 2005 without serve packs 2018-08-20 05:35:34 -04:00
Jeffrey Walton 5c3532597a
Whitespace check-in 2018-08-20 01:33:09 -04:00
Jeffrey Walton 082ad86132
Fix missing _xgetbv for Visual Studio 2008 and below 2018-08-19 10:19:29 -04:00
Jeffrey Walton d41b3c8211
Fix linking rdrand.obj twice on Windows using cryptest.nmake 2018-08-19 10:06:20 -04:00
Jeffrey Walton 5489cfe3c6
Remove Asan workaround from VMAC
I was not able to duplicate it under GCC. That includes the GCC's supplied with Debian 8 and Ubuntu 14. It looks like the problem was with Asan insread of the library
2018-08-19 08:32:23 -04:00
Jeffrey Walton 5e3f38cf86
Allow previous version of shared library on Solaris 2018-08-19 07:04:19 -04:00
Jeffrey Walton 3e23c55885
Remove makefile debug print statements 2018-08-19 06:12:09 -04:00
Jeffrey Walton 9886b555d0
Add SONAME to shared object for Solaris
Also see https://blogs.oracle.com/solaris/how-to-name-a-solaris-shared-object-v2
2018-08-19 06:10:30 -04:00
Jeffrey Walton 964b92b614
Rework -pthread test for GCC on Solaris
It looks like GCC is rejecting the -pthread option but it is advertising Pthread support by defining 39 related macros. I'm not sure what to make of it, but we can't use -pthread because it breaks the compile.
2018-08-18 23:51:14 -04:00
Jeffrey Walton 3929c3594c
Add SHACAL2 cipher AlgorithmProvider() 2018-08-18 22:26:01 -04:00
Jeffrey Walton 1f5d0d85cf
Add Tiger cipher AlgorithmProvider() 2018-08-18 21:41:55 -04:00
Jeffrey Walton 92163356db
Move constant table to unnamed namespace 2018-08-18 21:41:13 -04:00