Lines Matching defs:in

96 	/* multiply by polynomial 'x' (0b10) in GF(2^8) */
106 /* multiply by polynomial 'x^2' (0b100) in GF(2^8) */
113 * Perform the following matrix multiplication in GF(2^8)
128 * Perform the following matrix multiplication in GF(2^8)
147 static __always_inline u32 subshift(u32 in[], int pos)
149 return (aes_sbox[in[pos] & 0xff]) ^
150 (aes_sbox[(in[(pos + 1) % 4] >> 8) & 0xff] << 8) ^
151 (aes_sbox[(in[(pos + 2) % 4] >> 16) & 0xff] << 16) ^
152 (aes_sbox[(in[(pos + 3) % 4] >> 24) & 0xff] << 24);
155 static __always_inline u32 inv_subshift(u32 in[], int pos)
157 return (aes_inv_sbox[in[pos] & 0xff]) ^
158 (aes_inv_sbox[(in[(pos + 3) % 4] >> 8) & 0xff] << 8) ^
159 (aes_inv_sbox[(in[(pos + 2) % 4] >> 16) & 0xff] << 16) ^
160 (aes_inv_sbox[(in[(pos + 1) % 4] >> 24) & 0xff] << 24);
163 static u32 subw(u32 in)
165 return (aes_sbox[in & 0xff]) ^
166 (aes_sbox[(in >> 8) & 0xff] << 8) ^
167 (aes_sbox[(in >> 16) & 0xff] << 16) ^
168 (aes_sbox[(in >> 24) & 0xff] << 24);
172 * aes_expandkey - Expands the AES key as described in FIPS-197
182 * described in FIPS-197. The first slot (16 bytes) of each key (enc or dec) is
256 * @in: Buffer containing the plaintext
258 void aes_encrypt(const struct crypto_aes_ctx *ctx, u8 *out, const u8 *in)
265 st0[0] = ctx->key_enc[0] ^ get_unaligned_le32(in);
266 st0[1] = ctx->key_enc[1] ^ get_unaligned_le32(in + 4);
267 st0[2] = ctx->key_enc[2] ^ get_unaligned_le32(in + 8);
268 st0[3] = ctx->key_enc[3] ^ get_unaligned_le32(in + 12);
307 * @in: Buffer containing the ciphertext
309 void aes_decrypt(const struct crypto_aes_ctx *ctx, u8 *out, const u8 *in)
316 st0[0] = ctx->key_dec[0] ^ get_unaligned_le32(in);
317 st0[1] = ctx->key_dec[1] ^ get_unaligned_le32(in + 4);
318 st0[2] = ctx->key_dec[2] ^ get_unaligned_le32(in + 8);
319 st0[3] = ctx->key_dec[3] ^ get_unaligned_le32(in + 12);