summaryrefslogtreecommitdiff
path: root/poly1305.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-09-05 16:28:00 -0400
committerJeffrey Walton <noloader@gmail.com>2017-09-05 16:28:00 -0400
commit37e02f9e0e2ee627f0f95b7bc0a09f4ba1ce562e (patch)
treec8b8cc1e9b0b56998eed479f29aa6f3da33f1755 /poly1305.cpp
parent23b939c62b7f497d6f99bfe97ad639b35287ac61 (diff)
downloadcryptopp-git-37e02f9e0e2ee627f0f95b7bc0a09f4ba1ce562e.tar.gz
Revert AltiVec and Power8 commits
The strategy of "cleanup under-aligned buffers" is not scaling well. Corner cases are still turing up. The library has some corner-case breaks, like old 32-bit Intels. And it still has not solved the AltiVec and Power8 alignment problems. For now we are backing out the changes and investigating other strategies
Diffstat (limited to 'poly1305.cpp')
-rw-r--r--poly1305.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/poly1305.cpp b/poly1305.cpp
index 416b462a..9bef7585 100644
--- a/poly1305.cpp
+++ b/poly1305.cpp
@@ -17,7 +17,7 @@ void Poly1305_Base<T>::UncheckedSetKey(const byte *key, unsigned int length, con
if (key && length)
{
// key is {k,r} pair, r is 16 bytes
- length = SaturatingSubtract(length, static_cast<unsigned int>(BLOCKSIZE));
+ length = SaturatingSubtract(length, (unsigned)BLOCKSIZE);
m_cipher.SetKey(key, length);
key += length;
@@ -34,9 +34,7 @@ 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
- CRYPTOPP_ASSERT(t.size() == m_nk.size());
- std::memcpy(m_nk.begin(), t.begin(), t.size());
- m_cipher.ProcessBlock(m_nk.begin(), m_nk.begin());
+ m_cipher.ProcessBlock(t.begin(), 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);