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

fp_reverse.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 /* reverse an array, used for radix code */
00013 void fp_reverse (unsigned char *s, int len)
00014 {
00015   int     ix, iy;
00016   unsigned char t;
00017 
00018   ix = 0;
00019   iy = len - 1;
00020   while (ix < iy) {
00021     t     = s[ix];
00022     s[ix] = s[iy];
00023     s[iy] = t;
00024     ++ix;
00025     --iy;
00026   }
00027 }
00028 
00029 /* $Source: /cvs/libtom/tomsfastmath/src/bin/fp_reverse.c,v $ */
00030 /* $Revision: 1.2 $ */
00031 /* $Date: 2007/02/27 02:38:44 $ */