Skip to content

Commit 4f04a35

Browse files
committed
keystore: add some helpful comments
1 parent edeefe9 commit 4f04a35

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/keystore.c

+5
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,20 @@
3636

3737
// Change this ONLY via keystore_unlock() or keystore_lock()
3838
static bool _is_unlocked_device = false;
39+
// Stores a random key after unlock which, after stretching, is used to encrypt the retained seed.
3940
static uint8_t _unstretched_retained_seed_encryption_key[32] = {0};
4041
// Must be defined if is_unlocked is true. ONLY ACCESS THIS WITH keystore_copy_seed().
42+
// Stores the encrypted seed after unlock.
4143
static uint8_t _retained_seed_encrypted[KEYSTORE_MAX_SEED_LENGTH + 64] = {0};
4244
static size_t _retained_seed_encrypted_len = 0;
4345

4446
// Change this ONLY via keystore_unlock_bip39().
4547
static bool _is_unlocked_bip39 = false;
48+
// Stores a random keyy after bip39-unlock which, after stretching, is used to encrypt the retained
49+
// bip39 seed.
4650
static uint8_t _unstretched_retained_bip39_seed_encryption_key[32] = {0};
4751
// Must be defined if _is_unlocked is true. ONLY ACCESS THIS WITH _copy_bip39_seed().
52+
// Stores the encrypted BIP-39 seed after bip39-unlock.
4853
static uint8_t _retained_bip39_seed_encrypted[64 + 64] = {0};
4954
static size_t _retained_bip39_seed_encrypted_len = 0;
5055

0 commit comments

Comments
 (0)