]> pd.if.org Git - zpackage/blob - tomsfastmath/src/bin/fp_reverse.c
commit files needed for zpm-fetchurl
[zpackage] / tomsfastmath / src / bin / fp_reverse.c
1 /* TomsFastMath, a fast ISO C bignum library.
2  * 
3  * This project is meant to fill in where LibTomMath
4  * falls short.  That is speed ;-)
5  *
6  * This project is public domain and free for all purposes.
7  * 
8  * Tom St Denis, tomstdenis@gmail.com
9  */
10 #include <tfm_private.h>
11
12 /* reverse an array, used for radix code */
13 void fp_reverse (unsigned char *s, int len)
14 {
15   int     ix, iy;
16   unsigned char t;
17
18   ix = 0;
19   iy = len - 1;
20   while (ix < iy) {
21     t     = s[ix];
22     s[ix] = s[iy];
23     s[iy] = t;
24     ++ix;
25     --iy;
26   }
27 }
28
29 /* $Source$ */
30 /* $Revision$ */
31 /* $Date$ */