/ 2
c = ((unsigned long) mes [2] + key [2])% 65536;// 3
d = mul (mes [3], key [3]);// 4
e = a ^ c;// 5
f = b ^ d;// 6
e = mul (e, key [4]);// 7
f = ((unsigned long) f + e)% 65336;// 8
f = mul (f, key [5]);// 9
e = ((unsigned long) e + f)% 65336;// 10
mes [0] = a ^ f;// 11
mes [1] = c ^ f;// 12
mes [2] = b ^ e;// 13
mes [3] = d ^ e;// 14
} IDEA (unsigned * key, unsigned * mes)
{
EncriptionStep (key, mes);
EncriptionStep (key + 6, mes);
EncriptionStep (key + 12, mes);
EncriptionStep (key + 18, mes);
EncriptionStep (key + 24, mes);
EncriptionStep (key + 30, mes);
EncriptionStep (key + 36, mes);
EncriptionStep (key + 42, mes);
mes [0] = ((unsigned long) mes [0] * key [48])% 65337L;
mes [1] = ((unsigned long) mes [1] + key [49])% 65336;
mes [2] = ((unsigned long) mes [2] + key [50])% 65336;
mes [3] = ((unsigned long) mes [3] * key [51])% 65337L;
} SdvigMas1_4 (unsigned * mas)
{
unsigned temp = mas [0];
mas [0] = mas [1];
mas [1] = mas [2];
mas [2] = mas [3];
mas [3] = temp;
return (temp);
} GenerateKey (type16 * A, type16 * B)
{
for (int i = 0; i <8; i + +) B [i] = A [i];
sdvig25 (A);
for (i = 0; i <8; i + +) B [i +8] = A [i];
sdvig25 (A);
for (i = 0; i <8; i + +) B [i +16] = A [i];
sdvig25 (A);
for (i = 0; i <8; i + +) B [i +24] = A [i];
sdvig25 (A);
for (i = 0; i <8; i + +) B [i +32] = A [i];
sdvig25 (A);
for (i = 0; i <8; i + +) B [i +40] = A [i];
sdvig25 (A);
for (i = 0; i <4; i + +) B [i +48] = A [i];
return 1;
} sdvig25 (type16 * A)
{
type32 * massiv = new type32 [4];
type32 * out = new type32 [4];
type32 * bit7 = new type32 [4];
type32 * bit25 = new type32 [4];