Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c012a79d authored by Alexander Kuleshov's avatar Alexander Kuleshov Committed by Herbert Xu
Browse files

crypto: cryptod - use crypto_skcipher_type() for getting skcipher type



The <linux/crypto.h> provides inline function - crypto_skcipher_type().
Let's use it in the cryptd_alloc_ablkcipher() instead of direct calculation.

Signed-off-by: default avatarAlexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 433cd2c6
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -887,8 +887,7 @@ struct cryptd_ablkcipher *cryptd_alloc_ablkcipher(const char *alg_name,
	if (snprintf(cryptd_alg_name, CRYPTO_MAX_ALG_NAME,
		     "cryptd(%s)", alg_name) >= CRYPTO_MAX_ALG_NAME)
		return ERR_PTR(-EINVAL);
	type &= ~(CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_GENIV);
	type |= CRYPTO_ALG_TYPE_BLKCIPHER;
	type = crypto_skcipher_type(type);
	mask &= ~CRYPTO_ALG_TYPE_MASK;
	mask |= (CRYPTO_ALG_GENIV | CRYPTO_ALG_TYPE_BLKCIPHER_MASK);
	tfm = crypto_alloc_base(cryptd_alg_name, type, mask);