Lines Matching refs:u
72 if (!ctx->u.aes.key_len) in ccp_do_cmac_update()
156 cmac_key_sg = (need_pad) ? &ctx->u.aes.k2_sg in ccp_do_cmac_update()
157 : &ctx->u.aes.k1_sg; in ccp_do_cmac_update()
162 rctx->cmd.u.aes.type = ctx->u.aes.type; in ccp_do_cmac_update()
163 rctx->cmd.u.aes.mode = ctx->u.aes.mode; in ccp_do_cmac_update()
164 rctx->cmd.u.aes.action = CCP_AES_ACTION_ENCRYPT; in ccp_do_cmac_update()
165 rctx->cmd.u.aes.key = &ctx->u.aes.key_sg; in ccp_do_cmac_update()
166 rctx->cmd.u.aes.key_len = ctx->u.aes.key_len; in ccp_do_cmac_update()
167 rctx->cmd.u.aes.iv = &rctx->iv_sg; in ccp_do_cmac_update()
168 rctx->cmd.u.aes.iv_len = AES_BLOCK_SIZE; in ccp_do_cmac_update()
169 rctx->cmd.u.aes.src = sg; in ccp_do_cmac_update()
170 rctx->cmd.u.aes.src_len = rctx->hash_cnt; in ccp_do_cmac_update()
171 rctx->cmd.u.aes.dst = NULL; in ccp_do_cmac_update()
172 rctx->cmd.u.aes.cmac_key = cmac_key_sg; in ccp_do_cmac_update()
173 rctx->cmd.u.aes.cmac_key_len = ctx->u.aes.kn_len; in ccp_do_cmac_update()
174 rctx->cmd.u.aes.cmac_final = final; in ccp_do_cmac_update()
272 ctx->u.aes.type = CCP_AES_TYPE_128; in ccp_aes_cmac_setkey()
275 ctx->u.aes.type = CCP_AES_TYPE_192; in ccp_aes_cmac_setkey()
278 ctx->u.aes.type = CCP_AES_TYPE_256; in ccp_aes_cmac_setkey()
284 ctx->u.aes.mode = alg->mode; in ccp_aes_cmac_setkey()
287 ctx->u.aes.key_len = 0; in ccp_aes_cmac_setkey()
290 ret = crypto_cipher_setkey(ctx->u.aes.tfm_cipher, key, key_len); in ccp_aes_cmac_setkey()
295 memset(ctx->u.aes.key, 0, sizeof(ctx->u.aes.key)); in ccp_aes_cmac_setkey()
296 crypto_cipher_encrypt_one(ctx->u.aes.tfm_cipher, ctx->u.aes.key, in ccp_aes_cmac_setkey()
297 ctx->u.aes.key); in ccp_aes_cmac_setkey()
300 k0_hi = be64_to_cpu(*((__be64 *)ctx->u.aes.key)); in ccp_aes_cmac_setkey()
301 k0_lo = be64_to_cpu(*((__be64 *)ctx->u.aes.key + 1)); in ccp_aes_cmac_setkey()
305 if (ctx->u.aes.key[0] & 0x80) { in ccp_aes_cmac_setkey()
309 gk = (__be64 *)ctx->u.aes.k1; in ccp_aes_cmac_setkey()
316 if (ctx->u.aes.k1[0] & 0x80) { in ccp_aes_cmac_setkey()
320 gk = (__be64 *)ctx->u.aes.k2; in ccp_aes_cmac_setkey()
325 ctx->u.aes.kn_len = sizeof(ctx->u.aes.k1); in ccp_aes_cmac_setkey()
326 sg_init_one(&ctx->u.aes.k1_sg, ctx->u.aes.k1, sizeof(ctx->u.aes.k1)); in ccp_aes_cmac_setkey()
327 sg_init_one(&ctx->u.aes.k2_sg, ctx->u.aes.k2, sizeof(ctx->u.aes.k2)); in ccp_aes_cmac_setkey()
330 memset(ctx->u.aes.key, 0, sizeof(ctx->u.aes.key)); in ccp_aes_cmac_setkey()
331 memcpy(ctx->u.aes.key, key, key_len); in ccp_aes_cmac_setkey()
332 ctx->u.aes.key_len = key_len; in ccp_aes_cmac_setkey()
333 sg_init_one(&ctx->u.aes.key_sg, ctx->u.aes.key, key_len); in ccp_aes_cmac_setkey()
345 ctx->u.aes.key_len = 0; in ccp_aes_cmac_cra_init()
356 ctx->u.aes.tfm_cipher = cipher_tfm; in ccp_aes_cmac_cra_init()
365 if (ctx->u.aes.tfm_cipher) in ccp_aes_cmac_cra_exit()
366 crypto_free_cipher(ctx->u.aes.tfm_cipher); in ccp_aes_cmac_cra_exit()
367 ctx->u.aes.tfm_cipher = NULL; in ccp_aes_cmac_cra_exit()