@@ -23,8 +23,6 @@ static int s_mp_compute_s(int t, int k)
2323 return (r > (MP_MAX_DIGIT_COUNT * MP_DIGIT_BIT )) ? 0 : (int )r ;
2424}
2525
26-
27- /* TODO: Make variable names a bit more "talkative" */
2826static mp_err s_mp_to_radix_recursive (const mp_int * a , char * * str , size_t * part_maxlen , size_t * part_written ,
2927 int radix , int32_t k , int32_t t , bool pad , bool first , mp_int * P , mp_int * R )
3028{
@@ -52,8 +50,6 @@ static mp_err s_mp_to_radix_recursive(const mp_int *a, char **str, size_t *part_
5250
5351 See also: Modern Computer Arithmetic, version 0.5.9, page 59
5452 */
55-
56- /* TODO: Most of it is already in mp_reduce. Change mp_reduce to return the quotient, too? */
5753 Beta = (int )s_mp_compute_s (t + 1 , k );
5854 if (Beta == 0 ) {
5955 err = MP_OVF ;
@@ -173,11 +169,6 @@ mp_err s_mp_faster_to_radix(const mp_int *a, char *str, size_t maxlen, size_t *w
173169
174170 /* Compute initial reciprocal R[0] and expand it (R[0]^(2^k) */
175171 if ((err = mp_init_i32 (& P [0 ], n )) != MP_OKAY ) goto LTM_ERR ;
176- /* TODO: chunksize does not seem to matter much above the initial b^y, d.n.f.t. remove this line if
177- MP_RADIX_BARRETT_START_MULTIPLICATOR is removed but don't forget the possibility that
178- the OS does not like too many recursions. This routine does use a lot of stack
179- and it calls other D&C algorithms (fast multiplication, fast division) that need a little
180- slice of the stack, too (vid.: ulimit -s) */
181172 if ((err = mp_expt_n (& P [0 ], MP_RADIX_BARRETT_START_MULTIPLICATOR , & P [0 ])) != MP_OKAY ) goto LTM_ERR ;
182173 if ((err = mp_init (& R [0 ])) != MP_OKAY ) goto LTM_ERR ;
183174 if ((err = mp_2expt (& R [0 ], 2 * k )) != MP_OKAY ) goto LTM_ERR ;
@@ -231,7 +222,6 @@ mp_err s_mp_faster_to_radix(const mp_int *a, char *str, size_t maxlen, size_t *w
231222 if (MP_IS_POWER_OF_TWO (& P [t ])) {
232223 if ((err = mp_div_2d (& R [t ], mp_count_bits (& P [t ]) - 1 , & R [t ], NULL )) != MP_OKAY ) goto LTM_ERR ;
233224 } else {
234- /* TODO: does not work for all bases, check which one and also if it is worth the hassle */
235225 if ((radix == 10 ) && ((2 * mp_count_bits (& P [t ])) > ilog2a )) {
236226 break ;
237227 }
0 commit comments