bn_reverse.c

Go to the documentation of this file.
00001 #include <tommath.h>
00002 #ifdef BN_REVERSE_C
00003 /* LibTomMath, multiple-precision integer library -- Tom St Denis
00004  *
00005  * LibTomMath is a library that provides multiple-precision
00006  * integer arithmetic as well as number theoretic functionality.
00007  *
00008  * The library was designed directly after the MPI library by
00009  * Michael Fromberger but has been written from scratch with
00010  * additional optimizations in place.
00011  *
00012  * The library is free for all purposes without any express
00013  * guarantee it works.
00014  *
00015  * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com
00016  */
00017 
00018 /* reverse an array, used for radix code */
00019 void
00020 bn_reverse (unsigned char *s, int len)
00021 {
00022   int     ix, iy;
00023   unsigned char t;
00024 
00025   ix = 0;
00026   iy = len - 1;
00027   while (ix < iy) {
00028     t     = s[ix];
00029     s[ix] = s[iy];
00030     s[iy] = t;
00031     ++ix;
00032     --iy;
00033   }
00034 }
00035 #endif
00036 
00037 /* $Source: /cvsroot/tcl/libtommath/bn_reverse.c,v $ */
00038 /* $Revision: 1.1.1.3 $ */
00039 /* $Date: 2006/12/01 00:08:11 $ */



Generated on Wed Mar 12 12:18:25 2008 by  doxygen 1.5.1