From 82672378e5d68e0ccedaa324f98e643d5789f95d Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 24 Dec 2020 14:37:52 -0500 Subject: Update comments --- secblock.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'secblock.h') diff --git a/secblock.h b/secblock.h index b59c431e..d7546604 100644 --- a/secblock.h +++ b/secblock.h @@ -527,9 +527,16 @@ private: int off = reinterpret_cast(m_array) % 8; byte* ptr = reinterpret_cast(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(ptr >= + reinterpret_cast(m_array) + ); + // Verify the upper bound. Allocated array with + // pad is large enough. CRYPTOPP_ASSERT( reinterpret_cast(ptr+S*sizeof(T)) <= reinterpret_cast(m_array+(S+PAD)) -- cgit v1.2.1