Lines Matching refs:aeadctx

101 	return ctx->crypto_ctx->aeadctx;  in AEAD_CTX()
2265 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_aead_common_init() local
2271 if (aeadctx->enckey_len == 0) in chcr_aead_common_init()
2309 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_aead_fallback() local
2312 aead_request_set_tfm(subreq, aeadctx->sw_cipher); in chcr_aead_fallback()
2327 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in create_authenc_wr() local
2328 struct chcr_authenc_ctx *actx = AUTHENC_CTX(aeadctx); in create_authenc_wr()
2363 kctx_len = (ntohl(KEY_CONTEXT_CTX_LEN_V(aeadctx->key_ctx_hdr)) << 4) in create_authenc_wr()
2414 actx->auth_mode, aeadctx->hmac_ctrl, in create_authenc_wr()
2419 chcr_req->key_ctx.ctx_hdr = aeadctx->key_ctx_hdr; in create_authenc_wr()
2423 memcpy(chcr_req->key_ctx.key, aeadctx->key, in create_authenc_wr()
2424 aeadctx->enckey_len); in create_authenc_wr()
2427 aeadctx->enckey_len); in create_authenc_wr()
2429 memcpy(chcr_req->key_ctx.key + roundup(aeadctx->enckey_len, 16), in create_authenc_wr()
2430 actx->h_iopad, kctx_len - roundup(aeadctx->enckey_len, 16)); in create_authenc_wr()
2436 memcpy(ivptr, aeadctx->nonce, CTR_RFC3686_NONCE_SIZE); in create_authenc_wr()
2789 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in ccm_format_packet() local
2794 memcpy(ivptr + 1, &aeadctx->salt[0], 3); in ccm_format_packet()
2816 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in fill_sec_cpl_for_aead() local
2857 aeadctx->hmac_ctrl, IV >> 1); in fill_sec_cpl_for_aead()
2865 struct chcr_aead_ctx *aeadctx, in aead_ccm_validate_input() argument
2888 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in create_aead_ccm_wr() local
2912 error = aead_ccm_validate_input(reqctx->op, req, aeadctx, sub_type); in create_aead_ccm_wr()
2923 kctx_len = roundup(aeadctx->enckey_len, 16) * 2; in create_aead_ccm_wr()
2950 chcr_req->key_ctx.ctx_hdr = aeadctx->key_ctx_hdr; in create_aead_ccm_wr()
2951 memcpy(chcr_req->key_ctx.key, aeadctx->key, aeadctx->enckey_len); in create_aead_ccm_wr()
2952 memcpy(chcr_req->key_ctx.key + roundup(aeadctx->enckey_len, 16), in create_aead_ccm_wr()
2953 aeadctx->key, aeadctx->enckey_len); in create_aead_ccm_wr()
2985 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in create_gcm_wr() local
3014 kctx_len = roundup(aeadctx->enckey_len, 16) + AEAD_H_SIZE; in create_gcm_wr()
3055 aeadctx->hmac_ctrl, IV >> 1); in create_gcm_wr()
3058 chcr_req->key_ctx.ctx_hdr = aeadctx->key_ctx_hdr; in create_gcm_wr()
3059 memcpy(chcr_req->key_ctx.key, aeadctx->key, aeadctx->enckey_len); in create_gcm_wr()
3060 memcpy(chcr_req->key_ctx.key + roundup(aeadctx->enckey_len, 16), in create_gcm_wr()
3061 GCM_CTX(aeadctx)->ghash_h, AEAD_H_SIZE); in create_gcm_wr()
3069 memcpy(ivptr, aeadctx->salt, 4); in create_gcm_wr()
3097 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_aead_cra_init() local
3100 aeadctx->sw_cipher = crypto_alloc_aead(alg->base.cra_name, 0, in chcr_aead_cra_init()
3103 if (IS_ERR(aeadctx->sw_cipher)) in chcr_aead_cra_init()
3104 return PTR_ERR(aeadctx->sw_cipher); in chcr_aead_cra_init()
3107 crypto_aead_reqsize(aeadctx->sw_cipher))); in chcr_aead_cra_init()
3113 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_aead_cra_exit() local
3115 crypto_free_aead(aeadctx->sw_cipher); in chcr_aead_cra_exit()
3121 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_authenc_null_setauthsize() local
3123 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NOP; in chcr_authenc_null_setauthsize()
3124 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_null_setauthsize()
3125 return crypto_aead_setauthsize(aeadctx->sw_cipher, authsize); in chcr_authenc_null_setauthsize()
3130 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_authenc_setauthsize() local
3138 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL1; in chcr_authenc_setauthsize()
3139 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_setauthsize()
3141 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL2; in chcr_authenc_setauthsize()
3142 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_setauthsize()
3144 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_TRUNC_RFC4366; in chcr_authenc_setauthsize()
3145 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_setauthsize()
3147 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_IPSEC_96BIT; in chcr_authenc_setauthsize()
3148 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_setauthsize()
3150 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL3; in chcr_authenc_setauthsize()
3151 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_setauthsize()
3153 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_DIV2; in chcr_authenc_setauthsize()
3154 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_setauthsize()
3156 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; in chcr_authenc_setauthsize()
3157 aeadctx->mayverify = VERIFY_HW; in chcr_authenc_setauthsize()
3159 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; in chcr_authenc_setauthsize()
3160 aeadctx->mayverify = VERIFY_SW; in chcr_authenc_setauthsize()
3162 return crypto_aead_setauthsize(aeadctx->sw_cipher, authsize); in chcr_authenc_setauthsize()
3168 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_gcm_setauthsize() local
3172 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL1; in chcr_gcm_setauthsize()
3173 aeadctx->mayverify = VERIFY_HW; in chcr_gcm_setauthsize()
3176 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_DIV2; in chcr_gcm_setauthsize()
3177 aeadctx->mayverify = VERIFY_HW; in chcr_gcm_setauthsize()
3180 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_IPSEC_96BIT; in chcr_gcm_setauthsize()
3181 aeadctx->mayverify = VERIFY_HW; in chcr_gcm_setauthsize()
3184 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL3; in chcr_gcm_setauthsize()
3185 aeadctx->mayverify = VERIFY_HW; in chcr_gcm_setauthsize()
3188 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; in chcr_gcm_setauthsize()
3189 aeadctx->mayverify = VERIFY_HW; in chcr_gcm_setauthsize()
3193 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; in chcr_gcm_setauthsize()
3194 aeadctx->mayverify = VERIFY_SW; in chcr_gcm_setauthsize()
3202 return crypto_aead_setauthsize(aeadctx->sw_cipher, authsize); in chcr_gcm_setauthsize()
3208 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_4106_4309_setauthsize() local
3212 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_DIV2; in chcr_4106_4309_setauthsize()
3213 aeadctx->mayverify = VERIFY_HW; in chcr_4106_4309_setauthsize()
3216 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_IPSEC_96BIT; in chcr_4106_4309_setauthsize()
3217 aeadctx->mayverify = VERIFY_HW; in chcr_4106_4309_setauthsize()
3220 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; in chcr_4106_4309_setauthsize()
3221 aeadctx->mayverify = VERIFY_HW; in chcr_4106_4309_setauthsize()
3228 return crypto_aead_setauthsize(aeadctx->sw_cipher, authsize); in chcr_4106_4309_setauthsize()
3234 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_ccm_setauthsize() local
3238 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL1; in chcr_ccm_setauthsize()
3239 aeadctx->mayverify = VERIFY_HW; in chcr_ccm_setauthsize()
3242 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL2; in chcr_ccm_setauthsize()
3243 aeadctx->mayverify = VERIFY_HW; in chcr_ccm_setauthsize()
3246 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_DIV2; in chcr_ccm_setauthsize()
3247 aeadctx->mayverify = VERIFY_HW; in chcr_ccm_setauthsize()
3250 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_TRUNC_RFC4366; in chcr_ccm_setauthsize()
3251 aeadctx->mayverify = VERIFY_HW; in chcr_ccm_setauthsize()
3254 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_IPSEC_96BIT; in chcr_ccm_setauthsize()
3255 aeadctx->mayverify = VERIFY_HW; in chcr_ccm_setauthsize()
3258 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_PL3; in chcr_ccm_setauthsize()
3259 aeadctx->mayverify = VERIFY_HW; in chcr_ccm_setauthsize()
3262 aeadctx->hmac_ctrl = CHCR_SCMD_HMAC_CTRL_NO_TRUNC; in chcr_ccm_setauthsize()
3263 aeadctx->mayverify = VERIFY_HW; in chcr_ccm_setauthsize()
3270 return crypto_aead_setauthsize(aeadctx->sw_cipher, authsize); in chcr_ccm_setauthsize()
3277 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(aead)); in chcr_ccm_common_setkey() local
3294 aeadctx->enckey_len = 0; in chcr_ccm_common_setkey()
3297 aeadctx->key_ctx_hdr = FILL_KEY_CTX_HDR(ck_size, mk_size, 0, 0, in chcr_ccm_common_setkey()
3299 memcpy(aeadctx->key, key, keylen); in chcr_ccm_common_setkey()
3300 aeadctx->enckey_len = keylen; in chcr_ccm_common_setkey()
3309 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(aead)); in chcr_aead_ccm_setkey() local
3312 crypto_aead_clear_flags(aeadctx->sw_cipher, CRYPTO_TFM_REQ_MASK); in chcr_aead_ccm_setkey()
3313 crypto_aead_set_flags(aeadctx->sw_cipher, crypto_aead_get_flags(aead) & in chcr_aead_ccm_setkey()
3315 error = crypto_aead_setkey(aeadctx->sw_cipher, key, keylen); in chcr_aead_ccm_setkey()
3317 crypto_aead_set_flags(aead, crypto_aead_get_flags(aeadctx->sw_cipher) & in chcr_aead_ccm_setkey()
3327 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(aead)); in chcr_aead_rfc4309_setkey() local
3333 aeadctx->enckey_len = 0; in chcr_aead_rfc4309_setkey()
3336 crypto_aead_clear_flags(aeadctx->sw_cipher, CRYPTO_TFM_REQ_MASK); in chcr_aead_rfc4309_setkey()
3337 crypto_aead_set_flags(aeadctx->sw_cipher, crypto_aead_get_flags(aead) & in chcr_aead_rfc4309_setkey()
3339 error = crypto_aead_setkey(aeadctx->sw_cipher, key, keylen); in chcr_aead_rfc4309_setkey()
3341 crypto_aead_set_flags(aead, crypto_aead_get_flags(aeadctx->sw_cipher) & in chcr_aead_rfc4309_setkey()
3346 memcpy(aeadctx->salt, key + keylen, 3); in chcr_aead_rfc4309_setkey()
3353 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(aead)); in chcr_gcm_setkey() local
3354 struct chcr_gcm_ctx *gctx = GCM_CTX(aeadctx); in chcr_gcm_setkey()
3359 aeadctx->enckey_len = 0; in chcr_gcm_setkey()
3360 crypto_aead_clear_flags(aeadctx->sw_cipher, CRYPTO_TFM_REQ_MASK); in chcr_gcm_setkey()
3361 crypto_aead_set_flags(aeadctx->sw_cipher, crypto_aead_get_flags(aead) in chcr_gcm_setkey()
3363 ret = crypto_aead_setkey(aeadctx->sw_cipher, key, keylen); in chcr_gcm_setkey()
3365 crypto_aead_set_flags(aead, crypto_aead_get_flags(aeadctx->sw_cipher) & in chcr_gcm_setkey()
3373 memcpy(aeadctx->salt, key + keylen, 4); in chcr_gcm_setkey()
3389 memcpy(aeadctx->key, key, keylen); in chcr_gcm_setkey()
3390 aeadctx->enckey_len = keylen; in chcr_gcm_setkey()
3393 aeadctx->key_ctx_hdr = FILL_KEY_CTX_HDR(ck_size, in chcr_gcm_setkey()
3402 aeadctx->enckey_len = 0; in chcr_gcm_setkey()
3416 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(authenc)); in chcr_authenc_setkey() local
3417 struct chcr_authenc_ctx *actx = AUTHENC_CTX(aeadctx); in chcr_authenc_setkey()
3430 crypto_aead_clear_flags(aeadctx->sw_cipher, CRYPTO_TFM_REQ_MASK); in chcr_authenc_setkey()
3431 crypto_aead_set_flags(aeadctx->sw_cipher, crypto_aead_get_flags(authenc) in chcr_authenc_setkey()
3433 err = crypto_aead_setkey(aeadctx->sw_cipher, key, keylen); in chcr_authenc_setkey()
3435 crypto_aead_set_flags(authenc, crypto_aead_get_flags(aeadctx->sw_cipher) in chcr_authenc_setkey()
3454 memcpy(aeadctx->nonce, keys.enckey + (keys.enckeylen in chcr_authenc_setkey()
3473 memcpy(aeadctx->key, keys.enckey, keys.enckeylen); in chcr_authenc_setkey()
3474 aeadctx->enckey_len = keys.enckeylen; in chcr_authenc_setkey()
3478 get_aes_decrypt_key(actx->dec_rrkey, aeadctx->key, in chcr_authenc_setkey()
3479 aeadctx->enckey_len << 3); in chcr_authenc_setkey()
3484 aeadctx->enckey_len = 0; in chcr_authenc_setkey()
3532 aeadctx->key_ctx_hdr = FILL_KEY_CTX_HDR(ck_size, param.mk_size, in chcr_authenc_setkey()
3541 aeadctx->enckey_len = 0; in chcr_authenc_setkey()
3551 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(authenc)); in chcr_aead_digest_null_setkey() local
3552 struct chcr_authenc_ctx *actx = AUTHENC_CTX(aeadctx); in chcr_aead_digest_null_setkey()
3560 crypto_aead_clear_flags(aeadctx->sw_cipher, CRYPTO_TFM_REQ_MASK); in chcr_aead_digest_null_setkey()
3561 crypto_aead_set_flags(aeadctx->sw_cipher, crypto_aead_get_flags(authenc) in chcr_aead_digest_null_setkey()
3563 err = crypto_aead_setkey(aeadctx->sw_cipher, key, keylen); in chcr_aead_digest_null_setkey()
3565 crypto_aead_set_flags(authenc, crypto_aead_get_flags(aeadctx->sw_cipher) in chcr_aead_digest_null_setkey()
3579 memcpy(aeadctx->nonce, keys.enckey + (keys.enckeylen in chcr_aead_digest_null_setkey()
3593 memcpy(aeadctx->key, keys.enckey, keys.enckeylen); in chcr_aead_digest_null_setkey()
3594 aeadctx->enckey_len = keys.enckeylen; in chcr_aead_digest_null_setkey()
3597 get_aes_decrypt_key(actx->dec_rrkey, aeadctx->key, in chcr_aead_digest_null_setkey()
3598 aeadctx->enckey_len << 3); in chcr_aead_digest_null_setkey()
3602 aeadctx->key_ctx_hdr = FILL_KEY_CTX_HDR(ck_size, CHCR_KEYCTX_NO_KEY, 0, in chcr_aead_digest_null_setkey()
3608 aeadctx->enckey_len = 0; in chcr_aead_digest_null_setkey()
3686 struct chcr_aead_ctx *aeadctx = AEAD_CTX(a_ctx(tfm)); in chcr_aead_decrypt() local
3690 if (aeadctx->mayverify == VERIFY_SW) { in chcr_aead_decrypt()