diff options
author | Jeffrey Walton <noloader@gmail.com> | 2019-01-27 06:37:48 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2019-01-27 06:37:48 -0500 |
commit | 33e401116c55911260fb0dd8546d44b3b25adb96 (patch) | |
tree | 471b5111201e6d2c2e474346fe9c9bbfcbb330e5 /poly1305.cpp | |
parent | 4d2597940365c59cf8abb2b53c97863983783f76 (diff) | |
download | cryptopp-git-33e401116c55911260fb0dd8546d44b3b25adb96.tar.gz |
Fix Poly1305TLS on big-endian systems (GH #727)
Diffstat (limited to 'poly1305.cpp')
-rw-r--r-- | poly1305.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/poly1305.cpp b/poly1305.cpp index fe1ae499..1d8abf9e 100644 --- a/poly1305.cpp +++ b/poly1305.cpp @@ -322,7 +322,10 @@ void Poly1305TLS_Base::UncheckedSetKey(const byte *key, unsigned int length, con m_r[3] = GetWord<word32>(false, LITTLE_ENDIAN_ORDER, key + 12) & 0x0ffffffc;
key += 16;
- std::memcpy(m_n, key, 16);
+ m_n[0] = GetWord<word32>(false, LITTLE_ENDIAN_ORDER, key + 0);
+ m_n[1] = GetWord<word32>(false, LITTLE_ENDIAN_ORDER, key + 4);
+ m_n[2] = GetWord<word32>(false, LITTLE_ENDIAN_ORDER, key + 8);
+ m_n[3] = GetWord<word32>(false, LITTLE_ENDIAN_ORDER, key + 12);
Restart();
}
|