Lines Matching refs:aeadctx
100 return ctx->crypto_ctx->aeadctx; in AEAD_CTX()
2381 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_aead_common_init() local
2387 if (aeadctx->enckey_len == 0) in chcr_aead_common_init()
2425 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_aead_fallback() local
2428 aead_request_set_tfm(subreq, aeadctx->sw_cipher); in chcr_aead_fallback()
2445 struct chcr_aead_ctx *aeadctx = AEAD_CTX(ctx); in create_authenc_wr() local
2446 struct chcr_authenc_ctx *actx = AUTHENC_CTX(aeadctx); in create_authenc_wr()
2483 kctx_len = (KEY_CONTEXT_CTX_LEN_G(ntohl(aeadctx->key_ctx_hdr)) << 4) in create_authenc_wr()
2534 actx->auth_mode, aeadctx->hmac_ctrl, in create_authenc_wr()
2539 chcr_req->key_ctx.ctx_hdr = aeadctx->key_ctx_hdr; in create_authenc_wr()
2543 memcpy(chcr_req->key_ctx.key, aeadctx->key, in create_authenc_wr()
2544 aeadctx->enckey_len); in create_authenc_wr()
2547 aeadctx->enckey_len); in create_authenc_wr()
2549 memcpy(chcr_req->key_ctx.key + roundup(aeadctx->enckey_len, 16), in create_authenc_wr()
2550 actx->h_iopad, kctx_len - roundup(aeadctx->enckey_len, 16)); in create_authenc_wr()
2556 memcpy(ivptr, aeadctx->nonce, CTR_RFC3686_NONCE_SIZE); in create_authenc_wr()
2943 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in ccm_format_packet() local
2948 memcpy(ivptr + 1, &aeadctx->salt[0], 3); in ccm_format_packet()
2971 struct chcr_aead_ctx *aeadctx = AEAD_CTX(ctx); in fill_sec_cpl_for_aead() local
3013 aeadctx->hmac_ctrl, IV >> 1); in fill_sec_cpl_for_aead()
3021 struct chcr_aead_ctx *aeadctx, in aead_ccm_validate_input() argument
3044 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in create_aead_ccm_wr() local
3068 error = aead_ccm_validate_input(reqctx->op, req, aeadctx, sub_type); in create_aead_ccm_wr()
3079 kctx_len = roundup(aeadctx->enckey_len, 16) * 2; in create_aead_ccm_wr()
3106 chcr_req->key_ctx.ctx_hdr = aeadctx->key_ctx_hdr; in create_aead_ccm_wr()
3107 memcpy(chcr_req->key_ctx.key, aeadctx->key, aeadctx->enckey_len); in create_aead_ccm_wr()
3108 memcpy(chcr_req->key_ctx.key + roundup(aeadctx->enckey_len, 16), in create_aead_ccm_wr()
3109 aeadctx->key, aeadctx->enckey_len); in create_aead_ccm_wr()
3143 struct chcr_aead_ctx *aeadctx = AEAD_CTX(ctx); in create_gcm_wr() local
3174 kctx_len = roundup(aeadctx->enckey_len, 16) + AEAD_H_SIZE; in create_gcm_wr()
3215 aeadctx->hmac_ctrl, IV >> 1); in create_gcm_wr()
3218 chcr_req->key_ctx.ctx_hdr = aeadctx->key_ctx_hdr; in create_gcm_wr()
3219 memcpy(chcr_req->key_ctx.key, aeadctx->key, aeadctx->enckey_len); in create_gcm_wr()
3220 memcpy(chcr_req->key_ctx.key + roundup(aeadctx->enckey_len, 16), in create_gcm_wr()
3221 GCM_CTX(aeadctx)->ghash_h, AEAD_H_SIZE); in create_gcm_wr()
3229 memcpy(ivptr, aeadctx->salt, 4); in create_gcm_wr()
3256 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_aead_cra_init() local
3259 aeadctx->sw_cipher = crypto_alloc_aead(alg->base.cra_name, 0, in chcr_aead_cra_init()
3262 if (IS_ERR(aeadctx->sw_cipher)) in chcr_aead_cra_init()
3263 return PTR_ERR(aeadctx->sw_cipher); in chcr_aead_cra_init()
3266 crypto_aead_reqsize(aeadctx->sw_cipher))); in chcr_aead_cra_init()
3272 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_aead_cra_exit() local
3274 crypto_free_aead(aeadctx->sw_cipher); in chcr_aead_cra_exit()
3280 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_authenc_null_setauthsize() local
3282 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NOP; in chcr_authenc_null_setauthsize()
3283 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_null_setauthsize()
3284 return crypto_aead_setauthsize(aeadctx->sw_cipher, authsize); in chcr_authenc_null_setauthsize()
3289 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_authenc_setauthsize() local
3297 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL1; in chcr_authenc_setauthsize()
3298 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_setauthsize()
3300 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL2; in chcr_authenc_setauthsize()
3301 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_setauthsize()
3303 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_TRUNC_RFC4366; in chcr_authenc_setauthsize()
3304 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_setauthsize()
3306 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_IPSEC_96BIT; in chcr_authenc_setauthsize()
3307 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_setauthsize()
3309 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL3; in chcr_authenc_setauthsize()
3310 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_setauthsize()
3312 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_DIV2; in chcr_authenc_setauthsize()
3313 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_setauthsize()
3315 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; in chcr_authenc_setauthsize()
3316 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_setauthsize()
3318 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; in chcr_authenc_setauthsize()
3319 aeadctx->mayverify = VERIFY_SW; in chcr_authenc_setauthsize()
3321 return crypto_aead_setauthsize(aeadctx->sw_cipher, authsize); in chcr_authenc_setauthsize()
3327 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_gcm_setauthsize() local
3331 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL1; in chcr_gcm_setauthsize()
3332 aeadctx->mayverify = VERIFY_HW; in chcr_gcm_setauthsize()
3335 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_DIV2; in chcr_gcm_setauthsize()
3336 aeadctx->mayverify = VERIFY_HW; in chcr_gcm_setauthsize()
3339 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_IPSEC_96BIT; in chcr_gcm_setauthsize()
3340 aeadctx->mayverify = VERIFY_HW; in chcr_gcm_setauthsize()
3343 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL3; in chcr_gcm_setauthsize()
3344 aeadctx->mayverify = VERIFY_HW; in chcr_gcm_setauthsize()
3347 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; in chcr_gcm_setauthsize()
3348 aeadctx->mayverify = VERIFY_HW; in chcr_gcm_setauthsize()
3352 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; in chcr_gcm_setauthsize()
3353 aeadctx->mayverify = VERIFY_SW; in chcr_gcm_setauthsize()
3358 return crypto_aead_setauthsize(aeadctx->sw_cipher, authsize); in chcr_gcm_setauthsize()
3364 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_4106_4309_setauthsize() local
3368 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_DIV2; in chcr_4106_4309_setauthsize()
3369 aeadctx->mayverify = VERIFY_HW; in chcr_4106_4309_setauthsize()
3372 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_IPSEC_96BIT; in chcr_4106_4309_setauthsize()
3373 aeadctx->mayverify = VERIFY_HW; in chcr_4106_4309_setauthsize()
3376 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; in chcr_4106_4309_setauthsize()
3377 aeadctx->mayverify = VERIFY_HW; in chcr_4106_4309_setauthsize()
3382 return crypto_aead_setauthsize(aeadctx->sw_cipher, authsize); in chcr_4106_4309_setauthsize()
3388 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_ccm_setauthsize() local
3392 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL1; in chcr_ccm_setauthsize()
3393 aeadctx->mayverify = VERIFY_HW; in chcr_ccm_setauthsize()
3396 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL2; in chcr_ccm_setauthsize()
3397 aeadctx->mayverify = VERIFY_HW; in chcr_ccm_setauthsize()
3400 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_DIV2; in chcr_ccm_setauthsize()
3401 aeadctx->mayverify = VERIFY_HW; in chcr_ccm_setauthsize()
3404 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_TRUNC_RFC4366; in chcr_ccm_setauthsize()
3405 aeadctx->mayverify = VERIFY_HW; in chcr_ccm_setauthsize()
3408 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_IPSEC_96BIT; in chcr_ccm_setauthsize()
3409 aeadctx->mayverify = VERIFY_HW; in chcr_ccm_setauthsize()
3412 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL3; in chcr_ccm_setauthsize()
3413 aeadctx->mayverify = VERIFY_HW; in chcr_ccm_setauthsize()
3416 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; in chcr_ccm_setauthsize()
3417 aeadctx->mayverify = VERIFY_HW; in chcr_ccm_setauthsize()
3422 return crypto_aead_setauthsize(aeadctx->sw_cipher, authsize); in chcr_ccm_setauthsize()
3429 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(aead)); in chcr_ccm_common_setkey() local
3444 aeadctx->enckey_len = 0; in chcr_ccm_common_setkey()
3447 aeadctx->key_ctx_hdr = FILL_KEY_CTX_HDR(ck_size, mk_size, 0, 0, in chcr_ccm_common_setkey()
3449 memcpy(aeadctx->key, key, keylen); in chcr_ccm_common_setkey()
3450 aeadctx->enckey_len = keylen; in chcr_ccm_common_setkey()
3459 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(aead)); in chcr_aead_ccm_setkey() local
3462 crypto_aead_clear_flags(aeadctx->sw_cipher, CRYPTO_TFM_REQ_MASK); in chcr_aead_ccm_setkey()
3463 crypto_aead_set_flags(aeadctx->sw_cipher, crypto_aead_get_flags(aead) & in chcr_aead_ccm_setkey()
3465 error = crypto_aead_setkey(aeadctx->sw_cipher, key, keylen); in chcr_aead_ccm_setkey()
3474 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(aead)); in chcr_aead_rfc4309_setkey() local
3478 aeadctx->enckey_len = 0; in chcr_aead_rfc4309_setkey()
3481 crypto_aead_clear_flags(aeadctx->sw_cipher, CRYPTO_TFM_REQ_MASK); in chcr_aead_rfc4309_setkey()
3482 crypto_aead_set_flags(aeadctx->sw_cipher, crypto_aead_get_flags(aead) & in chcr_aead_rfc4309_setkey()
3484 error = crypto_aead_setkey(aeadctx->sw_cipher, key, keylen); in chcr_aead_rfc4309_setkey()
3488 memcpy(aeadctx->salt, key + keylen, 3); in chcr_aead_rfc4309_setkey()
3495 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(aead)); in chcr_gcm_setkey() local
3496 struct chcr_gcm_ctx *gctx = GCM_CTX(aeadctx); in chcr_gcm_setkey()
3501 aeadctx->enckey_len = 0; in chcr_gcm_setkey()
3502 crypto_aead_clear_flags(aeadctx->sw_cipher, CRYPTO_TFM_REQ_MASK); in chcr_gcm_setkey()
3503 crypto_aead_set_flags(aeadctx->sw_cipher, crypto_aead_get_flags(aead) in chcr_gcm_setkey()
3505 ret = crypto_aead_setkey(aeadctx->sw_cipher, key, keylen); in chcr_gcm_setkey()
3512 memcpy(aeadctx->salt, key + keylen, 4); in chcr_gcm_setkey()
3526 memcpy(aeadctx->key, key, keylen); in chcr_gcm_setkey()
3527 aeadctx->enckey_len = keylen; in chcr_gcm_setkey()
3530 aeadctx->key_ctx_hdr = FILL_KEY_CTX_HDR(ck_size, in chcr_gcm_setkey()
3539 aeadctx->enckey_len = 0; in chcr_gcm_setkey()
3553 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(authenc)); in chcr_authenc_setkey() local
3554 struct chcr_authenc_ctx *actx = AUTHENC_CTX(aeadctx); in chcr_authenc_setkey()
3567 crypto_aead_clear_flags(aeadctx->sw_cipher, CRYPTO_TFM_REQ_MASK); in chcr_authenc_setkey()
3568 crypto_aead_set_flags(aeadctx->sw_cipher, crypto_aead_get_flags(authenc) in chcr_authenc_setkey()
3570 err = crypto_aead_setkey(aeadctx->sw_cipher, key, keylen); in chcr_authenc_setkey()
3586 memcpy(aeadctx->nonce, keys.enckey + (keys.enckeylen in chcr_authenc_setkey()
3605 memcpy(aeadctx->key, keys.enckey, keys.enckeylen); in chcr_authenc_setkey()
3606 aeadctx->enckey_len = keys.enckeylen; in chcr_authenc_setkey()
3610 get_aes_decrypt_key(actx->dec_rrkey, aeadctx->key, in chcr_authenc_setkey()
3611 aeadctx->enckey_len << 3); in chcr_authenc_setkey()
3662 aeadctx->key_ctx_hdr = FILL_KEY_CTX_HDR(ck_size, param.mk_size, in chcr_authenc_setkey()
3671 aeadctx->enckey_len = 0; in chcr_authenc_setkey()
3681 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(authenc)); in chcr_aead_digest_null_setkey() local
3682 struct chcr_authenc_ctx *actx = AUTHENC_CTX(aeadctx); in chcr_aead_digest_null_setkey()
3690 crypto_aead_clear_flags(aeadctx->sw_cipher, CRYPTO_TFM_REQ_MASK); in chcr_aead_digest_null_setkey()
3691 crypto_aead_set_flags(aeadctx->sw_cipher, crypto_aead_get_flags(authenc) in chcr_aead_digest_null_setkey()
3693 err = crypto_aead_setkey(aeadctx->sw_cipher, key, keylen); in chcr_aead_digest_null_setkey()
3705 memcpy(aeadctx->nonce, keys.enckey + (keys.enckeylen in chcr_aead_digest_null_setkey()
3719 memcpy(aeadctx->key, keys.enckey, keys.enckeylen); in chcr_aead_digest_null_setkey()
3720 aeadctx->enckey_len = keys.enckeylen; in chcr_aead_digest_null_setkey()
3723 get_aes_decrypt_key(actx->dec_rrkey, aeadctx->key, in chcr_aead_digest_null_setkey()
3724 aeadctx->enckey_len << 3); in chcr_aead_digest_null_setkey()
3728 aeadctx->key_ctx_hdr = FILL_KEY_CTX_HDR(ck_size, CHCR_KEYCTX_NO_KEY, 0, in chcr_aead_digest_null_setkey()
3734 aeadctx->enckey_len = 0; in chcr_aead_digest_null_setkey()
3824 struct chcr_aead_ctx *aeadctx = AEAD_CTX(ctx); in chcr_aead_decrypt() local
3834 if (aeadctx->mayverify == VERIFY_SW) { in chcr_aead_decrypt()