Skip to content

Commit e455de3

Browse files
committed
fscrypt: add comments that describe the HKDF info strings
Each HKDF context byte is associated with a specific format of the remaining part of the application-specific info string. Add comments so that it's easier to keep track of what these all are. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Eric Biggers <[email protected]>
1 parent 4f74d15 commit e455de3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

fs/crypto/fscrypt_private.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,13 @@ int fscrypt_init_hkdf(struct fscrypt_hkdf *hkdf, const u8 *master_key,
312312
* outputs are unique and cryptographically isolated, i.e. knowledge of one
313313
* output doesn't reveal another.
314314
*/
315-
#define HKDF_CONTEXT_KEY_IDENTIFIER 1
316-
#define HKDF_CONTEXT_PER_FILE_ENC_KEY 2
317-
#define HKDF_CONTEXT_DIRECT_KEY 3
318-
#define HKDF_CONTEXT_IV_INO_LBLK_64_KEY 4
319-
#define HKDF_CONTEXT_DIRHASH_KEY 5
320-
#define HKDF_CONTEXT_IV_INO_LBLK_32_KEY 6
321-
#define HKDF_CONTEXT_INODE_HASH_KEY 7
315+
#define HKDF_CONTEXT_KEY_IDENTIFIER 1 /* info=<empty> */
316+
#define HKDF_CONTEXT_PER_FILE_ENC_KEY 2 /* info=file_nonce */
317+
#define HKDF_CONTEXT_DIRECT_KEY 3 /* info=mode_num */
318+
#define HKDF_CONTEXT_IV_INO_LBLK_64_KEY 4 /* info=mode_num||fs_uuid */
319+
#define HKDF_CONTEXT_DIRHASH_KEY 5 /* info=file_nonce */
320+
#define HKDF_CONTEXT_IV_INO_LBLK_32_KEY 6 /* info=mode_num||fs_uuid */
321+
#define HKDF_CONTEXT_INODE_HASH_KEY 7 /* info=<empty> */
322322

323323
int fscrypt_hkdf_expand(const struct fscrypt_hkdf *hkdf, u8 context,
324324
const u8 *info, unsigned int infolen,

0 commit comments

Comments
 (0)