Lines Matching refs:tfm

97 	int (*set_pub_key)(struct crypto_akcipher *tfm, const void *key,
99 int (*set_priv_key)(struct crypto_akcipher *tfm, const void *key,
101 unsigned int (*max_size)(struct crypto_akcipher *tfm);
102 int (*init)(struct crypto_akcipher *tfm);
103 void (*exit)(struct crypto_akcipher *tfm);
117 * crypto_alloc_akcipher() - allocate AKCIPHER tfm handle
134 struct crypto_akcipher *tfm)
136 return &tfm->base;
145 struct crypto_tfm *tfm)
147 return container_of(tfm, struct crypto_akcipher, base);
151 struct crypto_akcipher *tfm)
153 return __crypto_akcipher_alg(crypto_akcipher_tfm(tfm)->__crt_alg);
156 static inline unsigned int crypto_akcipher_reqsize(struct crypto_akcipher *tfm)
158 return crypto_akcipher_alg(tfm)->reqsize;
162 struct crypto_akcipher *tfm)
164 req->base.tfm = crypto_akcipher_tfm(tfm);
170 return __crypto_akcipher_tfm(req->base.tfm);
174 * crypto_free_akcipher() - free AKCIPHER tfm handle
176 * @tfm: AKCIPHER tfm handle allocated with crypto_alloc_akcipher()
178 * If @tfm is a NULL or error pointer, this function does nothing.
180 static inline void crypto_free_akcipher(struct crypto_akcipher *tfm)
182 crypto_destroy_tfm(tfm, crypto_akcipher_tfm(tfm));
188 * @tfm: AKCIPHER tfm handle allocated with crypto_alloc_akcipher()
194 struct crypto_akcipher *tfm, gfp_t gfp)
198 req = kmalloc(sizeof(*req) + crypto_akcipher_reqsize(tfm), gfp);
200 akcipher_request_set_tfm(req, tfm);
268 * @tfm: AKCIPHER tfm handle allocated with crypto_alloc_akcipher()
270 static inline unsigned int crypto_akcipher_maxsize(struct crypto_akcipher *tfm)
272 struct akcipher_alg *alg = crypto_akcipher_alg(tfm);
274 return alg->max_size(tfm);
289 struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
290 struct akcipher_alg *alg = crypto_akcipher_alg(tfm);
291 struct crypto_alg *calg = tfm->base.__crt_alg;
313 struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
314 struct akcipher_alg *alg = crypto_akcipher_alg(tfm);
315 struct crypto_alg *calg = tfm->base.__crt_alg;
337 struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
338 struct akcipher_alg *alg = crypto_akcipher_alg(tfm);
339 struct crypto_alg *calg = tfm->base.__crt_alg;
364 struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
365 struct akcipher_alg *alg = crypto_akcipher_alg(tfm);
366 struct crypto_alg *calg = tfm->base.__crt_alg;
381 * @tfm: tfm handle
388 static inline int crypto_akcipher_set_pub_key(struct crypto_akcipher *tfm,
392 struct akcipher_alg *alg = crypto_akcipher_alg(tfm);
394 return alg->set_pub_key(tfm, key, keylen);
403 * @tfm: tfm handle
410 static inline int crypto_akcipher_set_priv_key(struct crypto_akcipher *tfm,
414 struct akcipher_alg *alg = crypto_akcipher_alg(tfm);
416 return alg->set_priv_key(tfm, key, keylen);