Commit Graph

124 Commits

Author SHA1 Message Date
Jeffrey Walton
d6799a6984
Fix SecBlock Append() overload 2021-04-09 01:40:24 -04:00
Jeffrey Walton
191e08c838
Add SecBlock Append() overloads 2021-04-09 01:23:08 -04:00
Jeffrey Walton
2370263334
Add parameter to CRYPTOPP_INHERIT_ALLOCATOR_TYPES
This allows us to specialize the allocators based on type.
2020-12-30 06:02:57 -05:00
Jeffrey Walton
38cff9aa59
Fix spelling 2020-12-30 03:04:09 -05:00
Jeffrey Walton
78c85f4d73
Update comments 2020-12-29 13:30:38 -05:00
Jeffrey Walton
579a5c8a70
Update comments 2020-12-29 13:24:34 -05:00
Jeffrey Walton
4bc7408ae2
Use 8-byte alignment for FixedSizeAllocatorWithCleanup when 16-byte alignment is false (GH #992) 2020-12-29 01:49:17 -05:00
Jeffrey Walton
b434e4cfbd
Remove special case for FixedSizeAllocatorWithCleanup x86_64 (GH #988) 2020-12-27 00:14:41 -05:00
Jeffrey Walton
3b187a0ff7
Update FixedSizeAllocatorWithCleanup alignment 2020-12-24 16:26:21 -05:00
Jeffrey Walton
bc02bccce5
Fix spelling 2020-12-24 16:18:29 -05:00
Jeffrey Walton
ec3733c378
Fix offset calculation in FixedSizeAllocatorWithCleanup when CRYPTOPP_BOOL_ALIGN16==0 (GH #988) 2020-12-24 15:32:20 -05:00
Jeffrey Walton
a779191c45
Fix missing closing paren 2020-12-24 14:39:25 -05:00
Jeffrey Walton
82672378e5
Update comments 2020-12-24 14:37:52 -05:00
Jeffrey Walton
0b70a5e733
Update comments 2020-12-24 14:22:34 -05:00
Jeffrey Walton
60aa3e7fe9
Fix buffer underrun in FixedSizeAllocatorWithCleanup when CRYPTOPP_BOOL_ALIGN16==0 (GH #982) 2020-12-24 14:20:23 -05:00
Jeffrey Walton
5537d998a1
Fix assert in FixedSizeAllocatorWithCleanup 2020-12-24 13:09:38 -05:00
Jeffrey Walton
b08495b4ec
Fix use of CRYPTOPP_BOOL_ALIGN16 (GH #982) 2020-12-19 19:43:45 -05:00
Jeffrey Walton
ac6987f3ae
Use \return and \throw consitently in the docs 2020-12-07 23:35:10 -05:00
Jeffrey Walton
96344bc767
Use CRYPTOPP_CXX11_STRONG_ENUM define name 2020-08-06 17:55:45 -04:00
Jeffrey Walton
080bbae6dd
Clear GCC analyzer warning 2020-07-17 01:16:16 -04:00
Jeffrey Walton
680956e134
Clean GCC 10 Analyzer warnings 2020-05-10 01:25:39 -04:00
Jeffrey Walton
7b0ec4d4a6
Use size_type in allocator functions 2019-10-14 01:56:30 -04:00
Jeffrey Walton
0c27093ab6
Cleanup asserts in SecBlock
SecBlock regularly uses NULL pointers rather returning non-NULL 0-sized pointers. The asserts were moved to AlignedAllocate and UnalignedAllocate.
2019-10-14 01:00:49 -04:00
Jeffrey Walton
1190da17ea Avoid circular dependency using AlignedAllocate (GH #885) 2019-09-28 18:22:11 -04:00
Jeffrey Walton
f4d68353ca
Use AlignedDeallocate if T_Align16 in deallocate (GH #875)
This should match the behavior of allocate
2019-09-27 12:00:08 -04:00
Jeffrey Walton
b444c02886
Remove unneeded size check (GH #875) 2019-09-27 02:38:40 -04:00
Jeffrey Walton
0c82df181c Update documentation 2019-08-31 07:46:19 -04:00
Jeffrey Walton
0661536bd6
Fix spelling 2019-02-06 01:23:27 -05:00
Marcel Raad
1a4b851ac1 Fix clang warnings (GH #771) 2019-01-02 12:05:26 -05:00
Jeffrey Walton
e5085684ef
Fix missing SunCC Allocator::max_size(size_type) member function (GH #770) 2019-01-01 17:56:26 -05:00
Jeffrey Walton
8d4103fb0c
Fix alignment on AIX (GH #745) 2018-11-22 00:15:37 -05:00
Jeffrey Walton
6cf8895bf1
Add additional assert to FixedSizeAllocatorWithCleanup (GH #745)
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
2018-11-21 23:04:00 -05:00
Jeffrey Walton
aa45eca561
Clear documentation warning due to specialization
The specialization pivoted on T_Align16 so it is not longer a template parameter
2018-08-28 21:27:48 -04:00
Jeffrey Walton
4fb9fbf5ac
Update comments 2018-08-24 12:19:42 -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
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
d47f69acf3
Fix SecBlock ELEMS_MAX in Visual Studio .Net (2002 and 2003) 2018-08-20 12:52:33 -04:00
Jeffrey Walton
4fc5b8da13
Update comments 2018-07-30 15:18:59 -04:00
Jeffrey Walton
973fbf0e2f
Fix FixedSizeAllocatorWithCleanup assert on Solaris 2018-07-30 11:27:50 -04:00
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
Jeffrey Walton
244abbe41c
Fix compile error on Windows due to symbol U collision (GH #599)
A package called cpprest provides U as a macro
2018-03-16 09:00:50 -04:00
Jeffrey Walton
befd04312d
Remove unneeded Doxygen directive 2018-01-19 14:31:20 -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
69fd4a040d
Update documentation 2017-09-27 06:24:58 -04:00
Jeffrey Walton
4a28391495
Back-off assert in SecBlock
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
2017-09-02 19:22:53 -04:00
Jeffrey Walton
b47de6150f
Remove unneeded deallocate (GH #485)
This should have been yanked when we removed the same for allocate
2017-08-31 22:50:09 -04:00
Jeffrey Walton
d8b30e1bd4
Remove deallocate() overload in SecBlock for AIX (GH #485) 2017-08-31 11:23:37 -04:00
Wyatt O'Day
23809a3576 Actually fix the VS2010 compilation bug. I somehow missed this in the first pull request. (#482)
Thank you very much.
2017-08-30 13:46:14 -04:00
Wyatt O'Day
5149237a5d Fix compilation of secblock.h under Visual Studio 2010 (which only has partial C++ 2011 support). (#477) 2017-08-29 14:55:01 -04:00