comparison bn_mp_unsigned_bin_size.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
14 * 14 *
15 * Tom St Denis, [email protected], http://math.libtomcrypt.org 15 * Tom St Denis, [email protected], http://math.libtomcrypt.org
16 */ 16 */
17 17
18 /* get the size for an unsigned equivalent */ 18 /* get the size for an unsigned equivalent */
19 int 19 int mp_unsigned_bin_size (mp_int * a)
20 mp_unsigned_bin_size (mp_int * a)
21 { 20 {
22 int size = mp_count_bits (a); 21 int size = mp_count_bits (a);
23 return (size / 8 + ((size & 7) != 0 ? 1 : 0)); 22 return (size / 8 + ((size & 7) != 0 ? 1 : 0));
24 } 23 }
25 #endif 24 #endif