Lines Matching refs:tfm

122 	int (*set_pub_key)(struct crypto_akcipher *tfm, const void *key,
124 int (*set_priv_key)(struct crypto_akcipher *tfm, const void *key,
126 unsigned int (*max_size)(struct crypto_akcipher *tfm);
127 int (*init)(struct crypto_akcipher *tfm);
128 void (*exit)(struct crypto_akcipher *tfm);
145 * crypto_alloc_akcipher() - allocate AKCIPHER tfm handle
162 struct crypto_akcipher *tfm)
164 return &tfm->base;
173 struct crypto_tfm *tfm)
175 return container_of(tfm, struct crypto_akcipher, base);
179 struct crypto_akcipher *tfm)
181 return __crypto_akcipher_alg(crypto_akcipher_tfm(tfm)->__crt_alg);
184 static inline unsigned int crypto_akcipher_reqsize(struct crypto_akcipher *tfm)
186 return tfm->reqsize;
190 struct crypto_akcipher *tfm)
192 req->base.tfm = crypto_akcipher_tfm(tfm);
198 return __crypto_akcipher_tfm(req->base.tfm);
202 * crypto_free_akcipher() - free AKCIPHER tfm handle
204 * @tfm: AKCIPHER tfm handle allocated with crypto_alloc_akcipher()
206 * If @tfm is a NULL or error pointer, this function does nothing.
208 static inline void crypto_free_akcipher(struct crypto_akcipher *tfm)
210 crypto_destroy_tfm(tfm, crypto_akcipher_tfm(tfm));
216 * @tfm: AKCIPHER tfm handle allocated with crypto_alloc_akcipher()
222 struct crypto_akcipher *tfm, gfp_t gfp)
226 req = kmalloc(sizeof(*req) + crypto_akcipher_reqsize(tfm), gfp);
228 akcipher_request_set_tfm(req, tfm);
296 * @tfm: AKCIPHER tfm handle allocated with crypto_alloc_akcipher()
298 static inline unsigned int crypto_akcipher_maxsize(struct crypto_akcipher *tfm)
300 struct akcipher_alg *alg = crypto_akcipher_alg(tfm);
302 return alg->max_size(tfm);
338 struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
339 struct akcipher_alg *alg = crypto_akcipher_alg(tfm);
363 struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
364 struct akcipher_alg *alg = crypto_akcipher_alg(tfm);
382 * @tfm: AKCIPHER tfm handle allocated with crypto_alloc_akcipher()
390 int crypto_akcipher_sync_encrypt(struct crypto_akcipher *tfm,
400 * @tfm: AKCIPHER tfm handle allocated with crypto_alloc_akcipher()
408 int crypto_akcipher_sync_decrypt(struct crypto_akcipher *tfm,
424 struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
425 struct akcipher_alg *alg = crypto_akcipher_alg(tfm);
449 struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
450 struct akcipher_alg *alg = crypto_akcipher_alg(tfm);
464 * @tfm: tfm handle
471 static inline int crypto_akcipher_set_pub_key(struct crypto_akcipher *tfm,
475 struct akcipher_alg *alg = crypto_akcipher_alg(tfm);
477 return alg->set_pub_key(tfm, key, keylen);
486 * @tfm: tfm handle
493 static inline int crypto_akcipher_set_priv_key(struct crypto_akcipher *tfm,
497 struct akcipher_alg *alg = crypto_akcipher_alg(tfm);
499 return alg->set_priv_key(tfm, key, keylen);