diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2008-09-13 21:19:03 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2008-12-24 19:01:23 -0500 |
commit | 4a7794860ba2b56693b1d89fd485fd08cdc763e3 (patch) | |
tree | d97f46fe980ac79e226b429a61c5328fae9bf882 /include/linux/crypto.h | |
parent | 2566578a6feb9d9e39da41326afe8ed6022db3c5 (diff) |
crypto: api - Move type exit function into crypto_tfm
The type exit function needs to undo any allocations done by the type
init function. However, the type init function may differ depending
on the upper-level type of the transform (e.g., a crypto_blkcipher
instantiated as a crypto_ablkcipher).
So we need to move the exit function out of the lower-level
structure and into crypto_tfm itself.
As it stands this is a no-op since nobody uses exit functions at
all. However, all cases where a lower-level type is instantiated
as a different upper-level type (such as blkcipher as ablkcipher)
will be converted such that they allocate the underlying transform
and use that instead of casting (e.g., crypto_ablkcipher casted
into crypto_blkcipher). That will need to use a different exit
function depending on the upper-level type.
This patch also allows the type init/exit functions to call (or not)
cra_init/cra_exit instead of always calling them from the top level.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/linux/crypto.h')
-rw-r--r-- | include/linux/crypto.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 3d2317e4af2e..ea52cd944fd9 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -480,6 +480,8 @@ struct crypto_tfm { | |||
480 | struct compress_tfm compress; | 480 | struct compress_tfm compress; |
481 | struct rng_tfm rng; | 481 | struct rng_tfm rng; |
482 | } crt_u; | 482 | } crt_u; |
483 | |||
484 | void (*exit)(struct crypto_tfm *tfm); | ||
483 | 485 | ||
484 | struct crypto_alg *__crt_alg; | 486 | struct crypto_alg *__crt_alg; |
485 | 487 | ||