Lines Matching refs:blkcipher
191 struct ccr_session_blkcipher blkcipher; member
627 if (s->blkcipher.key_len == 0 || crp->crp_payload_length == 0) in ccr_blkcipher()
629 if (s->blkcipher.cipher_mode == SCMD_CIPH_MODE_AES_CBC && in ccr_blkcipher()
657 kctx_len = roundup2(s->blkcipher.key_len, 16); in ccr_blkcipher()
661 if (s->blkcipher.cipher_mode == SCMD_CIPH_MODE_AES_XTS) in ccr_blkcipher()
664 iv_len = s->blkcipher.iv_len; in ccr_blkcipher()
696 memset(iv + s->blkcipher.iv_len, 0, iv_len - s->blkcipher.iv_len); in ccr_blkcipher()
721 V_SCMD_CIPH_MODE(s->blkcipher.cipher_mode) | in ccr_blkcipher()
731 crwr->key_ctx.ctx_hdr = s->blkcipher.key_ctx_hdr; in ccr_blkcipher()
732 switch (s->blkcipher.cipher_mode) { in ccr_blkcipher()
735 memcpy(crwr->key_ctx.key, s->blkcipher.enckey, in ccr_blkcipher()
736 s->blkcipher.key_len); in ccr_blkcipher()
738 memcpy(crwr->key_ctx.key, s->blkcipher.deckey, in ccr_blkcipher()
739 s->blkcipher.key_len); in ccr_blkcipher()
742 memcpy(crwr->key_ctx.key, s->blkcipher.enckey, in ccr_blkcipher()
743 s->blkcipher.key_len); in ccr_blkcipher()
746 key_half = s->blkcipher.key_len / 2; in ccr_blkcipher()
747 memcpy(crwr->key_ctx.key, s->blkcipher.enckey + key_half, in ccr_blkcipher()
751 s->blkcipher.enckey, key_half); in ccr_blkcipher()
754 s->blkcipher.deckey, key_half); in ccr_blkcipher()
828 if (s->blkcipher.key_len == 0 || crp->crp_payload_length == 0) in ccr_eta()
830 if (s->blkcipher.cipher_mode == SCMD_CIPH_MODE_AES_CBC && in ccr_eta()
835 if (s->blkcipher.cipher_mode == SCMD_CIPH_MODE_AES_XTS) in ccr_eta()
838 iv_len = s->blkcipher.iv_len; in ccr_eta()
903 kctx_len = roundup2(s->blkcipher.key_len, 16) + iopad_size * 2; in ccr_eta()
997 memset(iv + s->blkcipher.iv_len, 0, iv_len - s->blkcipher.iv_len); in ccr_eta()
1029 V_SCMD_CIPH_MODE(s->blkcipher.cipher_mode) | in ccr_eta()
1039 crwr->key_ctx.ctx_hdr = s->blkcipher.key_ctx_hdr; in ccr_eta()
1040 switch (s->blkcipher.cipher_mode) { in ccr_eta()
1043 memcpy(crwr->key_ctx.key, s->blkcipher.enckey, in ccr_eta()
1044 s->blkcipher.key_len); in ccr_eta()
1046 memcpy(crwr->key_ctx.key, s->blkcipher.deckey, in ccr_eta()
1047 s->blkcipher.key_len); in ccr_eta()
1050 memcpy(crwr->key_ctx.key, s->blkcipher.enckey, in ccr_eta()
1051 s->blkcipher.key_len); in ccr_eta()
1054 key_half = s->blkcipher.key_len / 2; in ccr_eta()
1055 memcpy(crwr->key_ctx.key, s->blkcipher.enckey + key_half, in ccr_eta()
1059 s->blkcipher.enckey, key_half); in ccr_eta()
1062 s->blkcipher.deckey, key_half); in ccr_eta()
1066 dst = crwr->key_ctx.key + roundup2(s->blkcipher.key_len, 16); in ccr_eta()
1126 if (s->blkcipher.key_len == 0) in ccr_gcm()
1203 kctx_len = roundup2(s->blkcipher.key_len, 16) + GMAC_BLOCK_LEN; in ccr_gcm()
1335 crwr->key_ctx.ctx_hdr = s->blkcipher.key_ctx_hdr; in ccr_gcm()
1336 memcpy(crwr->key_ctx.key, s->blkcipher.enckey, s->blkcipher.key_len); in ccr_gcm()
1337 dst = crwr->key_ctx.key + roundup2(s->blkcipher.key_len, 16); in ccr_gcm()
1402 switch (s->blkcipher.key_len) { in ccr_gcm_soft()
1422 axf->Setkey(auth_ctx, s->blkcipher.enckey, s->blkcipher.key_len); in ccr_gcm_soft()
1431 error = exf->setkey(kschedule, s->blkcipher.enckey, in ccr_gcm_soft()
1432 s->blkcipher.key_len); in ccr_gcm_soft()
1603 if (s->blkcipher.key_len == 0) in ccr_ccm()
1698 kctx_len = roundup2(s->blkcipher.key_len, 16) * 2; in ccr_ccm()
1827 crwr->key_ctx.ctx_hdr = s->blkcipher.key_ctx_hdr; in ccr_ccm()
1828 memcpy(crwr->key_ctx.key, s->blkcipher.enckey, s->blkcipher.key_len); in ccr_ccm()
1829 memcpy(crwr->key_ctx.key + roundup(s->blkcipher.key_len, 16), in ccr_ccm()
1830 s->blkcipher.enckey, s->blkcipher.key_len); in ccr_ccm()
1976 switch (s->blkcipher.key_len) { in ccr_ccm_soft()
1996 axf->Setkey(auth_ctx, s->blkcipher.enckey, s->blkcipher.key_len); in ccr_ccm_soft()
2005 error = exf->setkey(kschedule, s->blkcipher.enckey, in ccr_ccm_soft()
2006 s->blkcipher.key_len); in ccr_ccm_soft()
2388 if (s->blkcipher.cipher_mode == SCMD_CIPH_MODE_AES_XTS) in ccr_aes_setkey()
2406 s->blkcipher.key_len = klen; in ccr_aes_setkey()
2407 memcpy(s->blkcipher.enckey, key, s->blkcipher.key_len); in ccr_aes_setkey()
2408 switch (s->blkcipher.cipher_mode) { in ccr_aes_setkey()
2411 t4_aes_getdeckey(s->blkcipher.deckey, key, kbits); in ccr_aes_setkey()
2415 kctx_len = roundup2(s->blkcipher.key_len, 16); in ccr_aes_setkey()
2451 s->blkcipher.key_ctx_hdr = htobe32(V_KEY_CONTEXT_CTX_LEN(kctx_flits) | in ccr_aes_setkey()
2452 V_KEY_CONTEXT_DUAL_CK(s->blkcipher.cipher_mode == in ccr_aes_setkey()
2787 s->blkcipher.cipher_mode = cipher_mode; in ccr_newsession()
2788 s->blkcipher.iv_len = csp->csp_ivlen; in ccr_newsession()