56 бітового числа ---------- -
void X_in_Y_modN (Word a [16], Word r [16], Word MODULE [16], Word RES [16]) {short bit, cicle, MASK = 0x01; B [16], A [16], stepen; BUFFER1 [32]; BUFFER2 [32]; step; (int j = 15; j> = 0; j -) {[j] = a [j]; [j] = a [ j];
} (int k = 15; k> = 0; k -) {= r [k]; = 0; step = 16; ((bit == 0) && ( step> 0)) {-; = (stepen>> step) &MASK;
} = step-1; -; (step> = 0) {(j = 0; j <= cicle; j + +) {= (stepen>> step) &MASK; (bit == 0) {(A, A, BUFFER1, 32); _MODULE (BUFFER1, A, MODULE);
} -;
}
}
} (int i = 15; i> = 0; i -) [i] = A [i];
}
SUMMA (Word P [16], Word Q [16], Word RES [16]) {CUR_RES [16] = {0x0,}; SUMMA = 0x0; PERENOS = 0x0; (int
} (e = 0; e <16; e + +) [e] = CUR_RES [e];
} a_in_P_modN (DWord a, DWord r, DWord N) {B, A, stepen; double complit_part; short bit, cicle; short MASK = 0x01; step = 32; = r; = a; B = a; = 0; (stepen == 1) {= (unsigned long) (A - floor (A/(long double) N) * (long double) N); A;
} (bit == 0) {-; = (stepen>> step) &MASK;
} = step-1; -; (int j = 0; j <= cicle; j + +) {= (stepen>> step) &MASK; (bit == 0) {_part = pow ((long double) A, 2); = (unsigned long) (complit_part - floor (complit_part/(long double) N) * (long double) N);
} {_part = pow ((long double) A, 2); = (unsigned long) (complit_part - floor (complit_part/(long double) N) * (long double) N); _part = (long double) A * (long double) B; = (unsigned long) (complit_part - floor (complit_part/(long double) N) * (long double) N);
} -;
} A;
}