Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[linux-2.6-block.git] / fs / crypto / fscrypt_private.h
index ad6722bae8b7499b8128224cef436898043afc3d..37562394c5deb577ebbe4f5c964848987e1ab537 100644 (file)
 
 /* Encryption parameters */
 #define FS_IV_SIZE                     16
-#define FS_AES_128_ECB_KEY_SIZE                16
-#define FS_AES_128_CBC_KEY_SIZE                16
-#define FS_AES_128_CTS_KEY_SIZE                16
-#define FS_AES_256_GCM_KEY_SIZE                32
-#define FS_AES_256_CBC_KEY_SIZE                32
-#define FS_AES_256_CTS_KEY_SIZE                32
-#define FS_AES_256_XTS_KEY_SIZE                64
-
-#define FS_KEY_DERIVATION_NONCE_SIZE           16
+#define FS_KEY_DERIVATION_NONCE_SIZE   16
 
 /**
  * Encryption context for inode
@@ -91,6 +83,10 @@ static inline bool fscrypt_valid_enc_modes(u32 contents_mode,
            filenames_mode == FS_ENCRYPTION_MODE_AES_256_CTS)
                return true;
 
+       if (contents_mode == FS_ENCRYPTION_MODE_SPECK128_256_XTS &&
+           filenames_mode == FS_ENCRYPTION_MODE_SPECK128_256_CTS)
+               return true;
+
        return false;
 }
 
@@ -106,6 +102,15 @@ extern int fscrypt_do_page_crypto(const struct inode *inode,
                                  gfp_t gfp_flags);
 extern struct page *fscrypt_alloc_bounce_page(struct fscrypt_ctx *ctx,
                                              gfp_t gfp_flags);
+extern const struct dentry_operations fscrypt_d_ops;
+
+extern void __printf(3, 4) __cold
+fscrypt_msg(struct super_block *sb, const char *level, const char *fmt, ...);
+
+#define fscrypt_warn(sb, fmt, ...)             \
+       fscrypt_msg(sb, KERN_WARNING, fmt, ##__VA_ARGS__)
+#define fscrypt_err(sb, fmt, ...)              \
+       fscrypt_msg(sb, KERN_ERR, fmt, ##__VA_ARGS__)
 
 /* fname.c */
 extern int fname_encrypt(struct inode *inode, const struct qstr *iname,