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 *`.
pull/25/head
Jochen Hoenicke 10 years ago
parent f4fe7c9aa5
commit 7e7b40b434

@ -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);
}
const char **mnemonic_wordlist(void)
const char * const *mnemonic_wordlist(void)
{
return wordlist;
}

@ -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));
const char **mnemonic_wordlist(void);
const char * const *mnemonic_wordlist(void);
#endif

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

Loading…
Cancel
Save