ARM Shanghai IoT Team (Internal) / newMiniTLS-GPL

Fork of MiniTLS-GPL by Donatien Garnier

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers fp_unsigned_bin_size.c Source File

fp_unsigned_bin_size.c

00001 /* TomsFastMath, a fast ISO C bignum library.
00002  * 
00003  * This project is meant to fill in where LibTomMath
00004  * falls short.  That is speed ;-)
00005  *
00006  * This project is public domain and free for all purposes.
00007  * 
00008  * Tom St Denis, tomstdenis@gmail.com
00009  */
00010 #include <tfm.h>
00011 
00012 int fp_unsigned_bin_size(fp_int *a)
00013 {
00014   int     size = fp_count_bits (a);
00015   return (size / 8 + ((size & 7) != 0 ? 1 : 0));
00016 }
00017 
00018 /* $Source: /cvs/libtom/tomsfastmath/src/bin/fp_unsigned_bin_size.c,v $ */
00019 /* $Revision: 1.1 $ */
00020 /* $Date: 2006/12/31 21:25:53 $ */