Skip to content

Commit

Permalink
crypto: Add a flag to identify crypto instances
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
klassert authored and herbertx committed Oct 21, 2011
1 parent 8280daa commit 64a947b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions crypto/algapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,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);

Expand Down
5 changes: 5 additions & 0 deletions include/linux/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*/
Expand Down

0 comments on commit 64a947b

Please sign in to comment.