1#ifndef __VSF_LINUX_CRYPTO_KPP_H__
2#define __VSF_LINUX_CRYPTO_KPP_H__
49static inline unsigned int crypto_kpp_reqsize(
struct crypto_kpp *tfm)
56 req->
base.
tfm = crypto_kpp_tfm(tfm);
66 struct kpp_request *req = kmalloc(
sizeof(*req) + crypto_kpp_reqsize(tfm), gfp);
67 if (req) { kpp_request_set_tfm(req, tfm); }
71static inline void kpp_request_free(
struct kpp_request *req)
83static inline void kpp_request_set_input(
struct kpp_request *req,
struct scatterlist *input,
unsigned int input_len)
89static inline void kpp_request_set_output(
struct kpp_request *req,
struct scatterlist *output,
unsigned int output_len)
95static inline int crypto_kpp_generate_public_key(
struct kpp_request *req)
97 struct crypto_kpp *tfm = crypto_kpp_reqtfm(req);
101static inline int crypto_kpp_compute_shared_secret(
struct kpp_request *req)
103 struct crypto_kpp *tfm = crypto_kpp_reqtfm(req);
117static inline void crypto_free_kpp(
struct crypto_kpp *tfm)
122static inline int crypto_kpp_set_secret(
struct crypto_kpp *tfm,
const void *buffer,
unsigned int len)
124 return crypto_kpp_alg(tfm)->
set_secret(tfm, buffer, len);
#define vsf_container_of(__ptr, __type, __member)
Definition __type.h:164
void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm)
Definition vsf_linux_core_crypto.c:348
void(* crypto_completion_t)(void *req, int err)
Definition crypto.h:27
unsigned int gfp_t
Definition gfp.h:10
struct ieee80211_ext_chansw_ie data
Definition ieee80211.h:80
void * crypto_alloc_tfm(const char *alg_name, const struct crypto_type *frontend, u32 type, u32 mask)
Definition vsf_linux_core_crypto.c:327
@ CRYPTO_KPP_SECRET_TYPE_UNKNOWN
Definition kpp.h:28
@ CRYPTO_KPP_SECRET_TYPE_ECDH
Definition kpp.h:30
@ CRYPTO_KPP_SECRET_TYPE_DH
Definition kpp.h:29
uint32_t u32
Definition lvgl.h:43
psa_algorithm_t alg
Definition crypto.h:47
crypto_completion_t complete
Definition crypto.h:31
u32 flags
Definition crypto.h:34
void * data
Definition crypto.h:32
struct crypto_tfm * tfm
Definition crypto.h:33
struct crypto_tfm base
Definition kpp.h:16
unsigned int reqsize
Definition kpp.h:15
struct crypto_alg * __crt_alg
Definition crypto.h:63
int(* generate_public_key)(struct kpp_request *req)
Definition kpp.h:21
int(* compute_shared_secret)(struct kpp_request *req)
Definition kpp.h:22
int(* set_secret)(struct crypto_kpp *tfm, const void *buffer, unsigned int len)
Definition kpp.h:20
struct crypto_alg base
Definition kpp.h:24
unsigned int dst_len
Definition kpp.h:11
struct scatterlist * src
Definition kpp.h:8
struct scatterlist * dst
Definition kpp.h:9
struct crypto_async_request base
Definition kpp.h:7
unsigned int src_len
Definition kpp.h:10
unsigned short len
Definition kpp.h:35
unsigned short type
Definition kpp.h:34
Definition scatterlist.h:4
vk_av_control_type_t type
Definition vsf_audio.h:170
const struct crypto_type crypto_kpp_type
Definition vsf_linux_core_crypto.c:76