1 /* TomsFastMath, a fast ISO C bignum library.
3 * This project is meant to fill in where LibTomMath
4 * falls short. That is speed ;-)
6 * This project is public domain and free for all purposes.
8 * Tom St Denis, tomstdenis@gmail.com
10 #include <tfm_private.h>
12 /* computes a = 2**b */
13 void fp_2expt(fp_int *a, int b)
17 /* zero a as per default */
29 /* set the used count of where the bit will go */
32 /* put the single bit in its place */
33 a->dp[z] = ((fp_digit)1) << (b % DIGIT_BIT);