Mercurial > dropbear
comparison bn_mp_reduce_2k.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 /* reduces a modulo n where n is of the form 2**p - d */ | 18 /* reduces a modulo n where n is of the form 2**p - d */ |
19 int | 19 int mp_reduce_2k(mp_int *a, mp_int *n, mp_digit d) |
20 mp_reduce_2k(mp_int *a, mp_int *n, mp_digit d) | |
21 { | 20 { |
22 mp_int q; | 21 mp_int q; |
23 int p, res; | 22 int p, res; |
24 | 23 |
25 if ((res = mp_init(&q)) != MP_OKAY) { | 24 if ((res = mp_init(&q)) != MP_OKAY) { |