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:
parent
f4fe7c9aa5
commit
7e7b40b434
2
bip39.c
2
bip39.c
@ -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;
|
||||||
}
|
}
|
||||||
|
2
bip39.h
2
bip39.h
@ -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
|
||||||
|
@ -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",
|
||||||
|
Loading…
Reference in New Issue
Block a user