Skip to content

Commit 64a947b

Browse files
klassertherbertx
authored andcommitted
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 <steffen.klassert@secunet.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 8280daa commit 64a947b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

crypto/algapi.c

+1
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ int crypto_register_instance(struct crypto_template *tmpl,
493493
goto err;
494494

495495
inst->alg.cra_module = tmpl->module;
496+
inst->alg.cra_flags |= CRYPTO_ALG_INSTANCE;
496497

497498
down_write(&crypto_alg_sem);
498499

include/linux/crypto.h

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@
7171

7272
#define CRYPTO_ALG_TESTED 0x00000400
7373

74+
/*
75+
* Set if the algorithm is an instance that is build from templates.
76+
*/
77+
#define CRYPTO_ALG_INSTANCE 0x00000800
78+
7479
/*
7580
* Transform masks and values (for crt_flags).
7681
*/

0 commit comments

Comments
 (0)