1
1
#include "tommath_private.h"
2
2
#include <string.h>
3
- #ifdef BN_MP_TODECIMAL_FAST_C
3
+ #ifdef BN_S_MP_TODECIMAL_FAST_C
4
4
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
5
5
/* SPDX-License-Identifier: Unlicense */
6
6
7
7
/* store a bignum as a decimal ASCII string */
8
- mp_err mp_todecimal_fast_rec (mp_int * number , mp_int * nL , mp_int * shiftL , mp_int * mL , int precalc_array_index , int left ,
9
- char * * result )
8
+ mp_err s_mp_todecimal_fast_rec (const mp_int * number , mp_int * nL , mp_int * shiftL , mp_int * mL , int precalc_array_index ,
9
+ int left ,
10
+ char * * result )
10
11
{
11
12
mp_int q , nLq , r ;
12
13
mp_err err ;
@@ -47,14 +48,14 @@ mp_err mp_todecimal_fast_rec(mp_int *number, mp_int *nL, mp_int *shiftL, mp_int
47
48
48
49
-- precalc_array_index ;
49
50
if (left && mp_iszero (& q )) {
50
- if ((err = mp_todecimal_fast_rec (& r , nL , shiftL , mL , precalc_array_index , 1 , result )) != MP_OKAY ) {
51
+ if ((err = s_mp_todecimal_fast_rec (& r , nL , shiftL , mL , precalc_array_index , 1 , result )) != MP_OKAY ) {
51
52
goto LBL_ERR ;
52
53
}
53
54
} else {
54
- if ((err = mp_todecimal_fast_rec (& q , nL , shiftL , mL , precalc_array_index , left , result )) != MP_OKAY ) {
55
+ if ((err = s_mp_todecimal_fast_rec (& q , nL , shiftL , mL , precalc_array_index , left , result )) != MP_OKAY ) {
55
56
goto LBL_ERR ;
56
57
}
57
- if ((err = mp_todecimal_fast_rec (& r , nL , shiftL , mL , precalc_array_index , 0 , result )) != MP_OKAY ) {
58
+ if ((err = s_mp_todecimal_fast_rec (& r , nL , shiftL , mL , precalc_array_index , 0 , result )) != MP_OKAY ) {
58
59
goto LBL_ERR ;
59
60
}
60
61
}
@@ -66,7 +67,7 @@ mp_err mp_todecimal_fast_rec(mp_int *number, mp_int *nL, mp_int *shiftL, mp_int
66
67
return err ;
67
68
}
68
69
69
- mp_err mp_todecimal_fast ( mp_int * number , char * result )
70
+ mp_err s_mp_todecimal_fast ( const mp_int * number , char * result )
70
71
{
71
72
mp_int n , shift , M , M2 , M22 , M4 , M44 ;
72
73
mp_int nL [20 ], shiftL [20 ], mL [20 ];
@@ -187,7 +188,7 @@ mp_err mp_todecimal_fast(mp_int *number, char *result)
187
188
precalc_array_index ++ ;
188
189
}
189
190
190
- if ((err = mp_todecimal_fast_rec (number , nL , shiftL , mL , precalc_array_index - 1 , 1 , result_addr )) != MP_OKAY ) {
191
+ if ((err = s_mp_todecimal_fast_rec (number , nL , shiftL , mL , precalc_array_index - 1 , 1 , result_addr )) != MP_OKAY ) {
191
192
goto LBL_ERR ;
192
193
}
193
194
0 commit comments