summaryrefslogtreecommitdiff
path: root/secblock.h
Commit message (Collapse)AuthorAgeFilesLines
* Clean GCC 10 Analyzer warningsJeffrey Walton2020-05-101-2/+3
|
* Use size_type in allocator functionsJeffrey Walton2019-10-141-11/+13
|
* Cleanup asserts in SecBlockJeffrey Walton2019-10-141-17/+34
| | | | SecBlock regularly uses NULL pointers rather returning non-NULL 0-sized pointers. The asserts were moved to AlignedAllocate and UnalignedAllocate.
* Avoid circular dependency using AlignedAllocate (GH #885)Jeffrey Walton2019-09-281-1/+2
|
* Use AlignedDeallocate if T_Align16 in deallocate (GH #875)Jeffrey Walton2019-09-271-10/+9
| | | | This should match the behavior of allocate
* Remove unneeded size check (GH #875)Jeffrey Walton2019-09-271-2/+2
|
* Update documentationJeffrey Walton2019-08-311-155/+174
|
* Fix spellingJeffrey Walton2019-02-061-1/+1
|
* Fix clang warnings (GH #771)Marcel Raad2019-01-021-2/+2
|
* Fix missing SunCC Allocator::max_size(size_type) member function (GH #770)Jeffrey Walton2019-01-011-0/+6
|
* Fix alignment on AIX (GH #745)Jeffrey Walton2018-11-221-12/+14
|
* Add additional assert to FixedSizeAllocatorWithCleanup (GH #745)Jeffrey Walton2018-11-211-0/+3
| | | | This assert checks the array we return to the caller is large enough. Spoiler alert... it is not always large enough, like on 64-bit AIX. The linker on AIX appears to align smaller than 8-bytes
* Clear documentation warning due to specializationJeffrey Walton2018-08-281-4/+0
| | | | The specialization pivoted on T_Align16 so it is not longer a template parameter
* Update commentsJeffrey Walton2018-08-241-2/+12
|
* Fix partial specializations for FixedSizeAllocatorWithCleanup (PR #710)Jeffrey Walton2018-08-241-10/+33
| | | | | Commit afbd3e60f68f 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 afbd3e60f68f and e054d36dc88d00. We also add more comments so the next person has understands why things are done they way they are.
* Fix alignment on Win32 and Solaris Sparc (PR #709)Jeffrey Walton2018-08-231-2/+9
| | | | | | | 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 e054d36dc88d. 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.
* Add partial specializations for FixedSizeAllocatorWithCleanupJeffrey Walton2018-08-231-35/+192
| | | | | 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.
* Fix SecBlock ELEMS_MAX in Visual Studio .Net (2002 and 2003)Jeffrey Walton2018-08-201-0/+4
|
* Update commentsJeffrey Walton2018-07-301-8/+10
|
* Fix FixedSizeAllocatorWithCleanup assert on SolarisJeffrey Walton2018-07-301-1/+27
|
* Fix clang warnings in headers (#655)Marcel Raad2018-05-101-3/+3
| | | | | | | | | | * 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.
* Fix compile error on Windows due to symbol U collision (GH #599)Jeffrey Walton2018-03-161-16/+16
| | | | A package called cpprest provides U as a macro
* Remove unneeded Doxygen directiveJeffrey Walton2018-01-191-11/+0
|
* Change Doxygen comment style from //! to ///Jeffrey Walton2017-11-291-366/+366
| | | | Also see https://groups.google.com/forum/#!topic/cryptopp-users/A7-Xt5Knlzw
* Update documentationJeffrey Walton2017-09-271-0/+14
|
* Back-off assert in SecBlockJeffrey Walton2017-09-021-2/+4
| | | | Since removing the allocator overloards that handled the wipe mark, we have to route deallocate into the standard one. The standard one fires an assert for [now] normal operation
* Remove unneeded deallocate (GH #485)Jeffrey Walton2017-08-311-6/+0
| | | | This should have been yanked when we removed the same for allocate
* Remove deallocate() overload in SecBlock for AIX (GH #485)Jeffrey Walton2017-08-311-45/+1
|
* Actually fix the VS2010 compilation bug. I somehow missed this in the first ↵Wyatt O'Day2017-08-301-1/+1
| | | | | pull request. (#482) Thank you very much.
* Fix compilation of secblock.h under Visual Studio 2010 (which only has ↵Wyatt O'Day2017-08-291-1/+1
| | | | partial C++ 2011 support). (#477)
* Test align 16 for i386 and x86_64Jeffrey Walton2017-08-271-1/+1
| | | | Take 2
* Test align 16 for i386 and x86_64Jeffrey Walton2017-08-271-2/+2
|
* Update documentationJeffrey Walton2017-08-191-5/+13
|
* Fix MSC C4100 warning for sizeJeffrey Walton2017-08-181-0/+2
| | | | Also see commit 42b7c4ea5673.
* Clear Coverity finding CONSTANT_EXPRESSION_RESULT (CID 182772)Jeffrey Walton2017-08-181-1/+5
| | | | This may create a MSC warning about a conditional expression being constant
* Fix constexpr issues under GCC 4.1.2 found on CentOS 5Jeffrey Walton2017-08-171-1/+1
|
* Add ELEMS_MAX for SecBlock (Issue 346)Jeffrey Walton2017-08-151-15/+55
| | | | Reset the mark on additional class methods
* Make SecBlock<T,A> data members protectedJeffrey Walton2017-07-271-1/+1
| | | | Also see http://github.com/weidai11/cryptopp/issues/448
* Update documentationJeffrey Walton2017-07-271-5/+3
| | | | This cleanup was performed using Clang and -Wdocumentation -Wno-documentation-deprecated-sync
* Revert "Revert "Clear Visual Studio warnings (Issue 412)""Jeffrey Walton2017-06-021-2/+2
| | | | This reverts commit c3871aec948013c1a4d5613050c659520f59e2e4.
* Revert "Clear Visual Studio warnings (Issue 412)"Jeffrey Walton2017-06-021-2/+2
| | | | This reverts commit eb3b27a6a543. The change broke GCC 4.8 and unknown version of Clang on OS X. UB reported the OS X break, and JW found duplicated the break on a ARM CubieTruck with GCC 4.8.
* Clear Visual Studio warnings (Issue 412)Jeffrey Walton2017-05-301-2/+2
|
* Remove VC++ 6.0 guard and code (Issue 342)Jeffrey Walton2017-03-011-4/+0
|
* Add C++ nullptr support (Issue 383)Jeffrey Walton2017-03-011-11/+11
|
* Change next version from 5.7 to 6.0Jeffrey Walton2017-02-211-1/+1
| | | | Crypto++ 5.7 was the increment after the 5.6.5 release. Crypto++ 6.0 accurately reflects compatibility
* Add NIST SP800-90A HMAC_DRBG generatorJeffrey Walton2017-02-071-5/+5
| | | | | Move bodies out-of-line Whitespace
* Add SecBlock member to track number of elements to zeroize (Issue 346)Jeffrey Walton2017-01-281-28/+111
| | | | | By default the member, named m_mark, is set to the maximum number of elements. If SetMark() is called, then m_mark is adjusted. Upon deallocation and zeroization, STDMIN(m_size, m_mark) elements are zeroized. We wanted to use a high water mark, but we could not track the writes to the allocation. operator[] would have been OK, but ::memcpy would have been problematic
* Change file preamble to include "originally written by Wei Dai"Jeffrey Walton2017-01-271-1/+1
| | | | We have made a fair number of changes, and we don't want WD to receive credit for issues he was not part of
* Add CRYPTOPP_ASSERT (Issue 277, CVE-2016-7420)Jeffrey Walton2016-09-161-16/+16
| | | | 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
* Fixed use of FixedSizeAlignedSecBlock and non-aligned allocator in ↵Jeffrey Walton2016-09-091-1/+4
| | | | validat1.cpp (Issue 256)