Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\crypto\aes.c Create Date:2022-07-28 06:43:57
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:aes_encrypt - Encrypt a single AES block*@ctx: Context struct containing the key schedule*@out: Buffer to store the ciphertext*@in: Buffer containing the plaintext

Proto:void aes_encrypt(const struct crypto_aes_ctx *ctx, u8 *out, const u8 *in)

Type:void

Parameter:

TypeParameterName
const struct crypto_aes_ctx *ctx
u8 *out
const u8 *in
260  rkp = key_enc + 4
261  rounds = 6 + key_length / 4
262  u32 st0[4], st1[4]
265  st0[0] = key_enc[0] ^ get_unaligned_le32(in)
266  st0[1] = key_enc[1] ^ get_unaligned_le32(in + 4)
267  st0[2] = key_enc[2] ^ get_unaligned_le32(in + 8)
268  st0[3] = key_enc[3] ^ get_unaligned_le32(in + 12)
276  st0[0] ^= Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[0] ^ Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[64] ^ Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[134] ^ Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[195]
277  st0[1] ^= Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[16] ^ Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[82] ^ Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[158] ^ Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[221]
278  st0[2] ^= Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[32] ^ Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[96] ^ Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[160] ^ Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[234]
279  st0[3] ^= Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[48] ^ Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[112] ^ Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[186] ^ Emit the sbox as volatile const to prevent the compiler from doing* constant folding on sbox references involving fixed indexes.[241]
281  cycle
282  st1[0] = mix_columns(subshift(st0, 0)) ^ rkp[0]
283  st1[1] = mix_columns(subshift(st0, 1)) ^ rkp[1]
284  st1[2] = mix_columns(subshift(st0, 2)) ^ rkp[2]
285  st1[3] = mix_columns(subshift(st0, 3)) ^ rkp[3]
287  If round == rounds - 2 Then Break
290  st0[0] = mix_columns(subshift(st1, 0)) ^ rkp[4]
291  st0[1] = mix_columns(subshift(st1, 1)) ^ rkp[5]
292  st0[2] = mix_columns(subshift(st1, 2)) ^ rkp[6]
293  st0[3] = mix_columns(subshift(st1, 3)) ^ rkp[7]
296  put_unaligned_le32(subshift(st1, 0) ^ rkp[4], out)
297  put_unaligned_le32(subshift(st1, 1) ^ rkp[5], out + 4)
298  put_unaligned_le32(subshift(st1, 2) ^ rkp[6], out + 8)
299  put_unaligned_le32(subshift(st1, 3) ^ rkp[7], out + 12)