1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-15 09:50:57 +00:00

Make word list const

This makes the pointers to the words constant.  It moves 8kb from ram
to flash.  It changes the return type of mnemonic_wordlist() to reflect
this change.  Everyone calling it should also change the type to
`const char * const *`.
This commit is contained in:
Jochen Hoenicke 2015-02-14 12:00:44 +01:00
parent f4fe7c9aa5
commit 7e7b40b434
3 changed files with 3 additions and 3 deletions

View File

@ -155,7 +155,7 @@ void mnemonic_to_seed(const char *mnemonic, const char *passphrase, uint8_t seed
pbkdf2_hmac_sha512((const uint8_t *)mnemonic, strlen(mnemonic), salt, saltlen, BIP39_PBKDF2_ROUNDS, seed, 512 / 8, progress_callback); pbkdf2_hmac_sha512((const uint8_t *)mnemonic, strlen(mnemonic), salt, saltlen, BIP39_PBKDF2_ROUNDS, seed, 512 / 8, progress_callback);
} }
const char **mnemonic_wordlist(void) const char * const *mnemonic_wordlist(void)
{ {
return wordlist; return wordlist;
} }

View File

@ -36,6 +36,6 @@ int mnemonic_check(const char *mnemonic);
void mnemonic_to_seed(const char *mnemonic, const char *passphrase, uint8_t seed[512 / 8], void (*progress_callback)(uint32_t current, uint32_t total)); void mnemonic_to_seed(const char *mnemonic, const char *passphrase, uint8_t seed[512 / 8], void (*progress_callback)(uint32_t current, uint32_t total));
const char **mnemonic_wordlist(void); const char * const *mnemonic_wordlist(void);
#endif #endif

View File

@ -21,7 +21,7 @@
* OTHER DEALINGS IN THE SOFTWARE. * OTHER DEALINGS IN THE SOFTWARE.
*/ */
const char *wordlist[] = { const char * const wordlist[] = {
"abandon", "abandon",
"ability", "ability",
"able", "able",