Update comments
parent
b3278a3cd2
commit
952ec1c5c8
|
|
@ -52,7 +52,7 @@ void PadlockRNG::GenerateBlock(byte *output, size_t size)
|
|||
);
|
||||
|
||||
const size_t ret = m_msr & 0x1f;
|
||||
const size_t rem = STDMIN<size_t>(ret, STDMIN<size_t>(size, 16U));
|
||||
const size_t rem = STDMIN<size_t>(ret, STDMIN<size_t>(size, 16U /*buffer size*/));
|
||||
std::memcpy(output, m_buffer, rem);
|
||||
size -= rem; output += rem;
|
||||
}
|
||||
|
|
@ -71,7 +71,7 @@ void PadlockRNG::GenerateBlock(byte *output, size_t size)
|
|||
}
|
||||
|
||||
const size_t ret = (m_msr = result) & 0x1f;
|
||||
const size_t rem = STDMIN<size_t>(ret, STDMIN<size_t>(size, 16U));
|
||||
const size_t rem = STDMIN<size_t>(ret, STDMIN<size_t>(size, 16U /*buffer size*/));
|
||||
std::memcpy(output, buffer, rem);
|
||||
size -= rem; output += rem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@ public:
|
|||
|
||||
//! \brief Generate and discard n bytes
|
||||
//! \param n the number of bytes to generate and discard
|
||||
//! \details the RDSEED generator discards words, not bytes. If n is
|
||||
//! not a multiple of a machine word, then it is rounded up to
|
||||
//! \details the Padlock generator discards words, not bytes. If n is
|
||||
//! not a multiple of a 32-bit word, then it is rounded up to
|
||||
//! that size.
|
||||
virtual void DiscardBytes(size_t n);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue