Lines Matching refs:tfm
174 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in chcr_verify_tag() local
175 int authsize = crypto_aead_authsize(tfm); in chcr_verify_tag()
180 if ((get_aead_subtype(tfm) == CRYPTO_ALG_SUB_TYPE_AEAD_RFC4106) || in chcr_verify_tag()
181 (get_aead_subtype(tfm) == CRYPTO_ALG_SUB_TYPE_AEAD_GCM)) { in chcr_verify_tag()
214 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in chcr_handle_aead_resp() local
215 struct chcr_dev *dev = a_ctx(tfm)->dev; in chcr_handle_aead_resp()
364 static inline int is_hmac(struct crypto_tfm *tfm) in is_hmac() argument
366 struct crypto_alg *alg = tfm->__crt_alg; in is_hmac()
566 static inline int get_cryptoalg_subtype(struct crypto_skcipher *tfm) in get_cryptoalg_subtype() argument
568 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in get_cryptoalg_subtype()
713 struct crypto_tfm *tfm = req->tfm; in get_qidxs() local
716 switch (tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK) { in get_qidxs()
800 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(wrparam->req); in create_cipher_wr() local
801 struct chcr_context *ctx = c_ctx(tfm); in create_cipher_wr()
854 (!(get_cryptoalg_subtype(tfm) == in create_cipher_wr()
856 (!(get_cryptoalg_subtype(tfm) == in create_cipher_wr()
882 create_wreq(c_ctx(tfm), chcr_req, &(wrparam->req->base), reqctx->imm, 0, in create_cipher_wr()
1057 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in chcr_update_tweak() local
1058 struct ablk_ctx *ablkctx = ABLK_CTX(c_ctx(tfm)); in chcr_update_tweak()
1098 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in chcr_update_cipher_iv() local
1100 int subtype = get_cryptoalg_subtype(tfm); in chcr_update_cipher_iv()
1132 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in chcr_final_cipher_iv() local
1134 int subtype = get_cryptoalg_subtype(tfm); in chcr_final_cipher_iv()
1160 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in chcr_handle_cipher_resp() local
1162 struct ablk_ctx *ablkctx = ABLK_CTX(c_ctx(tfm)); in chcr_handle_cipher_resp()
1163 struct uld_ctx *u_ctx = ULD_CTX(c_ctx(tfm)); in chcr_handle_cipher_resp()
1164 struct chcr_dev *dev = c_ctx(tfm)->dev; in chcr_handle_cipher_resp()
1165 struct chcr_context *ctx = c_ctx(tfm); in chcr_handle_cipher_resp()
1174 chcr_cipher_dma_unmap(&ULD_CTX(c_ctx(tfm))->lldi.pdev->dev, in chcr_handle_cipher_resp()
1197 chcr_cipher_dma_unmap(&ULD_CTX(c_ctx(tfm))->lldi.pdev->dev, in chcr_handle_cipher_resp()
1206 if (get_cryptoalg_subtype(tfm) == in chcr_handle_cipher_resp()
1223 if (get_cryptoalg_subtype(tfm) == in chcr_handle_cipher_resp()
1230 chcr_cipher_dma_unmap(&ULD_CTX(c_ctx(tfm))->lldi.pdev->dev, req); in chcr_handle_cipher_resp()
1232 if (get_cryptoalg_subtype(tfm) == in chcr_handle_cipher_resp()
1248 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in process_cipher() local
1249 unsigned int ivsize = crypto_skcipher_ivsize(tfm); in process_cipher()
1250 struct ablk_ctx *ablkctx = ABLK_CTX(c_ctx(tfm)); in process_cipher()
1251 struct adapter *adap = padap(c_ctx(tfm)->dev); in process_cipher()
1260 subtype = get_cryptoalg_subtype(tfm); in process_cipher()
1263 (req->cryptlen % crypto_skcipher_blocksize(tfm))) { in process_cipher()
1266 else if (req->cryptlen % crypto_skcipher_blocksize(tfm) && in process_cipher()
1274 err = chcr_cipher_dma_map(&ULD_CTX(c_ctx(tfm))->lldi.pdev->dev, req); in process_cipher()
1328 chcr_cipher_dma_unmap(&ULD_CTX(c_ctx(tfm))->lldi.pdev->dev, in process_cipher()
1357 chcr_cipher_dma_unmap(&ULD_CTX(c_ctx(tfm))->lldi.pdev->dev, req); in process_cipher()
1364 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in chcr_aes_encrypt() local
1366 struct chcr_dev *dev = c_ctx(tfm)->dev; in chcr_aes_encrypt()
1369 struct uld_ctx *u_ctx = ULD_CTX(c_ctx(tfm)); in chcr_aes_encrypt()
1370 struct chcr_context *ctx = c_ctx(tfm); in chcr_aes_encrypt()
1395 if (get_cryptoalg_subtype(tfm) == in chcr_aes_encrypt()
1409 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in chcr_aes_decrypt() local
1411 struct uld_ctx *u_ctx = ULD_CTX(c_ctx(tfm)); in chcr_aes_decrypt()
1412 struct chcr_dev *dev = c_ctx(tfm)->dev; in chcr_aes_decrypt()
1415 struct chcr_context *ctx = c_ctx(tfm); in chcr_aes_decrypt()
1466 static int chcr_init_tfm(struct crypto_skcipher *tfm) in chcr_init_tfm() argument
1468 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in chcr_init_tfm()
1469 struct chcr_context *ctx = crypto_skcipher_ctx(tfm); in chcr_init_tfm()
1479 crypto_skcipher_set_reqsize(tfm, sizeof(struct chcr_skcipher_req_ctx) + in chcr_init_tfm()
1485 static int chcr_rfc3686_init(struct crypto_skcipher *tfm) in chcr_rfc3686_init() argument
1487 struct skcipher_alg *alg = crypto_skcipher_alg(tfm); in chcr_rfc3686_init()
1488 struct chcr_context *ctx = crypto_skcipher_ctx(tfm); in chcr_rfc3686_init()
1500 crypto_skcipher_set_reqsize(tfm, sizeof(struct chcr_skcipher_req_ctx) + in chcr_rfc3686_init()
1506 static void chcr_exit_tfm(struct crypto_skcipher *tfm) in chcr_exit_tfm() argument
1508 struct chcr_context *ctx = crypto_skcipher_ctx(tfm); in chcr_exit_tfm()
1564 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in create_hash_wr() local
1565 struct chcr_context *ctx = h_ctx(tfm); in create_hash_wr()
1575 struct adapter *adap = padap(h_ctx(tfm)->dev); in create_hash_wr()
1646 create_wreq(h_ctx(tfm), chcr_req, &req->base, req_ctx->hctx_wr.imm, in create_hash_wr()
2089 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in chcr_handle_ahash_resp() local
2090 struct uld_ctx *u_ctx = ULD_CTX(h_ctx(tfm)); in chcr_handle_ahash_resp()
2091 struct chcr_dev *dev = h_ctx(tfm)->dev; in chcr_handle_ahash_resp()
2145 struct crypto_tfm *tfm = req->tfm; in chcr_handle_resp() local
2146 struct chcr_context *ctx = crypto_tfm_ctx(tfm); in chcr_handle_resp()
2149 switch (tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK) { in chcr_handle_resp()
2194 static int chcr_ahash_setkey(struct crypto_ahash *tfm, const u8 *key, in chcr_ahash_setkey() argument
2197 struct hmac_ctx *hmacctx = HMAC_CTX(h_ctx(tfm)); in chcr_ahash_setkey()
2198 unsigned int digestsize = crypto_ahash_digestsize(tfm); in chcr_ahash_setkey()
2199 unsigned int bs = crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); in chcr_ahash_setkey()
2208 shash->tfm = hmacctx->base_hash; in chcr_ahash_setkey()
2295 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in chcr_sha_init() local
2296 int digestsize = crypto_ahash_digestsize(tfm); in chcr_sha_init()
2307 static int chcr_sha_cra_init(struct crypto_tfm *tfm) in chcr_sha_cra_init() argument
2309 crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), in chcr_sha_cra_init()
2311 return chcr_device_init(crypto_tfm_ctx(tfm)); in chcr_sha_cra_init()
2338 static int chcr_hmac_cra_init(struct crypto_tfm *tfm) in chcr_hmac_cra_init() argument
2340 struct chcr_context *ctx = crypto_tfm_ctx(tfm); in chcr_hmac_cra_init()
2343 crypto_ahash_digestsize(__crypto_ahash_cast(tfm)); in chcr_hmac_cra_init()
2345 crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), in chcr_hmac_cra_init()
2350 return chcr_device_init(crypto_tfm_ctx(tfm)); in chcr_hmac_cra_init()
2353 static void chcr_hmac_cra_exit(struct crypto_tfm *tfm) in chcr_hmac_cra_exit() argument
2355 struct chcr_context *ctx = crypto_tfm_ctx(tfm); in chcr_hmac_cra_exit()
2367 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in chcr_aead_common_exit() local
2368 struct uld_ctx *u_ctx = ULD_CTX(a_ctx(tfm)); in chcr_aead_common_exit()
2375 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in chcr_aead_common_init() local
2376 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_aead_common_init()
2378 unsigned int authsize = crypto_aead_authsize(tfm); in chcr_aead_common_init()
2391 error = chcr_aead_dma_map(&ULD_CTX(a_ctx(tfm))->lldi.pdev->dev, req, in chcr_aead_common_init()
2419 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in chcr_aead_fallback() local
2420 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_aead_fallback()
2437 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in create_authenc_wr() local
2438 struct chcr_context *ctx = a_ctx(tfm); in create_authenc_wr()
2448 unsigned int dst_size = 0, temp, subtype = get_aead_subtype(tfm); in create_authenc_wr()
2450 unsigned int authsize = crypto_aead_authsize(tfm); in create_authenc_wr()
2564 create_wreq(a_ctx(tfm), chcr_req, &req->base, reqctx->imm, size, in create_authenc_wr()
2581 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in chcr_aead_dma_map() local
2582 unsigned int authsize = crypto_aead_authsize(tfm); in chcr_aead_dma_map()
2642 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in chcr_aead_dma_unmap() local
2643 unsigned int authsize = crypto_aead_authsize(tfm); in chcr_aead_dma_unmap()
2709 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in chcr_add_aead_dst_ent() local
2711 unsigned int authsize = crypto_aead_authsize(tfm); in chcr_add_aead_dst_ent()
2712 struct chcr_context *ctx = a_ctx(tfm); in chcr_add_aead_dst_ent()
2755 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(wrparam->req); in chcr_add_cipher_dst_ent() local
2756 struct chcr_context *ctx = c_ctx(tfm); in chcr_add_cipher_dst_ent()
2937 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in ccm_format_packet() local
2938 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in ccm_format_packet()
2963 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in fill_sec_cpl_for_aead() local
2964 struct chcr_context *ctx = a_ctx(tfm); in fill_sec_cpl_for_aead()
2977 if (get_aead_subtype(tfm) == CRYPTO_ALG_SUB_TYPE_AEAD_RFC4309) in fill_sec_cpl_for_aead()
2987 if (crypto_aead_authsize(tfm) != req->cryptlen) in fill_sec_cpl_for_aead()
2988 tag_offset = crypto_aead_authsize(tfm); in fill_sec_cpl_for_aead()
3004 crypto_aead_authsize(tfm)); in fill_sec_cpl_for_aead()
3038 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in create_aead_ccm_wr() local
3039 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in create_aead_ccm_wr()
3048 unsigned int authsize = crypto_aead_authsize(tfm); in create_aead_ccm_wr()
3053 struct adapter *adap = padap(a_ctx(tfm)->dev); in create_aead_ccm_wr()
3055 sub_type = get_aead_subtype(tfm); in create_aead_ccm_wr()
3119 create_wreq(a_ctx(tfm), chcr_req, &req->base, reqctx->imm, 0, in create_aead_ccm_wr()
3135 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in create_gcm_wr() local
3136 struct chcr_context *ctx = a_ctx(tfm); in create_gcm_wr()
3146 unsigned int authsize = crypto_aead_authsize(tfm); in create_gcm_wr()
3155 if (get_aead_subtype(tfm) == CRYPTO_ALG_SUB_TYPE_AEAD_RFC4106) in create_gcm_wr()
3222 if (get_aead_subtype(tfm) == in create_gcm_wr()
3237 create_wreq(a_ctx(tfm), chcr_req, &req->base, reqctx->imm, size, in create_gcm_wr()
3249 static int chcr_aead_cra_init(struct crypto_aead *tfm) in chcr_aead_cra_init() argument
3251 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_aead_cra_init()
3252 struct aead_alg *alg = crypto_aead_alg(tfm); in chcr_aead_cra_init()
3260 tfm, max(sizeof(struct chcr_aead_reqctx), in chcr_aead_cra_init()
3263 return chcr_device_init(a_ctx(tfm)); in chcr_aead_cra_init()
3266 static void chcr_aead_cra_exit(struct crypto_aead *tfm) in chcr_aead_cra_exit() argument
3268 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_aead_cra_exit()
3273 static int chcr_authenc_null_setauthsize(struct crypto_aead *tfm, in chcr_authenc_null_setauthsize() argument
3276 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_authenc_null_setauthsize()
3282 static int chcr_authenc_setauthsize(struct crypto_aead *tfm, in chcr_authenc_setauthsize() argument
3285 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_authenc_setauthsize()
3286 u32 maxauth = crypto_aead_maxauthsize(tfm); in chcr_authenc_setauthsize()
3321 static int chcr_gcm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in chcr_gcm_setauthsize() argument
3323 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_gcm_setauthsize()
3357 static int chcr_4106_4309_setauthsize(struct crypto_aead *tfm, in chcr_4106_4309_setauthsize() argument
3360 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_4106_4309_setauthsize()
3381 static int chcr_ccm_setauthsize(struct crypto_aead *tfm, in chcr_ccm_setauthsize() argument
3384 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_ccm_setauthsize()
3617 shash->tfm = base_hash; in chcr_authenc_setkey()
3739 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in chcr_aead_op() local
3741 struct chcr_context *ctx = a_ctx(tfm); in chcr_aead_op()
3746 cdev = a_ctx(tfm)->dev; in chcr_aead_op()
3766 if (get_aead_subtype(tfm) == CRYPTO_ALG_SUB_TYPE_AEAD_RFC4106 && in chcr_aead_op()
3789 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in chcr_aead_encrypt() local
3791 struct chcr_context *ctx = a_ctx(tfm); in chcr_aead_encrypt()
3802 switch (get_aead_subtype(tfm)) { in chcr_aead_encrypt()
3818 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in chcr_aead_decrypt() local
3819 struct chcr_context *ctx = a_ctx(tfm); in chcr_aead_decrypt()
3831 size = crypto_aead_maxauthsize(tfm); in chcr_aead_decrypt()
3838 switch (get_aead_subtype(tfm)) { in chcr_aead_decrypt()