From 3aa54ceaf9865974b798dc011a74cbaae3dcdac3 Mon Sep 17 00:00:00 2001 From: Steffen Klassert Date: Tue, 27 Sep 2011 07:21:26 +0200 Subject: crypto: Add a flag to identify crypto instances The upcomming crypto user configuration api needs to identify crypto instances. This patch adds a flag that is set if the algorithm is an instance that is build from templates. Signed-off-by: Steffen Klassert Signed-off-by: Herbert Xu (cherry picked from commit 64a947b1337b93061da7c7af1f6ce6b2431b70ae) Signed-off-by: Dominik Sliwa Acked-by: Marcel Ziswiler --- crypto/algapi.c | 1 + include/linux/crypto.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/crypto/algapi.c b/crypto/algapi.c index d7b5c9fb5eab..54dd4e33b5d6 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -492,6 +492,7 @@ int crypto_register_instance(struct crypto_template *tmpl, goto err; inst->alg.cra_module = tmpl->module; + inst->alg.cra_flags |= CRYPTO_ALG_INSTANCE; down_write(&crypto_alg_sem); diff --git a/include/linux/crypto.h b/include/linux/crypto.h index e5e468e9133d..de9adec5693c 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -71,6 +71,11 @@ #define CRYPTO_ALG_TESTED 0x00000400 +/* + * Set if the algorithm is an instance that is build from templates. + */ +#define CRYPTO_ALG_INSTANCE 0x00000800 + /* * Transform masks and values (for crt_flags). */ -- cgit v1.2.3