summaryrefslogtreecommitdiffstats
path: root/include/crypto/algapi.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-04-03 12:48:42 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2023-04-14 18:59:34 +0800
commit01f727cdc4dbecd36c6722977ff9535f16c11751 (patch)
tree7f41e3137dea088b30a279c57e71c39f69e67306 /include/crypto/algapi.h
parent8ae8a494eae4e7e262a7212061db90210efd2d28 (diff)
downloadlinux-01f727cdc4dbecd36c6722977ff9535f16c11751.tar.gz
linux-01f727cdc4dbecd36c6722977ff9535f16c11751.tar.bz2
linux-01f727cdc4dbecd36c6722977ff9535f16c11751.zip
crypto: api - Move low-level functions into algapi.h
A number of low-level functions were exposed in crypto.h. Move them into algapi.h (and internal.h). Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/algapi.h')
-rw-r--r--include/crypto/algapi.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h
index bbf8c43c3320..016d5a302b84 100644
--- a/include/crypto/algapi.h
+++ b/include/crypto/algapi.h
@@ -49,6 +49,7 @@ struct crypto_instance;
struct module;
struct notifier_block;
struct rtattr;
+struct scatterlist;
struct seq_file;
struct sk_buff;
@@ -132,6 +133,14 @@ struct crypto_attr_type {
u32 mask;
};
+/*
+ * Algorithm registration interface.
+ */
+int crypto_register_alg(struct crypto_alg *alg);
+void crypto_unregister_alg(struct crypto_alg *alg);
+int crypto_register_algs(struct crypto_alg *algs, int count);
+void crypto_unregister_algs(struct crypto_alg *algs, int count);
+
void crypto_mod_put(struct crypto_alg *alg);
int crypto_register_template(struct crypto_template *tmpl);
@@ -263,4 +272,9 @@ static inline void crypto_request_complete(struct crypto_async_request *req,
req->complete(req->data, err);
}
+static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm)
+{
+ return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK;
+}
+
#endif /* _CRYPTO_ALGAPI_H */