Update documentation
parent
2ffa70fbc6
commit
195cd6e7c8
4
misc.cpp
4
misc.cpp
|
|
@ -101,12 +101,12 @@ bool VerifyBufsEqual(const byte *buf, const byte *mask, size_t count)
|
||||||
{
|
{
|
||||||
CRYPTOPP_ASSERT(buf != NULLPTR);
|
CRYPTOPP_ASSERT(buf != NULLPTR);
|
||||||
CRYPTOPP_ASSERT(mask != NULLPTR);
|
CRYPTOPP_ASSERT(mask != NULLPTR);
|
||||||
CRYPTOPP_ASSERT(count > 0);
|
// CRYPTOPP_ASSERT(count > 0);
|
||||||
|
|
||||||
size_t i=0;
|
size_t i=0;
|
||||||
byte acc8 = 0;
|
byte acc8 = 0;
|
||||||
|
|
||||||
if (IsAligned<word32>(buf) && IsAligned<word32>(mask))
|
if (IsAligned<word32>(buf) && IsAligned<word32>(mask) && count)
|
||||||
{
|
{
|
||||||
word32 acc32 = 0;
|
word32 acc32 = 0;
|
||||||
if (!CRYPTOPP_BOOL_SLOW_WORD64 && IsAligned<word64>(buf) && IsAligned<word64>(mask))
|
if (!CRYPTOPP_BOOL_SLOW_WORD64 && IsAligned<word64>(buf) && IsAligned<word64>(mask))
|
||||||
|
|
|
||||||
11
misc.h
11
misc.h
|
|
@ -936,11 +936,12 @@ CRYPTOPP_DLL void CRYPTOPP_API xorbuf(byte *output, const byte *input, const byt
|
||||||
/// \param buf1 the first buffer
|
/// \param buf1 the first buffer
|
||||||
/// \param buf2 the second buffer
|
/// \param buf2 the second buffer
|
||||||
/// \param count the size of the buffers, in bytes
|
/// \param count the size of the buffers, in bytes
|
||||||
/// \details The function effectively performs an XOR of the elements in two equally sized
|
/// \details VerifyBufsEqual performs an XOR of the elements in two equally sized
|
||||||
/// buffers and retruns a result based on the XOR operation. The function is near
|
/// buffers and retruns a result based on the XOR operation. A count of 0 returns
|
||||||
/// constant-time because CPU micro-code timings could affect the "constant-ness".
|
/// true because two empty buffers are considered equal.
|
||||||
/// Calling code is responsible for mitigating timing attacks if the buffers are not
|
/// \details The function is near constant-time because CPU micro-code timings could
|
||||||
/// equally sized.
|
/// affect the "constant-ness". Calling code is responsible for mitigating timing
|
||||||
|
/// attacks if the buffers are not equally sized.
|
||||||
/// \sa ModPowerOf2
|
/// \sa ModPowerOf2
|
||||||
CRYPTOPP_DLL bool CRYPTOPP_API VerifyBufsEqual(const byte *buf1, const byte *buf2, size_t count);
|
CRYPTOPP_DLL bool CRYPTOPP_API VerifyBufsEqual(const byte *buf1, const byte *buf2, size_t count);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue