From c7fc05992afcf1d63d6d5fb6142c8d39094dbca9 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Wed, 24 May 2006 13:02:26 +1000 Subject: [CRYPTO] api: Added cra_init/cra_exit This patch adds the hooks cra_init/cra_exit which are called during a tfm's construction and destruction respectively. This will be used by the instances to allocate child tfm's. For now this lets us get rid of the coa_init/coa_exit functions which are used for exactly that purpose (unlike the dia_init function which is called for each transaction). In fact the coa_exit path is currently buggy as it may get called twice when an error is encountered during initialisation. Signed-off-by: Herbert Xu --- include/linux/crypto.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/linux/crypto.h') diff --git a/include/linux/crypto.h b/include/linux/crypto.h index ef918803ec3..6c013c88080 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -109,8 +109,6 @@ struct digest_alg { }; struct compress_alg { - int (*coa_init)(struct crypto_tfm *tfm); - void (*coa_exit)(struct crypto_tfm *tfm); int (*coa_compress)(struct crypto_tfm *tfm, const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen); int (*coa_decompress)(struct crypto_tfm *tfm, const u8 *src, @@ -138,6 +136,9 @@ struct crypto_alg { struct digest_alg digest; struct compress_alg compress; } cra_u; + + int (*cra_init)(struct crypto_tfm *tfm); + void (*cra_exit)(struct crypto_tfm *tfm); struct module *cra_module; }; -- cgit v1.2.3-70-g09d2