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_read_signed_bin.c Source File

fp_read_signed_bin.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 void fp_read_signed_bin(fp_int *a, unsigned char *b, int c)
00013 {
00014   /* read magnitude */
00015   fp_read_unsigned_bin (a, b + 1, c - 1);
00016 
00017   /* first byte is 0 for positive, non-zero for negative */
00018   if (b[0] == 0) {
00019      a->sign = FP_ZPOS;
00020   } else {
00021      a->sign = FP_NEG;
00022   }
00023 }
00024 
00025 /* $Source: /cvs/libtom/tomsfastmath/src/bin/fp_read_signed_bin.c,v $ */
00026 /* $Revision: 1.1 $ */
00027 /* $Date: 2006/12/31 21:25:53 $ */