comparison bn_mp_montgomery_calc_normalization.c @ 190:d8254fc979e9 libtommath-orig LTM_0.35

Initial import of libtommath 0.35
author Matt Johnston <matt@ucc.asn.au>
date Fri, 06 May 2005 08:59:30 +0000
parents d29b64170cf0
children
comparison
equal deleted inserted replaced
142:d29b64170cf0 190:d8254fc979e9
26 int x, bits, res; 26 int x, bits, res;
27 27
28 /* how many bits of last digit does b use */ 28 /* how many bits of last digit does b use */
29 bits = mp_count_bits (b) % DIGIT_BIT; 29 bits = mp_count_bits (b) % DIGIT_BIT;
30 30
31
32 if (b->used > 1) { 31 if (b->used > 1) {
33 if ((res = mp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1)) != MP_OKAY) { 32 if ((res = mp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1)) != MP_OKAY) {
34 return res; 33 return res;
35 } 34 }
36 } else { 35 } else {