Lines Matching refs:req

221 			   struct skcipher_request *req, int init)
226 struct dcp_aes_req_ctx *rctx = skcipher_request_ctx(req);
297 struct skcipher_request *req = skcipher_request_cast(arq);
299 struct dcp_aes_req_ctx *rctx = skcipher_request_ctx(req);
301 struct scatterlist *dst = req->dst;
302 struct scatterlist *src = req->src;
327 memcpy(key + AES_KEYSIZE_128, req->iv, AES_KEYSIZE_128);
334 for_each_sg(req->src, src, sg_nents(req->src), i) {
338 limit_hit = tlen > req->cryptlen;
341 len = req->cryptlen - (tlen - len);
360 ret = mxs_dcp_run_aes(actx, req, init);
380 memcpy(req->iv, out_buf+(last_out_len-AES_BLOCK_SIZE),
383 memcpy(req->iv, in_buf+(last_out_len-AES_BLOCK_SIZE),
427 static int mxs_dcp_block_fallback(struct skcipher_request *req, int enc)
429 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
430 struct dcp_aes_req_ctx *rctx = skcipher_request_ctx(req);
435 skcipher_request_set_callback(&rctx->fallback_req, req->base.flags,
436 req->base.complete, req->base.data);
437 skcipher_request_set_crypt(&rctx->fallback_req, req->src, req->dst,
438 req->cryptlen, req->iv);
448 static int mxs_dcp_aes_enqueue(struct skcipher_request *req, int enc, int ecb)
451 struct crypto_async_request *arq = &req->base;
453 struct dcp_aes_req_ctx *rctx = skcipher_request_ctx(req);
457 return mxs_dcp_block_fallback(req, enc);
464 ret = crypto_enqueue_request(&sdcp->queue[actx->chan], &req->base);
472 static int mxs_dcp_aes_ecb_decrypt(struct skcipher_request *req)
474 return mxs_dcp_aes_enqueue(req, 0, 1);
477 static int mxs_dcp_aes_ecb_encrypt(struct skcipher_request *req)
479 return mxs_dcp_aes_enqueue(req, 1, 1);
482 static int mxs_dcp_aes_cbc_decrypt(struct skcipher_request *req)
484 return mxs_dcp_aes_enqueue(req, 0, 0);
487 static int mxs_dcp_aes_cbc_encrypt(struct skcipher_request *req)
489 return mxs_dcp_aes_enqueue(req, 1, 0);
545 static int mxs_dcp_run_sha(struct ahash_request *req)
550 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
552 struct dcp_sha_req_ctx *rctx = ahash_request_ctx(req);
619 struct ahash_request *req = ahash_request_cast(arq);
620 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
622 struct dcp_sha_req_ctx *rctx = ahash_request_ctx(req);
637 src = req->src;
638 len = req->nbytes;
658 ret = mxs_dcp_run_sha(req);
670 if (!req->result)
673 ret = mxs_dcp_run_sha(req);
681 req->result[i] = out_buf[halg->digestsize - i - 1];
723 static int dcp_sha_init(struct ahash_request *req)
725 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
750 static int dcp_sha_update_fx(struct ahash_request *req, int fini)
754 struct dcp_sha_req_ctx *rctx = ahash_request_ctx(req);
755 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
764 if (!req->nbytes && !fini)
777 ret = crypto_enqueue_request(&sdcp->queue[actx->chan], &req->base);
786 static int dcp_sha_update(struct ahash_request *req)
788 return dcp_sha_update_fx(req, 0);
791 static int dcp_sha_final(struct ahash_request *req)
793 ahash_request_set_crypt(req, NULL, req->result, 0);
794 req->nbytes = 0;
795 return dcp_sha_update_fx(req, 1);
798 static int dcp_sha_finup(struct ahash_request *req)
800 return dcp_sha_update_fx(req, 1);
803 static int dcp_sha_digest(struct ahash_request *req)
807 ret = dcp_sha_init(req);
811 return dcp_sha_finup(req);
814 static int dcp_sha_import(struct ahash_request *req, const void *in)
816 struct dcp_sha_req_ctx *rctx = ahash_request_ctx(req);
817 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
829 static int dcp_sha_export(struct ahash_request *req, void *out)
831 struct dcp_sha_req_ctx *rctx_state = ahash_request_ctx(req);
832 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);