From d5d0e8c7203a41c01ba05f4e053e16a94ce3c2e1 Mon Sep 17 00:00:00 2001 From: Michael Halcrow Date: Sun, 12 Apr 2015 00:56:17 -0400 Subject: ext4 crypto: filename encryption facilities Signed-off-by: Uday Savagaonkar Signed-off-by: Ildar Muslukhov Signed-off-by: Michael Halcrow Signed-off-by: Theodore Ts'o --- fs/ext4/ext4_crypto.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'fs/ext4/ext4_crypto.h') diff --git a/fs/ext4/ext4_crypto.h b/fs/ext4/ext4_crypto.h index 6a7c0c06b2be..f7d46e8dc9d3 100644 --- a/fs/ext4/ext4_crypto.h +++ b/fs/ext4/ext4_crypto.h @@ -104,4 +104,24 @@ static inline int ext4_encryption_key_size(int mode) return 0; } +#define EXT4_FNAME_NUM_SCATTER_ENTRIES 4 +#define EXT4_CRYPTO_BLOCK_SIZE 16 +#define EXT4_FNAME_CRYPTO_DIGEST_SIZE 32 + +struct ext4_str { + unsigned char *name; + u32 len; +}; + +struct ext4_fname_crypto_ctx { + u32 lim; + char tmp_buf[EXT4_CRYPTO_BLOCK_SIZE]; + struct crypto_ablkcipher *ctfm; + struct crypto_hash *htfm; + struct page *workpage; + struct ext4_encryption_key key; + unsigned has_valid_key : 1; + unsigned ctfm_key_is_ready : 1; +}; + #endif /* _EXT4_CRYPTO_H */ -- cgit v1.2.3-58-ga151