mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-23 13:47:47 +00:00
electrum-words: fix bytes_to_words on big endian
Reported by cslashm
This commit is contained in:
parent
510dbf3329
commit
c955257c4a
1 changed files with 2 additions and 1 deletions
|
@ -47,6 +47,7 @@
|
||||||
#include "misc_language.h"
|
#include "misc_language.h"
|
||||||
#include "crypto/crypto.h" // for declaration of crypto::secret_key
|
#include "crypto/crypto.h" // for declaration of crypto::secret_key
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include "common/int-util.h"
|
||||||
#include "mnemonics/electrum-words.h"
|
#include "mnemonics/electrum-words.h"
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
@ -411,7 +412,7 @@ namespace crypto
|
||||||
{
|
{
|
||||||
uint32_t w[4];
|
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[1] = w[0] % word_list_length;
|
||||||
w[2] = ((w[0] / word_list_length) + w[1]) % word_list_length;
|
w[2] = ((w[0] / word_list_length) + w[1]) % word_list_length;
|
||||||
|
|
Loading…
Reference in a new issue