Lines Matching refs:tfm

72 	int (*set_secret)(struct crypto_kpp *tfm, const void *buffer,
77 unsigned int (*max_size)(struct crypto_kpp *tfm);
79 int (*init)(struct crypto_kpp *tfm);
80 void (*exit)(struct crypto_kpp *tfm);
94 * crypto_alloc_kpp() - allocate KPP tfm handle
107 static inline struct crypto_tfm *crypto_kpp_tfm(struct crypto_kpp *tfm)
109 return &tfm->base;
117 static inline struct crypto_kpp *__crypto_kpp_tfm(struct crypto_tfm *tfm)
119 return container_of(tfm, struct crypto_kpp, base);
122 static inline struct kpp_alg *crypto_kpp_alg(struct crypto_kpp *tfm)
124 return __crypto_kpp_alg(crypto_kpp_tfm(tfm)->__crt_alg);
127 static inline unsigned int crypto_kpp_reqsize(struct crypto_kpp *tfm)
129 return crypto_kpp_alg(tfm)->reqsize;
133 struct crypto_kpp *tfm)
135 req->base.tfm = crypto_kpp_tfm(tfm);
140 return __crypto_kpp_tfm(req->base.tfm);
143 static inline u32 crypto_kpp_get_flags(struct crypto_kpp *tfm)
145 return crypto_tfm_get_flags(crypto_kpp_tfm(tfm));
148 static inline void crypto_kpp_set_flags(struct crypto_kpp *tfm, u32 flags)
150 crypto_tfm_set_flags(crypto_kpp_tfm(tfm), flags);
154 * crypto_free_kpp() - free KPP tfm handle
156 * @tfm: KPP tfm handle allocated with crypto_alloc_kpp()
158 * If @tfm is a NULL or error pointer, this function does nothing.
160 static inline void crypto_free_kpp(struct crypto_kpp *tfm)
162 crypto_destroy_tfm(tfm, crypto_kpp_tfm(tfm));
168 * @tfm: KPP tfm handle allocated with crypto_alloc_kpp()
173 static inline struct kpp_request *kpp_request_alloc(struct crypto_kpp *tfm,
178 req = kmalloc(sizeof(*req) + crypto_kpp_reqsize(tfm), gfp);
180 kpp_request_set_tfm(req, tfm);
273 * @tfm: tfm handle
283 static inline int crypto_kpp_set_secret(struct crypto_kpp *tfm,
286 struct kpp_alg *alg = crypto_kpp_alg(tfm);
287 struct crypto_alg *calg = tfm->base.__crt_alg;
291 ret = alg->set_secret(tfm, buffer, len);
311 struct crypto_kpp *tfm = crypto_kpp_reqtfm(req);
312 struct kpp_alg *alg = crypto_kpp_alg(tfm);
313 struct crypto_alg *calg = tfm->base.__crt_alg;
334 struct crypto_kpp *tfm = crypto_kpp_reqtfm(req);
335 struct kpp_alg *alg = crypto_kpp_alg(tfm);
336 struct crypto_alg *calg = tfm->base.__crt_alg;
353 * @tfm: KPP tfm handle allocated with crypto_alloc_kpp()
355 static inline unsigned int crypto_kpp_maxsize(struct crypto_kpp *tfm)
357 struct kpp_alg *alg = crypto_kpp_alg(tfm);
359 return alg->max_size(tfm);