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 [39];
// Последнийраундпреобраобразований: = LastForwardTable [Byte (T1 [0])]; W1: = LastForwardTable [Byte (T1 [1] shr 8)];: = LastForwardTable [Byte (T1 [2] shr 16)]; W3: = LastForwardTable [Byte (T1 [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 [40];: = LastForwardTable [Byte (T1 [1])]; W1: = LastForwardTable [Byte (T1 [2] shr 8)];: = LastForwardTable [Byte (T1 [3] shr 16)]; W3: = LastForwardTable [Byte (T1 [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 [41];: = LastForwardTable [Byte (T1 [2 ])]; W1: = LastForwardTable [Byte (T1 [3] shr 8)];: = LastForwardTable [Byte (T1 [0] shr 16)]; W3: = LastForwardTable [Byte (T1 [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 [42];: = LastForwardTable [Byte (T1 [3])]; W1: = LastForwardTable [Byte (T1 [0] shr 8)];: = LastForwardTable [Byte (T1 [1] shr 16)]; W3: = LastForwardTable [Byte (T1 [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 [43];
// Завершення (@ OutBuf [0]) ^: = T0 [0]; PLongWord (@ OutBuf [4]) ^: = T0 [1]; (@ OutBuf [8]) ^ : = T0 [2]; PLongWord (@ OutBuf [12]) ^: = T0 [3];; ExpandAESKeyForDecryption (var ExpandedKey: TAESExpandedKey128);: integer;, F2, F4, F8, F9: longword; I: = 1 to 9 do
// Процедура розширення ключа: = ExpandedKey [I * 4];
U: = F9 and $ 80808080;: = ((F9 and $ 7F7F7F7F) shl 1) xor ((U - (U shr 7)) and $ 1B1B1B1B);: = F2 and $ 80808080;: = ((F2 and $ 7F7F7F7F) shl 1) xor ((U - (U shr 7)) and $ 1B1B1B1B);: = F4 and $ 80808080;: = ((F4 and $ 7F7F7F7F) shl 1) xor ((U - (U shr 7)) and $ 1B1B1B1B);: = F9 xor F8; [I * 4]: = F2 xor F4 xor F8 xor
(((F2 xor F9) shl 24) or ((F2 xor F9) shr 8)) xor
(((F4 xor F9) shl 16) or ((F4 xor F9) shr 16)) xor ((F9 shl 8) or (F9 shr 24));: = ExpandedKey [I * 4 + 1];: = F9 and $ 80808080;: = ((F9 and $ 7F7F7F7F) shl 1) xor ((U - (U shr 7)) and $ 1B1B1B1B);: = F2 and $ 80808080;: = ((F2 and $ 7F7F7F7F) shl 1) xor ((U - (U shr 7)) and $ 1B1B1B1B);: = F4 and $ 80808080;: = ((F4 and $ 7F7F7F7F) shl 1) xor ((U - (U shr 7 )) and $ 1B1B1B1B);: = F9 xor F8; [I * 4 + 1]: = F2 xor F4 xor F8 xor
(((F2 xor F9) shl 24) or ((F2 xor F9) shr 8)) xor
(((F4 xor F9) shl 16) or ((F4 xor F9) shr 16)) xor ((F9 shl 8) or (F9 shr 24));: = ExpandedKey [I * 4 + 2];: = F9 and $ 8080...