WIP FPC-III support
[linux/fpc-iii.git] / include / crypto / internal / kpp.h
blob659b642efada160055f16214bbc92d07ff6419e7
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Key-agreement Protocol Primitives (KPP)
5 * Copyright (c) 2016, Intel Corporation
6 * Authors: Salvatore Benedetto <salvatore.benedetto@intel.com>
7 */
8 #ifndef _CRYPTO_KPP_INT_H
9 #define _CRYPTO_KPP_INT_H
10 #include <crypto/kpp.h>
11 #include <crypto/algapi.h>
14 * Transform internal helpers.
16 static inline void *kpp_request_ctx(struct kpp_request *req)
18 return req->__ctx;
21 static inline void *kpp_tfm_ctx(struct crypto_kpp *tfm)
23 return tfm->base.__crt_ctx;
26 static inline void kpp_request_complete(struct kpp_request *req, int err)
28 req->base.complete(&req->base, err);
31 static inline const char *kpp_alg_name(struct crypto_kpp *tfm)
33 return crypto_kpp_tfm(tfm)->__crt_alg->cra_name;
36 /**
37 * crypto_register_kpp() -- Register key-agreement protocol primitives algorithm
39 * Function registers an implementation of a key-agreement protocol primitive
40 * algorithm
42 * @alg: algorithm definition
44 * Return: zero on success; error code in case of error
46 int crypto_register_kpp(struct kpp_alg *alg);
48 /**
49 * crypto_unregister_kpp() -- Unregister key-agreement protocol primitive
50 * algorithm
52 * Function unregisters an implementation of a key-agreement protocol primitive
53 * algorithm
55 * @alg: algorithm definition
57 void crypto_unregister_kpp(struct kpp_alg *alg);
59 #endif