#include "internal.h"
+#define MAX_SHASH_ALIGNMASK 63
+
static const struct crypto_type crypto_shash_type;
int shash_no_setkey(struct crypto_shash *tfm, const u8 *key,
* We cannot count on __aligned() working for large values:
* https://patchwork.kernel.org/patch/9507697/
*/
- u8 ubuf[MAX_ALGAPI_ALIGNMASK * 2];
+ u8 ubuf[MAX_SHASH_ALIGNMASK * 2];
u8 *buf = PTR_ALIGN(&ubuf[0], alignmask + 1);
int err;
* We cannot count on __aligned() working for large values:
* https://patchwork.kernel.org/patch/9507697/
*/
- u8 ubuf[MAX_ALGAPI_ALIGNMASK + HASH_MAX_DIGESTSIZE];
+ u8 ubuf[MAX_SHASH_ALIGNMASK + HASH_MAX_DIGESTSIZE];
u8 *buf = PTR_ALIGN(&ubuf[0], alignmask + 1);
int err;
alg->statesize > HASH_MAX_STATESIZE)
return -EINVAL;
+ if (base->cra_alignmask > MAX_SHASH_ALIGNMASK)
+ return -EINVAL;
+
if ((alg->export && !alg->import) || (alg->import && !alg->export))
return -EINVAL;
* algs and architectures. Ciphers have a lower maximum size.
*/
#define MAX_ALGAPI_BLOCKSIZE 160
-#define MAX_ALGAPI_ALIGNMASK 63
+#define MAX_ALGAPI_ALIGNMASK 127
#define MAX_CIPHER_BLOCKSIZE 16
#define MAX_CIPHER_ALIGNMASK 15