2A, $ 000000F5, $ 000000B0,
$ 000000C8, $ 000000EB, $ 000000BB, $ 0000003C, $ 00000083, $ 00000053, $ 00000099, $ 00000061,
$ 00000017, $ 0000002B, $ 00000004, $ 0000007E, $ 000000BA, $ 00000077, $ 000000D6, $ 00000026,
$ 000000E1, $ 00000069, $ 00000014, $ 00000063, $ 00000055, $ 00000021, $ 0000000C, $ 0000007D
);
// Розширення ключа для шифрування
procedure ExpandAESKeyForEncryption (const Key: TAESKey128; var ExpandedKey: TAESExpandedKey128);, J: integer;: longword;, W1, W2, W3: longword; [0]: = PLongWord (@ Key [0 ]) ^; [1]: = PLongWord (@ Key [4]) ^; [2]: = PLongWord (@ Key [8]) ^; [3]: = PLongWord (@ Key [12]) ^;: = 0; J: = 1;: = (ExpandedKey [I + 3] shl 24) or (ExpandedKey [I + 3] shr 8);: = LastForwardTable [Byte (T)]; W1: = LastForwardTable [Byte (T shr 8)];: = LastForwardTable [Byte (T shr 16)]; W3: = LastForwardTable [Byte (T shr 24)]; [I + 4]: = ExpandedKey [I] xor
(W0 xor ((W1 shl 8) or (W1 shr 24)) xor
((W2 shl 16) or (W2 shr 16)) xor ((W3 shl 24) or (W3 shr 8))) xor Rcon [J]; (J); [I + 5 ]: = ExpandedKey [I + 1] xor ExpandedKey [I + 4]; [I + 6]: = ExpandedKey [I + 2] xor ExpandedKey [I + 5]; [I + 7]: = ExpandedKey [I + 3 ] xor ExpandedKey [I + 6]; (I, 4); I> = 40;; EncryptAES (const InBuf: TAESBuffer; const Key: TAESExpandedKey128; OutBuf: TAESBuffer);, T1: array [0 .. 3] of longword;, W1, W2, W3: longword;
// Ініціалізація [0]: = PLongWord (@ InBuf [0]) ^ xor Key [0]; [1]: = PLongWord (@ InBuf [4]) ^ xor Key [1] ; [2]: = PLongWord (@ InBuf [8]) ^ xor Key [2]; [3]: = PLongWord (@ InBuf [12]) ^ xor Key [3];
// перетворення виконуються 10 разів
// раунд 1: = ForwardTable [Byte (T0 [0])]; W1: = ForwardTable [Byte (T0 [1] shr 8)];: = ForwardTable [Byte (T0 [2 ] shr 16)]; W3: = ForwardTable [Byte (T0 [3] shr 24)]; [0]: = (W0 xor ((W1 shl 8) or (W1 shr 24)) xor ((W2 shl 16) or (W2 shr 16)) ((W3 shl 24) or (W3 shr 8))) xor Key [4];: = ForwardTable [Byte (T0 [1])]; W1: = ForwardTable [Byte (T0 [2 ] shr 8)];: = ForwardTable [Byte (T0 [3] shr 16)]; W3: = ForwardTable [Byte (T0 [0] shr 24)]; [1]: = (W0 xor ((W1 shl 8 ) or (W1 shr 24)) xor ((W2 shl 16) or (W2 shr 16)) ((W3 shl 24) or (W3 shr 8))) xor Key [5];: = ForwardTable [Byte (T0 [ 2])]; W1: = ForwardTable [Byte (T0 [3] shr 8)];: = ForwardTable [Byte (T0 [0] shr 16)]; W3: = ForwardTable [Byte (T0 [1] shr 24) ]; [2]: = (W0 xor ((W1 shl 8) or (W1 shr 24)) xor ((W2 shl 16) or (W2 shr 16)) ((W3 shl 24) or (W3 shr 8)) ) xor Key [6];: = ForwardTable [Byte (T0 [3])]; W1: = ForwardTable [Byte (T0 [0] shr 8)];: = ForwardTable [Byte (T0 [1] shr 16)] ; W3: = ForwardTable [Byte (T0 [2] shr 24)]; [3]: = (W0 xor ((W1 shl 8) or (W1 shr 24)) xor ((W2 shl 16) or (W2 shr 16 )) ((W3 shl 24) or (W3 shr 8))) xor Key [7];
<...