• Home
  • Raw
  • Download

Lines Matching refs:req

26 typedef u8 *(*authenc_ahash_t)(struct aead_request *req, unsigned int flags);
49 static void authenc_request_complete(struct aead_request *req, int err) in authenc_request_complete() argument
52 aead_request_complete(req, err); in authenc_request_complete()
113 struct aead_request *req = areq->data; in authenc_geniv_ahash_update_done() local
114 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in authenc_geniv_ahash_update_done()
116 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in authenc_geniv_ahash_update_done()
124 ahash_request_set_callback(ahreq, aead_request_flags(req) & in authenc_geniv_ahash_update_done()
126 areq_ctx->complete, req); in authenc_geniv_ahash_update_done()
137 authenc_request_complete(req, err); in authenc_geniv_ahash_update_done()
142 struct aead_request *req = areq->data; in authenc_geniv_ahash_done() local
143 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in authenc_geniv_ahash_done()
145 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in authenc_geniv_ahash_done()
156 aead_request_complete(req, err); in authenc_geniv_ahash_done()
165 struct aead_request *req = areq->data; in authenc_verify_ahash_update_done() local
166 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in authenc_verify_ahash_update_done()
168 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in authenc_verify_ahash_update_done()
170 unsigned int cryptlen = req->cryptlen; in authenc_verify_ahash_update_done()
177 ahash_request_set_callback(ahreq, aead_request_flags(req) & in authenc_verify_ahash_update_done()
179 areq_ctx->complete, req); in authenc_verify_ahash_update_done()
195 abreq = aead_request_ctx(req); in authenc_verify_ahash_update_done()
197 ablkcipher_request_set_callback(abreq, aead_request_flags(req), in authenc_verify_ahash_update_done()
198 req->base.complete, req->base.data); in authenc_verify_ahash_update_done()
199 ablkcipher_request_set_crypt(abreq, req->src, req->dst, in authenc_verify_ahash_update_done()
200 cryptlen, req->iv); in authenc_verify_ahash_update_done()
205 authenc_request_complete(req, err); in authenc_verify_ahash_update_done()
214 struct aead_request *req = areq->data; in authenc_verify_ahash_done() local
215 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in authenc_verify_ahash_done()
217 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in authenc_verify_ahash_done()
219 unsigned int cryptlen = req->cryptlen; in authenc_verify_ahash_done()
234 abreq = aead_request_ctx(req); in authenc_verify_ahash_done()
236 ablkcipher_request_set_callback(abreq, aead_request_flags(req), in authenc_verify_ahash_done()
237 req->base.complete, req->base.data); in authenc_verify_ahash_done()
238 ablkcipher_request_set_crypt(abreq, req->src, req->dst, in authenc_verify_ahash_done()
239 cryptlen, req->iv); in authenc_verify_ahash_done()
244 authenc_request_complete(req, err); in authenc_verify_ahash_done()
247 static u8 *crypto_authenc_ahash_fb(struct aead_request *req, unsigned int flags) in crypto_authenc_ahash_fb() argument
249 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_ahash_fb()
252 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_ahash_fb()
266 ahash_request_set_crypt(ahreq, req->assoc, hash, req->assoclen); in crypto_authenc_ahash_fb()
267 ahash_request_set_callback(ahreq, aead_request_flags(req) & flags, in crypto_authenc_ahash_fb()
268 areq_ctx->update_complete, req); in crypto_authenc_ahash_fb()
276 ahash_request_set_callback(ahreq, aead_request_flags(req) & flags, in crypto_authenc_ahash_fb()
277 areq_ctx->complete, req); in crypto_authenc_ahash_fb()
286 static u8 *crypto_authenc_ahash(struct aead_request *req, unsigned int flags) in crypto_authenc_ahash() argument
288 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_ahash()
291 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_ahash()
302 ahash_request_set_callback(ahreq, aead_request_flags(req) & flags, in crypto_authenc_ahash()
303 areq_ctx->complete, req); in crypto_authenc_ahash()
312 static int crypto_authenc_genicv(struct aead_request *req, u8 *iv, in crypto_authenc_genicv() argument
315 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_genicv()
316 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_genicv()
317 struct scatterlist *dst = req->dst; in crypto_authenc_genicv()
318 struct scatterlist *assoc = req->assoc; in crypto_authenc_genicv()
322 unsigned int cryptlen = req->cryptlen; in crypto_authenc_genicv()
339 if (req->assoclen && sg_is_last(assoc)) { in crypto_authenc_genicv()
345 cryptlen += req->assoclen; in crypto_authenc_genicv()
354 hash = authenc_ahash_fn(req, flags); in crypto_authenc_genicv()
363 static void crypto_authenc_encrypt_done(struct crypto_async_request *req, in crypto_authenc_encrypt_done() argument
366 struct aead_request *areq = req->data; in crypto_authenc_encrypt_done()
381 static int crypto_authenc_encrypt(struct aead_request *req) in crypto_authenc_encrypt() argument
383 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_encrypt()
385 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_encrypt()
387 struct scatterlist *dst = req->dst; in crypto_authenc_encrypt()
388 unsigned int cryptlen = req->cryptlen; in crypto_authenc_encrypt()
395 ablkcipher_request_set_callback(abreq, aead_request_flags(req), in crypto_authenc_encrypt()
396 crypto_authenc_encrypt_done, req); in crypto_authenc_encrypt()
397 ablkcipher_request_set_crypt(abreq, req->src, dst, cryptlen, req->iv); in crypto_authenc_encrypt()
399 memcpy(iv, req->iv, crypto_aead_ivsize(authenc)); in crypto_authenc_encrypt()
405 return crypto_authenc_genicv(req, iv, CRYPTO_TFM_REQ_MAY_SLEEP); in crypto_authenc_encrypt()
408 static void crypto_authenc_givencrypt_done(struct crypto_async_request *req, in crypto_authenc_givencrypt_done() argument
411 struct aead_request *areq = req->data; in crypto_authenc_givencrypt_done()
422 static int crypto_authenc_givencrypt(struct aead_givcrypt_request *req) in crypto_authenc_givencrypt() argument
424 struct crypto_aead *authenc = aead_givcrypt_reqtfm(req); in crypto_authenc_givencrypt()
426 struct aead_request *areq = &req->areq; in crypto_authenc_givencrypt()
428 u8 *iv = req->giv; in crypto_authenc_givencrypt()
436 skcipher_givcrypt_set_giv(greq, iv, req->seq); in crypto_authenc_givencrypt()
445 static int crypto_authenc_verify(struct aead_request *req, in crypto_authenc_verify() argument
448 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_verify()
449 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_verify()
457 ohash = authenc_ahash_fn(req, CRYPTO_TFM_REQ_MAY_SLEEP); in crypto_authenc_verify()
468 static int crypto_authenc_iverify(struct aead_request *req, u8 *iv, in crypto_authenc_iverify() argument
471 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_iverify()
472 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_iverify()
473 struct scatterlist *src = req->src; in crypto_authenc_iverify()
474 struct scatterlist *assoc = req->assoc; in crypto_authenc_iverify()
493 if (req->assoclen && sg_is_last(assoc)) { in crypto_authenc_iverify()
499 cryptlen += req->assoclen; in crypto_authenc_iverify()
505 return crypto_authenc_verify(req, authenc_ahash_fn); in crypto_authenc_iverify()
508 static int crypto_authenc_decrypt(struct aead_request *req) in crypto_authenc_decrypt() argument
510 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_decrypt()
512 struct ablkcipher_request *abreq = aead_request_ctx(req); in crypto_authenc_decrypt()
513 unsigned int cryptlen = req->cryptlen; in crypto_authenc_decrypt()
515 u8 *iv = req->iv; in crypto_authenc_decrypt()
522 err = crypto_authenc_iverify(req, iv, cryptlen); in crypto_authenc_decrypt()
527 ablkcipher_request_set_callback(abreq, aead_request_flags(req), in crypto_authenc_decrypt()
528 req->base.complete, req->base.data); in crypto_authenc_decrypt()
529 ablkcipher_request_set_crypt(abreq, req->src, req->dst, cryptlen, iv); in crypto_authenc_decrypt()