aboutsummaryrefslogtreecommitdiff
path: root/src/mnemonics/electrum-words.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-08-04 16:20:44 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-08-23 07:58:23 +0000
commitc955257c4ad4118c30ee757ffc00599379ad3f7c (patch)
tree87c80ffec51c322bd5bf4bb38582c094ab3df83e /src/mnemonics/electrum-words.cpp
parentMerge pull request #4249 (diff)
downloadmonero-c955257c4ad4118c30ee757ffc00599379ad3f7c.tar.xz
electrum-words: fix bytes_to_words on big endian
Reported by cslashm
Diffstat (limited to 'src/mnemonics/electrum-words.cpp')
-rw-r--r--src/mnemonics/electrum-words.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mnemonics/electrum-words.cpp b/src/mnemonics/electrum-words.cpp
index 290f2cb93..3d6338856 100644
--- a/src/mnemonics/electrum-words.cpp
+++ b/src/mnemonics/electrum-words.cpp
@@ -47,6 +47,7 @@
#include "misc_language.h"
#include "crypto/crypto.h" // for declaration of crypto::secret_key
#include <fstream>
+#include "common/int-util.h"
#include "mnemonics/electrum-words.h"
#include <stdexcept>
#include <boost/filesystem.hpp>
@@ -411,7 +412,7 @@ namespace crypto
{
uint32_t w[4];
- memcpy(&w[0], src + (i * 4), 4);
+ w[0] = SWAP32LE(*(const uint32_t*)(src + (i * 4)));
w[1] = w[0] % word_list_length;
w[2] = ((w[0] / word_list_length) + w[1]) % word_list_length;