comparison bn_mp_zero.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 /* set to zero */ 18 /* set to zero */
19 void 19 void mp_zero (mp_int * a)
20 mp_zero (mp_int * a)
21 { 20 {
21 int n;
22 mp_digit *tmp;
23
22 a->sign = MP_ZPOS; 24 a->sign = MP_ZPOS;
23 a->used = 0; 25 a->used = 0;
24 memset (a->dp, 0, sizeof (mp_digit) * a->alloc); 26
27 tmp = a->dp;
28 for (n = 0; n < a->alloc; n++) {
29 *tmp++ = 0;
30 }
25 } 31 }
26 #endif 32 #endif