Lines Matching refs:req

220 			   struct skcipher_request *req, int init)
225 struct dcp_aes_req_ctx *rctx = skcipher_request_ctx(req);
296 struct skcipher_request *req = skcipher_request_cast(arq);
298 struct dcp_aes_req_ctx *rctx = skcipher_request_ctx(req);
300 struct scatterlist *dst = req->dst;
301 struct scatterlist *src = req->src;
326 memcpy(key + AES_KEYSIZE_128, req->iv, AES_KEYSIZE_128);
333 for_each_sg(req->src, src, sg_nents(req->src), i) {
337 limit_hit = tlen > req->cryptlen;
340 len = req->cryptlen - (tlen - len);
359 ret = mxs_dcp_run_aes(actx, req, init);
379 memcpy(req->iv, out_buf+(last_out_len-AES_BLOCK_SIZE),
382 memcpy(req->iv, in_buf+(last_out_len-AES_BLOCK_SIZE),
426 static int mxs_dcp_block_fallback(struct skcipher_request *req, int enc)
428 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
429 struct dcp_aes_req_ctx *rctx = skcipher_request_ctx(req);
434 skcipher_request_set_callback(&rctx->fallback_req, req->base.flags,
435 req->base.complete, req->base.data);
436 skcipher_request_set_crypt(&rctx->fallback_req, req->src, req->dst,
437 req->cryptlen, req->iv);
447 static int mxs_dcp_aes_enqueue(struct skcipher_request *req, int enc, int ecb)
450 struct crypto_async_request *arq = &req->base;
452 struct dcp_aes_req_ctx *rctx = skcipher_request_ctx(req);
456 return mxs_dcp_block_fallback(req, enc);
463 ret = crypto_enqueue_request(&sdcp->queue[actx->chan], &req->base);
471 static int mxs_dcp_aes_ecb_decrypt(struct skcipher_request *req)
473 return mxs_dcp_aes_enqueue(req, 0, 1);
476 static int mxs_dcp_aes_ecb_encrypt(struct skcipher_request *req)
478 return mxs_dcp_aes_enqueue(req, 1, 1);
481 static int mxs_dcp_aes_cbc_decrypt(struct skcipher_request *req)
483 return mxs_dcp_aes_enqueue(req, 0, 0);
486 static int mxs_dcp_aes_cbc_encrypt(struct skcipher_request *req)
488 return mxs_dcp_aes_enqueue(req, 1, 0);
544 static int mxs_dcp_run_sha(struct ahash_request *req)
549 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
551 struct dcp_sha_req_ctx *rctx = ahash_request_ctx(req);
618 struct ahash_request *req = ahash_request_cast(arq);
619 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
621 struct dcp_sha_req_ctx *rctx = ahash_request_ctx(req);
636 src = req->src;
637 len = req->nbytes;
657 ret = mxs_dcp_run_sha(req);
669 if (!req->result)
672 ret = mxs_dcp_run_sha(req);
680 req->result[i] = out_buf[halg->digestsize - i - 1];
722 static int dcp_sha_init(struct ahash_request *req)
724 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
749 static int dcp_sha_update_fx(struct ahash_request *req, int fini)
753 struct dcp_sha_req_ctx *rctx = ahash_request_ctx(req);
754 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
763 if (!req->nbytes && !fini)
776 ret = crypto_enqueue_request(&sdcp->queue[actx->chan], &req->base);
785 static int dcp_sha_update(struct ahash_request *req)
787 return dcp_sha_update_fx(req, 0);
790 static int dcp_sha_final(struct ahash_request *req)
792 ahash_request_set_crypt(req, NULL, req->result, 0);
793 req->nbytes = 0;
794 return dcp_sha_update_fx(req, 1);
797 static int dcp_sha_finup(struct ahash_request *req)
799 return dcp_sha_update_fx(req, 1);
802 static int dcp_sha_digest(struct ahash_request *req)
806 ret = dcp_sha_init(req);
810 return dcp_sha_finup(req);
813 static int dcp_sha_import(struct ahash_request *req, const void *in)
815 struct dcp_sha_req_ctx *rctx = ahash_request_ctx(req);
816 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
828 static int dcp_sha_export(struct ahash_request *req, void *out)
830 struct dcp_sha_req_ctx *rctx_state = ahash_request_ctx(req);
831 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);