1 /* LibTomMath, multiple-precision integer library -- Tom St Denis
3 * LibTomMath is library that provides for multiple-precision
4 * integer arithmetic as well as number theoretic functionality.
6 * The library is designed directly after the MPI library by
7 * Michael Fromberger but has been written from scratch with
8 * additional optimizations in place.
10 * The library is free for all purposes without any express
13 * Tom St Denis, tomstdenis@iahu.ca, http://math.libtomcrypt.org
17 /* reads a unsigned char array, assumes the msb is stored first [big endian] */
19 mp_read_unsigned_bin (mp_int * a, unsigned char *b, int c)
24 if ((res = mp_mul_2d (a, 8, a)) != MP_OKAY) {
32 a->dp[0] = (*b & MP_MASK);
33 a->dp[1] |= ((*b++ >> 7U) & 1);