Lines Matching refs:tfm
93 int (*set_secret)(struct crypto_kpp *tfm, const void *buffer,
98 unsigned int (*max_size)(struct crypto_kpp *tfm);
100 int (*init)(struct crypto_kpp *tfm);
101 void (*exit)(struct crypto_kpp *tfm);
118 * crypto_alloc_kpp() - allocate KPP tfm handle
133 static inline struct crypto_tfm *crypto_kpp_tfm(struct crypto_kpp *tfm)
135 return &tfm->base;
143 static inline struct crypto_kpp *__crypto_kpp_tfm(struct crypto_tfm *tfm)
145 return container_of(tfm, struct crypto_kpp, base);
148 static inline struct kpp_alg *crypto_kpp_alg(struct crypto_kpp *tfm)
150 return __crypto_kpp_alg(crypto_kpp_tfm(tfm)->__crt_alg);
153 static inline unsigned int crypto_kpp_reqsize(struct crypto_kpp *tfm)
155 return tfm->reqsize;
159 struct crypto_kpp *tfm)
161 req->base.tfm = crypto_kpp_tfm(tfm);
166 return __crypto_kpp_tfm(req->base.tfm);
169 static inline u32 crypto_kpp_get_flags(struct crypto_kpp *tfm)
171 return crypto_tfm_get_flags(crypto_kpp_tfm(tfm));
174 static inline void crypto_kpp_set_flags(struct crypto_kpp *tfm, u32 flags)
176 crypto_tfm_set_flags(crypto_kpp_tfm(tfm), flags);
180 * crypto_free_kpp() - free KPP tfm handle
182 * @tfm: KPP tfm handle allocated with crypto_alloc_kpp()
184 * If @tfm is a NULL or error pointer, this function does nothing.
186 static inline void crypto_free_kpp(struct crypto_kpp *tfm)
188 crypto_destroy_tfm(tfm, crypto_kpp_tfm(tfm));
194 * @tfm: KPP tfm handle allocated with crypto_alloc_kpp()
199 static inline struct kpp_request *kpp_request_alloc(struct crypto_kpp *tfm,
204 req = kmalloc(sizeof(*req) + crypto_kpp_reqsize(tfm), gfp);
206 kpp_request_set_tfm(req, tfm);
319 * @tfm: tfm handle
329 static inline int crypto_kpp_set_secret(struct crypto_kpp *tfm,
332 struct kpp_alg *alg = crypto_kpp_alg(tfm);
337 return crypto_kpp_errstat(alg, alg->set_secret(tfm, buffer, len));
355 struct crypto_kpp *tfm = crypto_kpp_reqtfm(req);
356 struct kpp_alg *alg = crypto_kpp_alg(tfm);
376 struct crypto_kpp *tfm = crypto_kpp_reqtfm(req);
377 struct kpp_alg *alg = crypto_kpp_alg(tfm);
393 * @tfm: KPP tfm handle allocated with crypto_alloc_kpp()
395 static inline unsigned int crypto_kpp_maxsize(struct crypto_kpp *tfm)
397 struct kpp_alg *alg = crypto_kpp_alg(tfm);
399 return alg->max_size(tfm);