Lines Matching refs:cword
43 struct cword { struct
66 struct cword encrypt;
67 struct cword decrypt;
68 } cword; member
72 static DEFINE_PER_CPU(struct cword *, paes_last_cword);
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()
144 ctx->cword.encrypt.keygen = 1; in aes_set_key()
145 ctx->cword.decrypt.keygen = 1; in aes_set_key()
155 if (&ctx->cword.encrypt == per_cpu(paes_last_cword, cpu) || in aes_set_key()
156 &ctx->cword.decrypt == per_cpu(paes_last_cword, cpu)) in aes_set_key()
171 static inline void padlock_reset_key(struct cword *cword) in padlock_reset_key() argument
175 if (cword != per_cpu(paes_last_cword, cpu)) in padlock_reset_key()
183 static inline void padlock_store_cword(struct cword *cword) in padlock_store_cword() argument
185 per_cpu(paes_last_cword, raw_smp_processor_id()) = cword; in padlock_store_cword()
195 struct cword *control_word, int count) in rep_xcrypt_ecb()
203 u8 *iv, struct cword *control_word, int count) in rep_xcrypt_cbc()
212 struct cword *cword, int count) in ecb_crypt_copy() argument
222 rep_xcrypt_ecb(tmp, out, key, cword, count); in ecb_crypt_copy()
226 u8 *iv, struct cword *cword, int count) in cbc_crypt_copy() argument
236 return rep_xcrypt_cbc(tmp, out, key, iv, cword, count); in cbc_crypt_copy()
240 struct cword *cword, int count) in ecb_crypt() argument
246 ecb_crypt_copy(in, out, key, cword, count); in ecb_crypt()
250 rep_xcrypt_ecb(in, out, key, cword, count); in ecb_crypt()
254 u8 *iv, struct cword *cword, int count) in cbc_crypt() argument
258 return cbc_crypt_copy(in, out, key, iv, cword, count); in cbc_crypt()
260 return rep_xcrypt_cbc(in, out, key, iv, cword, count); in cbc_crypt()
310 padlock_reset_key(&ctx->cword.encrypt); in padlock_aes_encrypt()
311 ecb_crypt(in, out, ctx->E, &ctx->cword.encrypt, 1); in padlock_aes_encrypt()
312 padlock_store_cword(&ctx->cword.encrypt); in padlock_aes_encrypt()
319 padlock_reset_key(&ctx->cword.encrypt); in padlock_aes_decrypt()
320 ecb_crypt(in, out, ctx->D, &ctx->cword.decrypt, 1); in padlock_aes_decrypt()
321 padlock_store_cword(&ctx->cword.encrypt); in padlock_aes_decrypt()
352 padlock_reset_key(&ctx->cword.encrypt); in ecb_aes_encrypt()
358 ctx->E, &ctx->cword.encrypt, in ecb_aes_encrypt()
364 padlock_store_cword(&ctx->cword.encrypt); in ecb_aes_encrypt()
377 padlock_reset_key(&ctx->cword.decrypt); in ecb_aes_decrypt()
383 ctx->D, &ctx->cword.decrypt, in ecb_aes_decrypt()
389 padlock_store_cword(&ctx->cword.encrypt); in ecb_aes_decrypt()
417 padlock_reset_key(&ctx->cword.encrypt); in cbc_aes_encrypt()
424 walk.iv, &ctx->cword.encrypt, in cbc_aes_encrypt()
431 padlock_store_cword(&ctx->cword.decrypt); in cbc_aes_encrypt()
444 padlock_reset_key(&ctx->cword.encrypt); in cbc_aes_decrypt()
450 ctx->D, walk.iv, &ctx->cword.decrypt, in cbc_aes_decrypt()
456 padlock_store_cword(&ctx->cword.encrypt); in cbc_aes_decrypt()