Lines Matching refs:cword
39 struct cword {
51 * and cword aligned on 16 Bytes boundaries and
62 struct cword encrypt;
63 struct cword decrypt;
64 } cword;
68 static DEFINE_PER_CPU(struct cword *, paes_last_cword);
130 memset(&ctx->cword, 0, sizeof(ctx->cword));
132 ctx->cword.decrypt.encdec = 1;
133 ctx->cword.encrypt.rounds = 10 + (key_len - 16) / 4;
134 ctx->cword.decrypt.rounds = ctx->cword.encrypt.rounds;
135 ctx->cword.encrypt.ksize = (key_len - 16) / 8;
136 ctx->cword.decrypt.ksize = ctx->cword.encrypt.ksize;
143 ctx->cword.encrypt.keygen = 1;
144 ctx->cword.decrypt.keygen = 1;
156 if (&ctx->cword.encrypt == per_cpu(paes_last_cword, cpu) ||
157 &ctx->cword.decrypt == per_cpu(paes_last_cword, cpu))
166 static inline void padlock_reset_key(struct cword *cword)
170 if (cword != per_cpu(paes_last_cword, cpu))
178 static inline void padlock_store_cword(struct cword *cword)
180 per_cpu(paes_last_cword, raw_smp_processor_id()) = cword;
190 struct cword *control_word, int count)
198 u8 *iv, struct cword *control_word, int count)
207 struct cword *cword, int count)
217 rep_xcrypt_ecb(tmp, out, key, cword, count);
221 u8 *iv, struct cword *cword, int count)
231 return rep_xcrypt_cbc(tmp, out, key, iv, cword, count);
235 struct cword *cword, int count)
241 ecb_crypt_copy(in, out, key, cword, count);
245 rep_xcrypt_ecb(in, out, key, cword, count);
249 u8 *iv, struct cword *cword, int count)
253 return cbc_crypt_copy(in, out, key, iv, cword, count);
255 return rep_xcrypt_cbc(in, out, key, iv, cword, count);
302 padlock_reset_key(&ctx->cword.encrypt);
304 ecb_crypt(in, out, ctx->E, &ctx->cword.encrypt, 1);
306 padlock_store_cword(&ctx->cword.encrypt);
314 padlock_reset_key(&ctx->cword.encrypt);
316 ecb_crypt(in, out, ctx->D, &ctx->cword.decrypt, 1);
318 padlock_store_cword(&ctx->cword.encrypt);
351 padlock_reset_key(&ctx->cword.encrypt);
359 ctx->E, &ctx->cword.encrypt,
366 padlock_store_cword(&ctx->cword.encrypt);
380 padlock_reset_key(&ctx->cword.decrypt);
388 ctx->D, &ctx->cword.decrypt,
395 padlock_store_cword(&ctx->cword.encrypt);
431 padlock_reset_key(&ctx->cword.encrypt);
440 walk.iv, &ctx->cword.encrypt,
448 padlock_store_cword(&ctx->cword.decrypt);
462 padlock_reset_key(&ctx->cword.encrypt);
470 ctx->D, walk.iv, &ctx->cword.decrypt,
478 padlock_store_cword(&ctx->cword.encrypt);