Остановился на таком варианте, но он работает не правильно:
void e_change(int arg0)
{
unsigned int d;
unsigned char c = 4;
unsigned char a = 0;
unsigned char desr0 = arg0;
do
{
d = c-1;
if ( d <= 3 )
d = 7;
if ( msg[d] & 1 )
d = (msg[c] >> 1) | 0xFFFFFF80;
else
d = msg[c] >> 1;
tmp[a] = SubKey[(desr0 << 3) + a] ^ (d >> 2);
++a;
d = c+1;
if ( d > 7 )
d = 4;
if ( (msg[d]) == 0 )
d = msg[c] << 1;
else
d = (msg[c] << 1) + 1;
tmp[a] = SubKey[(desr0 << 3) + a] ^ d;
++a;
++c;
}
while ( a <= 7u );
}
Чяднт?