Message ID | 20241030162235.363533-2-freude@linux.ibm.com |
---|---|
State | New |
Headers | show |
Series | New s390 specific protected key hmac | expand |
On Wed, Oct 30, 2024 at 05:22:33PM +0100, Harald Freudenberger wrote: > > +#ifdef CONFIG_S390 > +/* > + * The descsize for phmac on s390 exceeds the generic "worst case". > + */ > +#define HASH_MAX_DESCSIZE 384 > +#else > /* > * 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) > +#endif Why not just increase it everywhere? It's not a big difference. Thanks,
diff --git a/include/crypto/hash.h b/include/crypto/hash.h index 2d5ea9f9ff43..92f878270a87 100644 --- a/include/crypto/hash.h +++ b/include/crypto/hash.h @@ -158,11 +158,18 @@ struct shash_desc { #define HASH_MAX_DIGESTSIZE 64 +#ifdef CONFIG_S390 +/* + * The descsize for phmac on s390 exceeds the generic "worst case". + */ +#define HASH_MAX_DESCSIZE 384 +#else /* * 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) +#endif #define SHASH_DESC_ON_STACK(shash, ctx) \ char __##shash##_desc[sizeof(struct shash_desc) + HASH_MAX_DESCSIZE] \