Mercurial > dropbear
comparison libtommath/bn_s_mp_reverse.c @ 1692:1051e4eea25a
Update LibTomMath to 1.2.0 (#84)
* update C files
* update other files
* update headers
* update makefiles
* remove mp_set/get_double()
* use ltm 1.2.0 API
* update ltm_desc
* use bundled tommath if system-tommath is too old
* XMALLOC etc. were changed to MP_MALLOC etc.
author | Steffen Jaeckel <s@jaeckel.eu> |
---|---|
date | Tue, 26 May 2020 17:36:47 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1691:2d3745d58843 | 1692:1051e4eea25a |
---|---|
1 #include "tommath_private.h" | |
2 #ifdef BN_S_MP_REVERSE_C | |
3 /* LibTomMath, multiple-precision integer library -- Tom St Denis */ | |
4 /* SPDX-License-Identifier: Unlicense */ | |
5 | |
6 /* reverse an array, used for radix code */ | |
7 void s_mp_reverse(unsigned char *s, size_t len) | |
8 { | |
9 size_t ix, iy; | |
10 unsigned char t; | |
11 | |
12 ix = 0u; | |
13 iy = len - 1u; | |
14 while (ix < iy) { | |
15 t = s[ix]; | |
16 s[ix] = s[iy]; | |
17 s[iy] = t; | |
18 ++ix; | |
19 --iy; | |
20 } | |
21 } | |
22 #endif |