Align buffers for Poly1305 and VMAC
parent
37e02f9e0e
commit
09023bf45e
|
|
@ -34,7 +34,9 @@ void Poly1305_Base<T>::UncheckedSetKey(const byte *key, unsigned int length, con
|
|||
if (params.GetValue(Name::IV(), t) && t.begin() && t.size())
|
||||
{
|
||||
// Nonce key is a class member to avoid the zeroizer on a temporary
|
||||
m_cipher.ProcessBlock(t.begin(), m_nk.begin());
|
||||
CRYPTOPP_ASSERT(t.size() == m_nk.size());
|
||||
std::memcpy(m_nk.begin(), t.begin(), m_nk.size());
|
||||
m_cipher.ProcessBlock(m_nk.begin());
|
||||
|
||||
m_n[0] = GetWord<word32>(false, LITTLE_ENDIAN_ORDER, m_nk + 0);
|
||||
m_n[1] = GetWord<word32>(false, LITTLE_ENDIAN_ORDER, m_nk + 4);
|
||||
|
|
|
|||
4
vmac.cpp
4
vmac.cpp
|
|
@ -69,8 +69,8 @@ void VMAC_Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, con
|
|||
cipher.SetKey(userKey, keylength, params);
|
||||
const unsigned int blockSize = cipher.BlockSize();
|
||||
const unsigned int blockSizeInWords = blockSize / sizeof(word64);
|
||||
SecBlock<word64> out(blockSizeInWords);
|
||||
SecByteBlock in;
|
||||
SecBlock<word64, AllocatorWithCleanup<word64, true> > out(blockSizeInWords);
|
||||
AlignedSecByteBlock in;
|
||||
in.CleanNew(blockSize);
|
||||
size_t i;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue