From: Sergey Senozhatsky Subject: [RFC][PATCH 1/9] crypto: introduce CRYPTO_ALG_TFM_MAY_SHARE flag Date: Mon, 21 Sep 2015 22:13:41 +0900 Message-ID: <1442841229-8122-2-git-send-email-sergey.senozhatsky@gmail.com> References: <1442553564-3476-1-git-send-email-iamjoonsoo.kim@lge.com> <1442841229-8122-1-git-send-email-sergey.senozhatsky@gmail.com> Cc: Andrew Morton , Minchan Kim , Herbert Xu , "David S. Miller" , Stephan Mueller , Joonsoo Kim , Sergey Senozhatsky , Sergey Senozhatsky , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org To: Joonsoo Kim Return-path: Received: from mail-pa0-f51.google.com ([209.85.220.51]:33316 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932266AbbIUNPK (ORCPT ); Mon, 21 Sep 2015 09:15:10 -0400 In-Reply-To: <1442841229-8122-1-git-send-email-sergey.senozhatsky@gmail.com> Sender: linux-crypto-owner@vger.kernel.org List-ID: Set CRYPTO_ALG_TFM_MAY_SHARE ->cra_flags when algorithm support shared tfm. Signed-off-by: Sergey Senozhatsky --- include/linux/crypto.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/crypto.h b/include/linux/crypto.h index e71cb70..66f10f8 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -102,6 +102,11 @@ #define CRYPTO_ALG_INTERNAL 0x00002000 /* + * Mark that algorithm can use shared tfm + */ +#define CRYPTO_ALG_TFM_MAY_SHARE 0x00004000 + +/* * Transform masks and values (for crt_flags). */ #define CRYPTO_TFM_REQ_MASK 0x000fff00 @@ -648,6 +653,11 @@ static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm) return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK; } +static inline u32 crypto_tfm_may_share(struct crypto_tfm *tfm) +{ + return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TFM_MAY_SHARE; +} + static inline unsigned int crypto_tfm_alg_blocksize(struct crypto_tfm *tfm) { return tfm->__crt_alg->cra_blocksize; -- 2.6.0.rc2.10.gf4d9753