Update comments

This commit is contained in:
Jeffrey Walton 2018-08-24 12:19:42 -04:00
parent beed647df2
commit 4fb9fbf5ac
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
3 changed files with 16 additions and 6 deletions

View File

@ -152,8 +152,8 @@ public:
{
CRYPTOPP_ASSERT(in != NULLPTR);
CRYPTOPP_ASSERT(out != NULLPTR);
CRYPTOPP_ASSERT(IsAligned<T_HashWordType*>(in));
CRYPTOPP_ASSERT(IsAligned<T_HashWordType*>(out));
CRYPTOPP_ASSERT(IsAligned<T_HashWordType>(in));
CRYPTOPP_ASSERT(IsAligned<T_HashWordType>(out));
ConditionalByteReverse(T_Endianness::ToEnum(), out, in, byteCount);
}

4
misc.h
View File

@ -2072,8 +2072,8 @@ void ByteReverse(T *out, const T *in, size_t byteCount)
{
// Alignment check due to Issues 690
CRYPTOPP_ASSERT(byteCount % sizeof(T) == 0);
CRYPTOPP_ASSERT(IsAligned<T*>(in));
CRYPTOPP_ASSERT(IsAligned<T*>(out));
CRYPTOPP_ASSERT(IsAligned<T>(in));
CRYPTOPP_ASSERT(IsAligned<T>(out));
size_t count = byteCount/sizeof(T);
for (size_t i=0; i<count; i++)

View File

@ -511,8 +511,13 @@ private:
#else
// The 8-byte alignments follows convention of Linux and Windows.
// Linux and Windows receives most testing. Duplicate it here for
// other platforms like AIX and Solaris. AIX and Solaris often use
// alignments smaller than expected. In fact AIX caught us by
// surprise with word16 and word32.
T* GetAlignedArray() {return m_array;}
T m_array[S];
CRYPTOPP_ALIGN_DATA(8) T m_array[S];
#endif
A m_fallbackAllocator;
@ -657,8 +662,13 @@ public:
private:
// The 8-byte alignments follows convention of Linux and Windows.
// Linux and Windows receives most testing. Duplicate it here for
// other platforms like AIX and Solaris. AIX and Solaris often use
// alignments smaller than expected. In fact AIX caught us by
// surprise with word16 and word32.
T* GetAlignedArray() {return m_array;}
T m_array[S];
CRYPTOPP_ALIGN_DATA(8) T m_array[S];
A m_fallbackAllocator;
bool m_allocated;