Lines Matching refs:ctx

84 static inline struct aes_ctx *aes_ctx_common(void *ctx)  in aes_ctx_common()  argument
86 unsigned long addr = (unsigned long)ctx; in aes_ctx_common()
107 struct aes_ctx *ctx = aes_ctx(tfm); in aes_set_key() local
123 ctx->D = ctx->E; in aes_set_key()
125 ctx->E[0] = le32_to_cpu(key[0]); in aes_set_key()
126 ctx->E[1] = le32_to_cpu(key[1]); in aes_set_key()
127 ctx->E[2] = le32_to_cpu(key[2]); in aes_set_key()
128 ctx->E[3] = le32_to_cpu(key[3]); in aes_set_key()
131 memset(&ctx->cword, 0, sizeof(ctx->cword)); in aes_set_key()
133 ctx->cword.decrypt.encdec = 1; in aes_set_key()
134 ctx->cword.encrypt.rounds = 10 + (key_len - 16) / 4; in aes_set_key()
135 ctx->cword.decrypt.rounds = ctx->cword.encrypt.rounds; in aes_set_key()
136 ctx->cword.encrypt.ksize = (key_len - 16) / 8; in aes_set_key()
137 ctx->cword.decrypt.ksize = ctx->cword.encrypt.ksize; in aes_set_key()
143 ctx->D = ctx->d_data; in aes_set_key()
144 ctx->cword.encrypt.keygen = 1; in aes_set_key()
145 ctx->cword.decrypt.keygen = 1; in aes_set_key()
152 memcpy(ctx->E, gen_aes.key_enc, AES_MAX_KEYLENGTH); in aes_set_key()
153 memcpy(ctx->D, gen_aes.key_dec, AES_MAX_KEYLENGTH); in aes_set_key()
157 if (&ctx->cword.encrypt == per_cpu(paes_last_cword, cpu) || in aes_set_key()
158 &ctx->cword.decrypt == per_cpu(paes_last_cword, cpu)) in aes_set_key()
300 struct aes_ctx *ctx = aes_ctx(tfm); in aes_encrypt() local
303 padlock_reset_key(&ctx->cword.encrypt); in aes_encrypt()
305 ecb_crypt(in, out, ctx->E, &ctx->cword.encrypt, 1); in aes_encrypt()
307 padlock_store_cword(&ctx->cword.encrypt); in aes_encrypt()
312 struct aes_ctx *ctx = aes_ctx(tfm); in aes_decrypt() local
315 padlock_reset_key(&ctx->cword.encrypt); in aes_decrypt()
317 ecb_crypt(in, out, ctx->D, &ctx->cword.decrypt, 1); in aes_decrypt()
319 padlock_store_cword(&ctx->cword.encrypt); in aes_decrypt()
346 struct aes_ctx *ctx = blk_aes_ctx(desc->tfm); in ecb_aes_encrypt() local
351 padlock_reset_key(&ctx->cword.encrypt); in ecb_aes_encrypt()
359 ctx->E, &ctx->cword.encrypt, in ecb_aes_encrypt()
366 padlock_store_cword(&ctx->cword.encrypt); in ecb_aes_encrypt()
375 struct aes_ctx *ctx = blk_aes_ctx(desc->tfm); in ecb_aes_decrypt() local
380 padlock_reset_key(&ctx->cword.decrypt); in ecb_aes_decrypt()
388 ctx->D, &ctx->cword.decrypt, in ecb_aes_decrypt()
395 padlock_store_cword(&ctx->cword.encrypt); in ecb_aes_decrypt()
425 struct aes_ctx *ctx = blk_aes_ctx(desc->tfm); in cbc_aes_encrypt() local
430 padlock_reset_key(&ctx->cword.encrypt); in cbc_aes_encrypt()
438 walk.dst.virt.addr, ctx->E, in cbc_aes_encrypt()
439 walk.iv, &ctx->cword.encrypt, in cbc_aes_encrypt()
447 padlock_store_cword(&ctx->cword.decrypt); in cbc_aes_encrypt()
456 struct aes_ctx *ctx = blk_aes_ctx(desc->tfm); in cbc_aes_decrypt() local
461 padlock_reset_key(&ctx->cword.encrypt); in cbc_aes_decrypt()
469 ctx->D, walk.iv, &ctx->cword.decrypt, in cbc_aes_decrypt()
477 padlock_store_cword(&ctx->cword.encrypt); in cbc_aes_decrypt()