Lines Matching refs:req

197 			   struct ablkcipher_request *req, int init)  in mxs_dcp_run_aes()  argument
201 struct dcp_aes_req_ctx *rctx = ablkcipher_request_ctx(req); in mxs_dcp_run_aes()
253 struct ablkcipher_request *req = ablkcipher_request_cast(arq); in mxs_dcp_aes_block_crypt() local
255 struct dcp_aes_req_ctx *rctx = ablkcipher_request_ctx(req); in mxs_dcp_aes_block_crypt()
257 struct scatterlist *dst = req->dst; in mxs_dcp_aes_block_crypt()
258 struct scatterlist *src = req->src; in mxs_dcp_aes_block_crypt()
259 const int nents = sg_nents(req->src); in mxs_dcp_aes_block_crypt()
282 memcpy(key + AES_KEYSIZE_128, req->info, AES_KEYSIZE_128); in mxs_dcp_aes_block_crypt()
289 for_each_sg(req->src, src, nents, i) { in mxs_dcp_aes_block_crypt()
309 ret = mxs_dcp_run_aes(actx, req, init); in mxs_dcp_aes_block_crypt()
375 static int mxs_dcp_block_fallback(struct ablkcipher_request *req, int enc) in mxs_dcp_block_fallback() argument
378 crypto_ablkcipher_tfm(crypto_ablkcipher_reqtfm(req)); in mxs_dcp_block_fallback()
380 crypto_ablkcipher_reqtfm(req)); in mxs_dcp_block_fallback()
383 ablkcipher_request_set_tfm(req, ctx->fallback); in mxs_dcp_block_fallback()
386 ret = crypto_ablkcipher_encrypt(req); in mxs_dcp_block_fallback()
388 ret = crypto_ablkcipher_decrypt(req); in mxs_dcp_block_fallback()
390 ablkcipher_request_set_tfm(req, __crypto_ablkcipher_cast(tfm)); in mxs_dcp_block_fallback()
395 static int mxs_dcp_aes_enqueue(struct ablkcipher_request *req, int enc, int ecb) in mxs_dcp_aes_enqueue() argument
398 struct crypto_async_request *arq = &req->base; in mxs_dcp_aes_enqueue()
400 struct dcp_aes_req_ctx *rctx = ablkcipher_request_ctx(req); in mxs_dcp_aes_enqueue()
404 return mxs_dcp_block_fallback(req, enc); in mxs_dcp_aes_enqueue()
411 ret = crypto_enqueue_request(&sdcp->queue[actx->chan], &req->base); in mxs_dcp_aes_enqueue()
419 static int mxs_dcp_aes_ecb_decrypt(struct ablkcipher_request *req) in mxs_dcp_aes_ecb_decrypt() argument
421 return mxs_dcp_aes_enqueue(req, 0, 1); in mxs_dcp_aes_ecb_decrypt()
424 static int mxs_dcp_aes_ecb_encrypt(struct ablkcipher_request *req) in mxs_dcp_aes_ecb_encrypt() argument
426 return mxs_dcp_aes_enqueue(req, 1, 1); in mxs_dcp_aes_ecb_encrypt()
429 static int mxs_dcp_aes_cbc_decrypt(struct ablkcipher_request *req) in mxs_dcp_aes_cbc_decrypt() argument
431 return mxs_dcp_aes_enqueue(req, 0, 0); in mxs_dcp_aes_cbc_decrypt()
434 static int mxs_dcp_aes_cbc_encrypt(struct ablkcipher_request *req) in mxs_dcp_aes_cbc_encrypt() argument
436 return mxs_dcp_aes_enqueue(req, 1, 0); in mxs_dcp_aes_cbc_encrypt()
509 static int mxs_dcp_run_sha(struct ahash_request *req) in mxs_dcp_run_sha() argument
514 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in mxs_dcp_run_sha()
516 struct dcp_sha_req_ctx *rctx = ahash_request_ctx(req); in mxs_dcp_run_sha()
542 digest_phys = dma_map_single(sdcp->dev, req->result, in mxs_dcp_run_sha()
563 struct ahash_request *req = ahash_request_cast(arq); in dcp_sha_req_to_buf() local
564 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in dcp_sha_req_to_buf()
566 struct dcp_sha_req_ctx *rctx = ahash_request_ctx(req); in dcp_sha_req_to_buf()
568 const int nents = sg_nents(req->src); in dcp_sha_req_to_buf()
583 for_each_sg(req->src, src, nents, i) { in dcp_sha_req_to_buf()
603 ret = mxs_dcp_run_sha(req); in dcp_sha_req_to_buf()
616 if (!req->result) in dcp_sha_req_to_buf()
619 ret = mxs_dcp_run_sha(req); in dcp_sha_req_to_buf()
627 swap(req->result[i], in dcp_sha_req_to_buf()
628 req->result[halg->digestsize - i - 1]); in dcp_sha_req_to_buf()
645 struct ahash_request *req; in dcp_chan_thread_sha() local
660 req = ahash_request_cast(arq); in dcp_chan_thread_sha()
661 rctx = ahash_request_ctx(req); in dcp_chan_thread_sha()
676 static int dcp_sha_init(struct ahash_request *req) in dcp_sha_init() argument
678 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in dcp_sha_init()
703 static int dcp_sha_update_fx(struct ahash_request *req, int fini) in dcp_sha_update_fx() argument
707 struct dcp_sha_req_ctx *rctx = ahash_request_ctx(req); in dcp_sha_update_fx()
708 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in dcp_sha_update_fx()
717 if (!req->nbytes && !fini) in dcp_sha_update_fx()
730 ret = crypto_enqueue_request(&sdcp->queue[actx->chan], &req->base); in dcp_sha_update_fx()
739 static int dcp_sha_update(struct ahash_request *req) in dcp_sha_update() argument
741 return dcp_sha_update_fx(req, 0); in dcp_sha_update()
744 static int dcp_sha_final(struct ahash_request *req) in dcp_sha_final() argument
746 ahash_request_set_crypt(req, NULL, req->result, 0); in dcp_sha_final()
747 req->nbytes = 0; in dcp_sha_final()
748 return dcp_sha_update_fx(req, 1); in dcp_sha_final()
751 static int dcp_sha_finup(struct ahash_request *req) in dcp_sha_finup() argument
753 return dcp_sha_update_fx(req, 1); in dcp_sha_finup()
756 static int dcp_sha_digest(struct ahash_request *req) in dcp_sha_digest() argument
760 ret = dcp_sha_init(req); in dcp_sha_digest()
764 return dcp_sha_finup(req); in dcp_sha_digest()