Merge tag 'for-linus-20190524' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / include / crypto / hash.h
index d21bea2..d6702b4 100644 (file)
@@ -150,7 +150,13 @@ struct shash_desc {
 };
 
 #define HASH_MAX_DIGESTSIZE     64
-#define HASH_MAX_DESCSIZE      360
+
+/*
+ * Worst case is hmac(sha3-224-generic).  Its context is a nested 'shash_desc'
+ * containing a 'struct sha3_state'.
+ */
+#define HASH_MAX_DESCSIZE      (sizeof(struct shash_desc) + 360)
+
 #define HASH_MAX_STATESIZE     512
 
 #define SHASH_DESC_ON_STACK(shash, ctx)                                  \