X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=util%2Fsrc%2FTclTk%2Ftcl8.6.12%2Flibtommath%2Fbn_s_mp_reverse.c;fp=util%2Fsrc%2FTclTk%2Ftcl8.6.12%2Flibtommath%2Fbn_s_mp_reverse.c;h=c549e605e717003480cc3697a8699f1fd91a8ab7;hb=a5fac4c3be12f7d1c3c220e0c26890b05f28d35f;hp=0000000000000000000000000000000000000000;hpb=c07e8e55373b9730110d8e425119f05a1cd93e52;p=eos%2Fbase.git diff --git a/util/src/TclTk/tcl8.6.12/libtommath/bn_s_mp_reverse.c b/util/src/TclTk/tcl8.6.12/libtommath/bn_s_mp_reverse.c new file mode 100644 index 0000000000..c549e605e7 --- /dev/null +++ b/util/src/TclTk/tcl8.6.12/libtommath/bn_s_mp_reverse.c @@ -0,0 +1,22 @@ +#include "tommath_private.h" +#ifdef BN_S_MP_REVERSE_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis */ +/* SPDX-License-Identifier: Unlicense */ + +/* reverse an array, used for radix code */ +void s_mp_reverse(unsigned char *s, size_t len) +{ + size_t ix, iy; + unsigned char t; + + ix = 0u; + iy = len - 1u; + while (ix < iy) { + t = s[ix]; + s[ix] = s[iy]; + s[iy] = t; + ++ix; + --iy; + } +} +#endif