From a3893e683c54343c7b85489feeb8f630e49660a5 Mon Sep 17 00:00:00 2001 From: Anton Sosnin Date: Mon, 14 Oct 2024 13:03:21 +0300 Subject: [PATCH 1/2] Fix compile error: add iostream in word_list.h --- src/include/bip39/word_list.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/include/bip39/word_list.h b/src/include/bip39/word_list.h index 502fad7..37b0608 100644 --- a/src/include/bip39/word_list.h +++ b/src/include/bip39/word_list.h @@ -1,6 +1,7 @@ #ifndef BIP39_WORD_LIST_H #define BIP39_WORD_LIST_H +#include #include #include From fb2192341262e531225fd3c6e5d465ece7f22a33 Mon Sep 17 00:00:00 2001 From: Anton Sosnin Date: Mon, 14 Oct 2024 15:52:34 +0300 Subject: [PATCH 2/2] Add random device for random engine --- src/bip39.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bip39.cpp b/src/bip39.cpp index 07f5b74..9f25132 100644 --- a/src/bip39.cpp +++ b/src/bip39.cpp @@ -120,7 +120,7 @@ word_list generate_mnemonic(entropy_bits_t entropy /* = entropy_bits::_128 */, l assert((total_bits % BITS_PER_WORD) == 0); assert((word_count % MNEMONIC_WORD_MULTIPLE) == 0); - random_bytes_engine rbe; + random_bytes_engine rbe(std::random_device{}()); std::vector data(entropy_bits / BYTE_BITS); std::generate(begin(data), end(data), [&rbe]() { return static_cast(std::ref(rbe)()); }); return create_mnemonic(data, lang);