[CRYPTO] api: Add template registration
[deliverable/linux.git] / crypto / internal.h
index 959e602909a60e1042e2d07d4d19471d9b0cd23c..c3ab4a950f304e24b8f943dc064dc7dc828a8d5e 100644 (file)
  */
 #ifndef _CRYPTO_INTERNAL_H
 #define _CRYPTO_INTERNAL_H
-#include <linux/crypto.h>
+
+#include <crypto/algapi.h>
 #include <linux/mm.h>
 #include <linux/highmem.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/list.h>
+#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/rwsem.h>
 #include <linux/slab.h>
 #include <asm/kmap_types.h>
 
+struct crypto_instance;
+struct crypto_template;
+
 extern struct list_head crypto_alg_list;
 extern struct rw_semaphore crypto_alg_sem;
 
@@ -64,9 +69,12 @@ static inline void crypto_free_hmac_block(struct crypto_tfm *tfm)
 
 #ifdef CONFIG_PROC_FS
 void __init crypto_init_proc(void);
+void __exit crypto_exit_proc(void);
 #else
 static inline void crypto_init_proc(void)
 { }
+static inline void crypto_exit_proc(void)
+{ }
 #endif
 
 static inline unsigned int crypto_digest_ctxsize(struct crypto_alg *alg,
@@ -108,5 +116,18 @@ void crypto_exit_digest_ops(struct crypto_tfm *tfm);
 void crypto_exit_cipher_ops(struct crypto_tfm *tfm);
 void crypto_exit_compress_ops(struct crypto_tfm *tfm);
 
+int crypto_register_instance(struct crypto_template *tmpl,
+                            struct crypto_instance *inst);
+
+static inline int crypto_tmpl_get(struct crypto_template *tmpl)
+{
+       return try_module_get(tmpl->module);
+}
+
+static inline void crypto_tmpl_put(struct crypto_template *tmpl)
+{
+       module_put(tmpl->module);
+}
+
 #endif /* _CRYPTO_INTERNAL_H */
 
This page took 0.024537 seconds and 5 git commands to generate.