diff options
author | Jeffrey Walton <noloader@gmail.com> | 2020-12-24 14:37:52 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2020-12-24 14:37:52 -0500 |
commit | 82672378e5d68e0ccedaa324f98e643d5789f95d (patch) | |
tree | 23e8cc01bc5295a3f4503bdf6ba0ab40ffe13eb6 /secblock.h | |
parent | 0b70a5e733a96c56dafdc183cd35effddedac48a (diff) | |
download | cryptopp-git-82672378e5d68e0ccedaa324f98e643d5789f95d.tar.gz |
Update comments
Diffstat (limited to 'secblock.h')
-rw-r--r-- | secblock.h | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -527,9 +527,16 @@ private: int off = reinterpret_cast<uintptr_t>(m_array) % 8;
byte* ptr = reinterpret_cast<byte*>(m_array) + off;
- // Verify the 16-byte alignment
+ // Verify the 16-byte alignment. This is the point
+ // of these extra gyrations.
CRYPTOPP_ASSERT(IsAlignedOn(ptr, 16));
- // Verify allocated array with pad is large enough.
+ // Verify the lower bound. This is Issue 982/988.
+ CRYPTOPP_ASSERT(
+ reinterpret_cast<uintptr_t>(ptr >=
+ reinterpret_cast<uintptr_t>(m_array)
+ );
+ // Verify the upper bound. Allocated array with
+ // pad is large enough.
CRYPTOPP_ASSERT(
reinterpret_cast<uintptr_t>(ptr+S*sizeof(T)) <=
reinterpret_cast<uintptr_t>(m_array+(S+PAD))
|