Skip to content

Commit

Permalink
electrum-words: fix bytes_to_words on big endian
Browse files Browse the repository at this point in the history
Reported by cslashm
  • Loading branch information
moneromooo-monero committed Aug 23, 2018
1 parent 510dbf3 commit c955257
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mnemonics/electrum-words.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c955257

Please sign in to comment.