From 37e02f9e0e2ee627f0f95b7bc0a09f4ba1ce562e Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 5 Sep 2017 16:28:00 -0400 Subject: 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 --- poly1305.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'poly1305.cpp') 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::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(BLOCKSIZE)); + length = SaturatingSubtract(length, (unsigned)BLOCKSIZE); m_cipher.SetKey(key, length); key += length; @@ -34,9 +34,7 @@ void Poly1305_Base::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(false, LITTLE_ENDIAN_ORDER, m_nk + 0); m_n[1] = GetWord(false, LITTLE_ENDIAN_ORDER, m_nk + 4); -- cgit v1.2.1