Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1277658 > unrolled thread

[PATCH] crypto/cryptod: use crypto_skcipher_type() for getting skcipher type

Started byAlexander Kuleshov <kuleshovmail@gmail.com>
First post2015-11-25 19:00 +0100
Last post2015-11-27 14:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] crypto/cryptod: use crypto_skcipher_type() for getting skcipher type Alexander Kuleshov <kuleshovmail@gmail.com> - 2015-11-25 19:00 +0100
    Re: [PATCH] crypto/cryptod: use crypto_skcipher_type() for getting  skcipher type Herbert Xu <herbert@gondor.apana.org.au> - 2015-11-27 14:30 +0100

#1277658 — [PATCH] crypto/cryptod: use crypto_skcipher_type() for getting skcipher type

FromAlexander Kuleshov <kuleshovmail@gmail.com>
Date2015-11-25 19:00 +0100
Subject[PATCH] crypto/cryptod: use crypto_skcipher_type() for getting skcipher type
Message-ID<qyMwj-12v-11@gated-at.bofh.it>
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: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 crypto/cryptd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/crypto/cryptd.c b/crypto/cryptd.c
index c81861b..c4af8aa 100644
--- a/crypto/cryptd.c
+++ b/crypto/cryptd.c
@@ -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);
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1278799 — Re: [PATCH] crypto/cryptod: use crypto_skcipher_type() for getting skcipher type

FromHerbert Xu <herbert@gondor.apana.org.au>
Date2015-11-27 14:30 +0100
SubjectRe: [PATCH] crypto/cryptod: use crypto_skcipher_type() for getting skcipher type
Message-ID<qzrg5-3nT-7@gated-at.bofh.it>
In reply to#1277658
On Wed, Nov 25, 2015 at 11:48:28PM +0600, Alexander Kuleshov wrote:
> 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: Alexander Kuleshov <kuleshovmail@gmail.com>

Applied.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web