reqctx 134 drivers/crypto/chelsio/chcr_algo.c static inline void chcr_init_hctx_per_wr(struct chcr_ahash_req_ctx *reqctx) reqctx 136 drivers/crypto/chelsio/chcr_algo.c memset(&reqctx->hctx_wr, 0, sizeof(struct chcr_hctx_per_wr)); reqctx 218 drivers/crypto/chelsio/chcr_algo.c struct chcr_aead_reqctx *reqctx = aead_request_ctx(req); reqctx 223 drivers/crypto/chelsio/chcr_algo.c if (reqctx->verify == VERIFY_SW) { reqctx 225 drivers/crypto/chelsio/chcr_algo.c reqctx->verify = VERIFY_HW; reqctx 766 drivers/crypto/chelsio/chcr_algo.c struct chcr_blkcipher_req_ctx *reqctx = reqctx 776 drivers/crypto/chelsio/chcr_algo.c nents = sg_nents_xlen(reqctx->dstsg, wrparam->bytes, CHCR_DST_SG_SIZE, reqctx 777 drivers/crypto/chelsio/chcr_algo.c reqctx->dst_ofst); reqctx 781 drivers/crypto/chelsio/chcr_algo.c nents = sg_nents_xlen(reqctx->srcsg, wrparam->bytes, reqctx 782 drivers/crypto/chelsio/chcr_algo.c CHCR_SRC_SG_SIZE, reqctx->src_ofst); reqctx 783 drivers/crypto/chelsio/chcr_algo.c temp = reqctx->imm ? roundup(wrparam->bytes, 16) : reqctx 802 drivers/crypto/chelsio/chcr_algo.c chcr_req->sec_cpl.seqno_numivs = FILL_SEC_CPL_SCMD0_SEQNO(reqctx->op, 0, reqctx 809 drivers/crypto/chelsio/chcr_algo.c if ((reqctx->op == CHCR_DECRYPT_OP) && reqctx 837 drivers/crypto/chelsio/chcr_algo.c + (reqctx->imm ? (wrparam->bytes) : 0); reqctx 838 drivers/crypto/chelsio/chcr_algo.c create_wreq(c_ctx(tfm), chcr_req, &(wrparam->req->base), reqctx->imm, 0, reqctx 841 drivers/crypto/chelsio/chcr_algo.c reqctx->skb = skb; reqctx 843 drivers/crypto/chelsio/chcr_algo.c if (reqctx->op && (ablkctx->ciph_mode == reqctx 847 drivers/crypto/chelsio/chcr_algo.c reqctx->processed + wrparam->bytes - AES_BLOCK_SIZE); reqctx 1025 drivers/crypto/chelsio/chcr_algo.c struct chcr_blkcipher_req_ctx *reqctx = ablkcipher_request_ctx(req); reqctx 1030 drivers/crypto/chelsio/chcr_algo.c int round = reqctx->last_req_len / AES_BLOCK_SIZE; reqctx 1033 drivers/crypto/chelsio/chcr_algo.c memcpy(iv, reqctx->iv, AES_BLOCK_SIZE); reqctx 1058 drivers/crypto/chelsio/chcr_algo.c struct chcr_blkcipher_req_ctx *reqctx = ablkcipher_request_ctx(req); reqctx 1063 drivers/crypto/chelsio/chcr_algo.c ctr_add_iv(iv, req->info, (reqctx->processed / reqctx 1066 drivers/crypto/chelsio/chcr_algo.c *(__be32 *)(reqctx->iv + CTR_RFC3686_NONCE_SIZE + reqctx 1067 drivers/crypto/chelsio/chcr_algo.c CTR_RFC3686_IV_SIZE) = cpu_to_be32((reqctx->processed / reqctx 1072 drivers/crypto/chelsio/chcr_algo.c if (reqctx->op) reqctx 1092 drivers/crypto/chelsio/chcr_algo.c struct chcr_blkcipher_req_ctx *reqctx = ablkcipher_request_ctx(req); reqctx 1097 drivers/crypto/chelsio/chcr_algo.c ctr_add_iv(iv, req->info, DIV_ROUND_UP(reqctx->processed, reqctx 1103 drivers/crypto/chelsio/chcr_algo.c if (!reqctx->op) reqctx 1119 drivers/crypto/chelsio/chcr_algo.c struct chcr_blkcipher_req_ctx *reqctx = ablkcipher_request_ctx(req); reqctx 1126 drivers/crypto/chelsio/chcr_algo.c if (req->nbytes == reqctx->processed) { reqctx 1133 drivers/crypto/chelsio/chcr_algo.c if (!reqctx->imm) { reqctx 1134 drivers/crypto/chelsio/chcr_algo.c bytes = chcr_sg_ent_in_wr(reqctx->srcsg, reqctx->dstsg, 0, reqctx 1136 drivers/crypto/chelsio/chcr_algo.c reqctx->src_ofst, reqctx->dst_ofst); reqctx 1137 drivers/crypto/chelsio/chcr_algo.c if ((bytes + reqctx->processed) >= req->nbytes) reqctx 1138 drivers/crypto/chelsio/chcr_algo.c bytes = req->nbytes - reqctx->processed; reqctx 1143 drivers/crypto/chelsio/chcr_algo.c bytes = req->nbytes - reqctx->processed; reqctx 1145 drivers/crypto/chelsio/chcr_algo.c err = chcr_update_cipher_iv(req, fw6_pld, reqctx->iv); reqctx 1158 drivers/crypto/chelsio/chcr_algo.c reqctx->op); reqctx 1164 drivers/crypto/chelsio/chcr_algo.c bytes = adjust_ctr_overflow(reqctx->iv, bytes); reqctx 1177 drivers/crypto/chelsio/chcr_algo.c reqctx->last_req_len = bytes; reqctx 1178 drivers/crypto/chelsio/chcr_algo.c reqctx->processed += bytes; reqctx 1195 drivers/crypto/chelsio/chcr_algo.c struct chcr_blkcipher_req_ctx *reqctx = ablkcipher_request_ctx(req); reqctx 1200 drivers/crypto/chelsio/chcr_algo.c reqctx->processed = 0; reqctx 1227 drivers/crypto/chelsio/chcr_algo.c reqctx->imm = (transhdr_len + IV + req->nbytes) <= reqctx 1232 drivers/crypto/chelsio/chcr_algo.c reqctx->imm = 0; reqctx 1235 drivers/crypto/chelsio/chcr_algo.c if (!reqctx->imm) { reqctx 1239 drivers/crypto/chelsio/chcr_algo.c if ((bytes + reqctx->processed) >= req->nbytes) reqctx 1240 drivers/crypto/chelsio/chcr_algo.c bytes = req->nbytes - reqctx->processed; reqctx 1252 drivers/crypto/chelsio/chcr_algo.c memcpy(reqctx->iv, ablkctx->nonce, CTR_RFC3686_NONCE_SIZE); reqctx 1253 drivers/crypto/chelsio/chcr_algo.c memcpy(reqctx->iv + CTR_RFC3686_NONCE_SIZE, req->info, reqctx 1257 drivers/crypto/chelsio/chcr_algo.c *(__be32 *)(reqctx->iv + CTR_RFC3686_NONCE_SIZE + reqctx 1262 drivers/crypto/chelsio/chcr_algo.c memcpy(reqctx->iv, req->info, IV); reqctx 1272 drivers/crypto/chelsio/chcr_algo.c reqctx->iv, reqctx 1276 drivers/crypto/chelsio/chcr_algo.c reqctx->op = op_type; reqctx 1277 drivers/crypto/chelsio/chcr_algo.c reqctx->srcsg = req->src; reqctx 1278 drivers/crypto/chelsio/chcr_algo.c reqctx->dstsg = req->dst; reqctx 1279 drivers/crypto/chelsio/chcr_algo.c reqctx->src_ofst = 0; reqctx 1280 drivers/crypto/chelsio/chcr_algo.c reqctx->dst_ofst = 0; reqctx 1289 drivers/crypto/chelsio/chcr_algo.c reqctx->processed = bytes; reqctx 1290 drivers/crypto/chelsio/chcr_algo.c reqctx->last_req_len = bytes; reqctx 1930 drivers/crypto/chelsio/chcr_algo.c struct chcr_ahash_req_ctx *reqctx = ahash_request_ctx(req); reqctx 1931 drivers/crypto/chelsio/chcr_algo.c struct chcr_hctx_per_wr *hctx_wr = &reqctx->hctx_wr; reqctx 1969 drivers/crypto/chelsio/chcr_algo.c params.scmd1 = reqctx->data_len + params.sg_len; reqctx 1972 drivers/crypto/chelsio/chcr_algo.c reqctx->data_len += params.sg_len; reqctx 1991 drivers/crypto/chelsio/chcr_algo.c struct chcr_ahash_req_ctx *reqctx = ahash_request_ctx(req); reqctx 1992 drivers/crypto/chelsio/chcr_algo.c struct chcr_hctx_per_wr *hctx_wr = &reqctx->hctx_wr; reqctx 2012 drivers/crypto/chelsio/chcr_algo.c if (hctx_wr->isfinal || ((hctx_wr->processed + reqctx->reqlen) == reqctx 2019 drivers/crypto/chelsio/chcr_algo.c memcpy(reqctx->partial_hash, reqctx 2026 drivers/crypto/chelsio/chcr_algo.c memcpy(reqctx->partial_hash, input + sizeof(struct cpl_fw6_pld), reqctx 2255 drivers/crypto/chelsio/chcr_algo.c struct chcr_aead_reqctx *reqctx = aead_request_ctx(req); reqctx 2259 drivers/crypto/chelsio/chcr_algo.c chcr_aead_dma_unmap(&u_ctx->lldi.pdev->dev, req, reqctx->op); reqctx 2266 drivers/crypto/chelsio/chcr_algo.c struct chcr_aead_reqctx *reqctx = aead_request_ctx(req); reqctx 2273 drivers/crypto/chelsio/chcr_algo.c if (reqctx->op && req->cryptlen < authsize) reqctx 2275 drivers/crypto/chelsio/chcr_algo.c if (reqctx->b0_len) reqctx 2276 drivers/crypto/chelsio/chcr_algo.c reqctx->scratch_pad = reqctx->iv + IV; reqctx 2278 drivers/crypto/chelsio/chcr_algo.c reqctx->scratch_pad = NULL; reqctx 2281 drivers/crypto/chelsio/chcr_algo.c reqctx->op); reqctx 2329 drivers/crypto/chelsio/chcr_algo.c struct chcr_aead_reqctx *reqctx = aead_request_ctx(req); reqctx 2348 drivers/crypto/chelsio/chcr_algo.c reqctx->b0_len = 0; reqctx 2358 drivers/crypto/chelsio/chcr_algo.c (reqctx->op ? -authsize : authsize), CHCR_DST_SG_SIZE, 0); reqctx 2366 drivers/crypto/chelsio/chcr_algo.c reqctx->imm = (transhdr_len + req->assoclen + req->cryptlen) < reqctx 2368 drivers/crypto/chelsio/chcr_algo.c temp = reqctx->imm ? roundup(req->assoclen + req->cryptlen, 16) reqctx 2374 drivers/crypto/chelsio/chcr_algo.c transhdr_len, reqctx->op)) { reqctx 2377 drivers/crypto/chelsio/chcr_algo.c return ERR_PTR(chcr_aead_fallback(req, reqctx->op)); reqctx 2387 drivers/crypto/chelsio/chcr_algo.c temp = (reqctx->op == CHCR_ENCRYPT_OP) ? 0 : authsize; reqctx 2411 drivers/crypto/chelsio/chcr_algo.c chcr_req->sec_cpl.seqno_numivs = FILL_SEC_CPL_SCMD0_SEQNO(reqctx->op, reqctx 2412 drivers/crypto/chelsio/chcr_algo.c (reqctx->op == CHCR_ENCRYPT_OP) ? 1 : 0, reqctx 2420 drivers/crypto/chelsio/chcr_algo.c if (reqctx->op == CHCR_ENCRYPT_OP || reqctx 2448 drivers/crypto/chelsio/chcr_algo.c kctx_len + (reqctx->imm ? (req->assoclen + req->cryptlen) : 0); reqctx 2449 drivers/crypto/chelsio/chcr_algo.c create_wreq(a_ctx(tfm), chcr_req, &req->base, reqctx->imm, size, reqctx 2451 drivers/crypto/chelsio/chcr_algo.c reqctx->skb = skb; reqctx 2465 drivers/crypto/chelsio/chcr_algo.c struct chcr_aead_reqctx *reqctx = aead_request_ctx(req); reqctx 2474 drivers/crypto/chelsio/chcr_algo.c reqctx->iv_dma = dma_map_single(dev, reqctx->iv, (IV + reqctx->b0_len), reqctx 2476 drivers/crypto/chelsio/chcr_algo.c if (dma_mapping_error(dev, reqctx->iv_dma)) reqctx 2478 drivers/crypto/chelsio/chcr_algo.c if (reqctx->b0_len) reqctx 2479 drivers/crypto/chelsio/chcr_algo.c reqctx->b0_dma = reqctx->iv_dma + IV; reqctx 2481 drivers/crypto/chelsio/chcr_algo.c reqctx->b0_dma = 0; reqctx 2503 drivers/crypto/chelsio/chcr_algo.c dma_unmap_single(dev, reqctx->iv_dma, IV, DMA_BIDIRECTIONAL); reqctx 2511 drivers/crypto/chelsio/chcr_algo.c struct chcr_aead_reqctx *reqctx = aead_request_ctx(req); reqctx 2521 drivers/crypto/chelsio/chcr_algo.c dma_unmap_single(dev, reqctx->iv_dma, (IV + reqctx->b0_len), reqctx 2538 drivers/crypto/chelsio/chcr_algo.c struct chcr_aead_reqctx *reqctx = aead_request_ctx(req); reqctx 2540 drivers/crypto/chelsio/chcr_algo.c if (reqctx->imm) { reqctx 2543 drivers/crypto/chelsio/chcr_algo.c if (reqctx->b0_len) { reqctx 2544 drivers/crypto/chelsio/chcr_algo.c memcpy(buf, reqctx->scratch_pad, reqctx->b0_len); reqctx 2545 drivers/crypto/chelsio/chcr_algo.c buf += reqctx->b0_len; reqctx 2551 drivers/crypto/chelsio/chcr_algo.c if (reqctx->b0_len) reqctx 2552 drivers/crypto/chelsio/chcr_algo.c ulptx_walk_add_page(&ulp_walk, reqctx->b0_len, reqctx 2553 drivers/crypto/chelsio/chcr_algo.c reqctx->b0_dma); reqctx 2564 drivers/crypto/chelsio/chcr_algo.c struct chcr_aead_reqctx *reqctx = aead_request_ctx(req); reqctx 2572 drivers/crypto/chelsio/chcr_algo.c dsgl_walk_add_page(&dsgl_walk, IV + reqctx->b0_len, reqctx->iv_dma); reqctx 2574 drivers/crypto/chelsio/chcr_algo.c (reqctx->op ? -authsize : authsize); reqctx 2584 drivers/crypto/chelsio/chcr_algo.c struct chcr_blkcipher_req_ctx *reqctx = ablkcipher_request_ctx(req); reqctx 2587 drivers/crypto/chelsio/chcr_algo.c memcpy(buf, reqctx->iv, IV); reqctx 2589 drivers/crypto/chelsio/chcr_algo.c if (reqctx->imm) { reqctx 2591 drivers/crypto/chelsio/chcr_algo.c buf, wrparam->bytes, reqctx->processed); reqctx 2594 drivers/crypto/chelsio/chcr_algo.c ulptx_walk_add_sg(&ulp_walk, reqctx->srcsg, wrparam->bytes, reqctx 2595 drivers/crypto/chelsio/chcr_algo.c reqctx->src_ofst); reqctx 2596 drivers/crypto/chelsio/chcr_algo.c reqctx->srcsg = ulp_walk.last_sg; reqctx 2597 drivers/crypto/chelsio/chcr_algo.c reqctx->src_ofst = ulp_walk.last_sg_len; reqctx 2607 drivers/crypto/chelsio/chcr_algo.c struct chcr_blkcipher_req_ctx *reqctx = ablkcipher_request_ctx(req); reqctx 2613 drivers/crypto/chelsio/chcr_algo.c dsgl_walk_add_sg(&dsgl_walk, reqctx->dstsg, wrparam->bytes, reqctx 2614 drivers/crypto/chelsio/chcr_algo.c reqctx->dst_ofst); reqctx 2615 drivers/crypto/chelsio/chcr_algo.c reqctx->dstsg = dsgl_walk.last_sg; reqctx 2616 drivers/crypto/chelsio/chcr_algo.c reqctx->dst_ofst = dsgl_walk.last_sg_len; reqctx 2626 drivers/crypto/chelsio/chcr_algo.c struct chcr_ahash_req_ctx *reqctx = ahash_request_ctx(req); reqctx 2628 drivers/crypto/chelsio/chcr_algo.c if (reqctx->hctx_wr.imm) { reqctx 2632 drivers/crypto/chelsio/chcr_algo.c memcpy(buf, reqctx->reqbfr, param->bfr_len); reqctx 2636 drivers/crypto/chelsio/chcr_algo.c sg_pcopy_to_buffer(reqctx->hctx_wr.srcsg, reqctx 2637 drivers/crypto/chelsio/chcr_algo.c sg_nents(reqctx->hctx_wr.srcsg), buf, reqctx 2643 drivers/crypto/chelsio/chcr_algo.c reqctx->hctx_wr.dma_addr); reqctx 2644 drivers/crypto/chelsio/chcr_algo.c ulptx_walk_add_sg(&ulp_walk, reqctx->hctx_wr.srcsg, reqctx 2645 drivers/crypto/chelsio/chcr_algo.c param->sg_len, reqctx->hctx_wr.src_ofst); reqctx 2646 drivers/crypto/chelsio/chcr_algo.c reqctx->hctx_wr.srcsg = ulp_walk.last_sg; reqctx 2647 drivers/crypto/chelsio/chcr_algo.c reqctx->hctx_wr.src_ofst = ulp_walk.last_sg_len; reqctx 2749 drivers/crypto/chelsio/chcr_algo.c struct chcr_aead_reqctx *reqctx = aead_request_ctx(req); reqctx 2750 drivers/crypto/chelsio/chcr_algo.c u8 *b0 = reqctx->scratch_pad; reqctx 2787 drivers/crypto/chelsio/chcr_algo.c struct chcr_aead_reqctx *reqctx = aead_request_ctx(req); reqctx 2801 drivers/crypto/chelsio/chcr_algo.c *((unsigned short *)(reqctx->scratch_pad + 16)) = reqctx 2889 drivers/crypto/chelsio/chcr_algo.c struct chcr_aead_reqctx *reqctx = aead_request_ctx(req); reqctx 2907 drivers/crypto/chelsio/chcr_algo.c reqctx->b0_len = CCM_B0_SIZE + (assoclen ? CCM_AAD_FIELD_SIZE : 0); reqctx 2912 drivers/crypto/chelsio/chcr_algo.c error = aead_ccm_validate_input(reqctx->op, req, aeadctx, sub_type); reqctx 2916 drivers/crypto/chelsio/chcr_algo.c + (reqctx->op ? -authsize : authsize), reqctx 2925 drivers/crypto/chelsio/chcr_algo.c reqctx->imm = (transhdr_len + req->assoclen + req->cryptlen + reqctx 2926 drivers/crypto/chelsio/chcr_algo.c reqctx->b0_len) <= SGE_MAX_WR_LEN; reqctx 2927 drivers/crypto/chelsio/chcr_algo.c temp = reqctx->imm ? roundup(req->assoclen + req->cryptlen + reqctx 2928 drivers/crypto/chelsio/chcr_algo.c reqctx->b0_len, 16) : reqctx 2934 drivers/crypto/chelsio/chcr_algo.c reqctx->b0_len, transhdr_len, reqctx->op)) { reqctx 2937 drivers/crypto/chelsio/chcr_algo.c return ERR_PTR(chcr_aead_fallback(req, reqctx->op)); reqctx 2948 drivers/crypto/chelsio/chcr_algo.c fill_sec_cpl_for_aead(&chcr_req->sec_cpl, dst_size, req, reqctx->op); reqctx 2958 drivers/crypto/chelsio/chcr_algo.c error = ccm_format_packet(req, ivptr, sub_type, reqctx->op, assoclen); reqctx 2966 drivers/crypto/chelsio/chcr_algo.c kctx_len + (reqctx->imm ? (req->assoclen + req->cryptlen + reqctx 2967 drivers/crypto/chelsio/chcr_algo.c reqctx->b0_len) : 0); reqctx 2968 drivers/crypto/chelsio/chcr_algo.c create_wreq(a_ctx(tfm), chcr_req, &req->base, reqctx->imm, 0, reqctx 2970 drivers/crypto/chelsio/chcr_algo.c reqctx->skb = skb; reqctx 2986 drivers/crypto/chelsio/chcr_algo.c struct chcr_aead_reqctx *reqctx = aead_request_ctx(req); reqctx 3003 drivers/crypto/chelsio/chcr_algo.c reqctx->b0_len = 0; reqctx 3008 drivers/crypto/chelsio/chcr_algo.c (reqctx->op ? -authsize : authsize), reqctx 3016 drivers/crypto/chelsio/chcr_algo.c reqctx->imm = (transhdr_len + req->assoclen + req->cryptlen) <= reqctx 3018 drivers/crypto/chelsio/chcr_algo.c temp = reqctx->imm ? roundup(req->assoclen + req->cryptlen, 16) : reqctx 3023 drivers/crypto/chelsio/chcr_algo.c transhdr_len, reqctx->op)) { reqctx 3027 drivers/crypto/chelsio/chcr_algo.c return ERR_PTR(chcr_aead_fallback(req, reqctx->op)); reqctx 3038 drivers/crypto/chelsio/chcr_algo.c temp = (reqctx->op == CHCR_ENCRYPT_OP) ? 0 : authsize; reqctx 3051 drivers/crypto/chelsio/chcr_algo.c FILL_SEC_CPL_SCMD0_SEQNO(reqctx->op, (reqctx->op == reqctx 3082 drivers/crypto/chelsio/chcr_algo.c kctx_len + (reqctx->imm ? (req->assoclen + req->cryptlen) : 0); reqctx 3083 drivers/crypto/chelsio/chcr_algo.c create_wreq(a_ctx(tfm), chcr_req, &req->base, reqctx->imm, size, reqctx 3084 drivers/crypto/chelsio/chcr_algo.c transhdr_len, temp, reqctx->verify); reqctx 3085 drivers/crypto/chelsio/chcr_algo.c reqctx->skb = skb; reqctx 3608 drivers/crypto/chelsio/chcr_algo.c struct chcr_aead_reqctx *reqctx = aead_request_ctx(req); reqctx 3624 drivers/crypto/chelsio/chcr_algo.c return chcr_aead_fallback(req, reqctx->op); reqctx 3654 drivers/crypto/chelsio/chcr_algo.c struct chcr_aead_reqctx *reqctx = aead_request_ctx(req); reqctx 3656 drivers/crypto/chelsio/chcr_algo.c reqctx->verify = VERIFY_HW; reqctx 3657 drivers/crypto/chelsio/chcr_algo.c reqctx->op = CHCR_ENCRYPT_OP; reqctx 3677 drivers/crypto/chelsio/chcr_algo.c struct chcr_aead_reqctx *reqctx = aead_request_ctx(req); reqctx 3682 drivers/crypto/chelsio/chcr_algo.c reqctx->verify = VERIFY_SW; reqctx 3685 drivers/crypto/chelsio/chcr_algo.c reqctx->verify = VERIFY_HW; reqctx 3687 drivers/crypto/chelsio/chcr_algo.c reqctx->op = CHCR_DECRYPT_OP; reqctx 482 drivers/crypto/s5p-sss.c struct s5p_aes_reqctx *reqctx = ablkcipher_request_ctx(req); reqctx 493 drivers/crypto/s5p-sss.c if (reqctx->mode & FLAGS_AES_CBC) reqctx 496 drivers/crypto/s5p-sss.c else if (reqctx->mode & FLAGS_AES_CTR) reqctx 2007 drivers/crypto/s5p-sss.c struct s5p_aes_reqctx *reqctx; reqctx 2026 drivers/crypto/s5p-sss.c reqctx = ablkcipher_request_ctx(dev->req); reqctx 2028 drivers/crypto/s5p-sss.c s5p_aes_crypt_start(dev, reqctx->mode); reqctx 2055 drivers/crypto/s5p-sss.c struct s5p_aes_reqctx *reqctx = ablkcipher_request_ctx(req); reqctx 2068 drivers/crypto/s5p-sss.c reqctx->mode = mode;