diff --git a/crypto/slip39.c b/crypto/slip39.c index b9bd5c3f4..61e994c6f 100644 --- a/crypto/slip39.c +++ b/crypto/slip39.c @@ -37,7 +37,7 @@ const char* get_word(uint16_t index) { return NULL; } - return wordlist[index]; + return slip39_wordlist[index]; } /** @@ -51,13 +51,13 @@ bool word_index(uint16_t* index, const char* word, uint8_t word_length) { while ((hi - lo) > 1) { mid = (hi + lo) / 2; - if (strncmp(wordlist[mid], word, word_length) > 0) { + if (strncmp(slip39_wordlist[mid], word, word_length) > 0) { hi = mid; } else { lo = mid; } } - if (strncmp(wordlist[lo], word, word_length) != 0) { + if (strncmp(slip39_wordlist[lo], word, word_length) != 0) { return false; } *index = lo; diff --git a/crypto/slip39_wordlist.h b/crypto/slip39_wordlist.h index 34fe1991d..35bcd28a0 100644 --- a/crypto/slip39_wordlist.h +++ b/crypto/slip39_wordlist.h @@ -22,11 +22,14 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#ifndef __SLIP39_WORDLIST_H__ +#define __SLIP39_WORDLIST_H__ + #include #define WORDS_COUNT 1024 -static const char* const wordlist[WORDS_COUNT] = { +static const char* const slip39_wordlist[WORDS_COUNT] = { "academic", "acid", "acne", "acquire", "acrobat", "activity", "actress", "adapt", "adequate", "adjust", "admit", "adorn", "adult", "advance", "advocate", "afraid", "again", "agency", @@ -1236,3 +1239,5 @@ static const uint16_t words_button_seq[WORDS_COUNT] = { 9641, // yoga 9376, // zero }; + +#endif