1 /* LibTomMath, multiple-precision integer library -- Tom St Denis
\r
3 * LibTomMath is library that provides for multiple-precision
\r
4 * integer arithmetic as well as number theoretic functionality.
\r
6 * The library is designed directly after the MPI library by
\r
7 * Michael Fromberger but has been written from scratch with
\r
8 * additional optimizations in place.
\r
10 * The library is free for all purposes without any express
\r
11 * guarantee it works.
\r
13 * Tom St Denis, tomstdenis@iahu.ca, http://math.libtomcrypt.org
\r
15 #include <tommath.h>
\r
17 /* determines the setup value */
\r
18 void mp_dr_setup(mp_int *a, mp_digit *d)
\r
20 /* the casts are required if DIGIT_BIT is one less than
\r
21 * the number of bits in a mp_digit [e.g. DIGIT_BIT==31]
\r
23 *d = (mp_digit)((((mp_word)1) << ((mp_word)DIGIT_BIT)) -
\r
24 ((mp_word)a->dp[0]));
\r