Skip to content

Commit 9e2f284

Browse files
hreineckeaxboe
authored andcommitted
crypto: add crypto_has_kpp()
Add helper function to determine if a given key-agreement protocol primitive is supported. Signed-off-by: Hannes Reinecke <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Acked-by: Herbert Xu <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 85cc424 commit 9e2f284

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

crypto/kpp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ int crypto_grab_kpp(struct crypto_kpp_spawn *spawn,
104104
}
105105
EXPORT_SYMBOL_GPL(crypto_grab_kpp);
106106

107+
int crypto_has_kpp(const char *alg_name, u32 type, u32 mask)
108+
{
109+
return crypto_type_has_alg(alg_name, &crypto_kpp_type, type, mask);
110+
}
111+
EXPORT_SYMBOL_GPL(crypto_has_kpp);
112+
107113
static void kpp_prepare_alg(struct kpp_alg *alg)
108114
{
109115
struct crypto_alg *base = &alg->base;

include/crypto/kpp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ struct kpp_alg {
104104
*/
105105
struct crypto_kpp *crypto_alloc_kpp(const char *alg_name, u32 type, u32 mask);
106106

107+
int crypto_has_kpp(const char *alg_name, u32 type, u32 mask);
108+
107109
static inline struct crypto_tfm *crypto_kpp_tfm(struct crypto_kpp *tfm)
108110
{
109111
return &tfm->base;

0 commit comments

Comments
 (0)