Lines Matching refs:tfm
101 int (*set_pub_key)(struct crypto_akcipher *tfm, const void *key,
103 int (*set_priv_key)(struct crypto_akcipher *tfm, const void *key,
105 unsigned int (*max_size)(struct crypto_akcipher *tfm);
106 int (*init)(struct crypto_akcipher *tfm);
107 void (*exit)(struct crypto_akcipher *tfm);
137 struct crypto_akcipher *tfm) in crypto_akcipher_tfm() argument
139 return &tfm->base; in crypto_akcipher_tfm()
148 struct crypto_tfm *tfm) in __crypto_akcipher_tfm() argument
150 return container_of(tfm, struct crypto_akcipher, base); in __crypto_akcipher_tfm()
154 struct crypto_akcipher *tfm) in crypto_akcipher_alg() argument
156 return __crypto_akcipher_alg(crypto_akcipher_tfm(tfm)->__crt_alg); in crypto_akcipher_alg()
159 static inline unsigned int crypto_akcipher_reqsize(struct crypto_akcipher *tfm) in crypto_akcipher_reqsize() argument
161 return tfm->reqsize; in crypto_akcipher_reqsize()
165 struct crypto_akcipher *tfm) in akcipher_request_set_tfm() argument
167 req->base.tfm = crypto_akcipher_tfm(tfm); in akcipher_request_set_tfm()
173 return __crypto_akcipher_tfm(req->base.tfm); in crypto_akcipher_reqtfm()
183 static inline void crypto_free_akcipher(struct crypto_akcipher *tfm) in crypto_free_akcipher() argument
185 crypto_destroy_tfm(tfm, crypto_akcipher_tfm(tfm)); in crypto_free_akcipher()
197 struct crypto_akcipher *tfm, gfp_t gfp) in akcipher_request_alloc() argument
201 req = kmalloc(sizeof(*req) + crypto_akcipher_reqsize(tfm), gfp); in akcipher_request_alloc()
203 akcipher_request_set_tfm(req, tfm); in akcipher_request_alloc()
273 static inline unsigned int crypto_akcipher_maxsize(struct crypto_akcipher *tfm) in crypto_akcipher_maxsize() argument
275 struct akcipher_alg *alg = crypto_akcipher_alg(tfm); in crypto_akcipher_maxsize()
277 return alg->max_size(tfm); in crypto_akcipher_maxsize()
292 struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); in crypto_akcipher_encrypt() local
294 return crypto_akcipher_alg(tfm)->encrypt(req); in crypto_akcipher_encrypt()
309 struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); in crypto_akcipher_decrypt() local
311 return crypto_akcipher_alg(tfm)->decrypt(req); in crypto_akcipher_decrypt()
328 int crypto_akcipher_sync_encrypt(struct crypto_akcipher *tfm,
346 int crypto_akcipher_sync_decrypt(struct crypto_akcipher *tfm,
362 struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); in crypto_akcipher_sign() local
364 return crypto_akcipher_alg(tfm)->sign(req); in crypto_akcipher_sign()
383 struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); in crypto_akcipher_verify() local
385 return crypto_akcipher_alg(tfm)->verify(req); in crypto_akcipher_verify()
401 static inline int crypto_akcipher_set_pub_key(struct crypto_akcipher *tfm, in crypto_akcipher_set_pub_key() argument
405 struct akcipher_alg *alg = crypto_akcipher_alg(tfm); in crypto_akcipher_set_pub_key()
407 return alg->set_pub_key(tfm, key, keylen); in crypto_akcipher_set_pub_key()
423 static inline int crypto_akcipher_set_priv_key(struct crypto_akcipher *tfm, in crypto_akcipher_set_priv_key() argument
427 struct akcipher_alg *alg = crypto_akcipher_alg(tfm); in crypto_akcipher_set_priv_key()
429 return alg->set_priv_key(tfm, key, keylen); in crypto_akcipher_set_priv_key()