@@ -23,8 +23,6 @@ static int s_mp_compute_s(int t, int k)
23
23
return (r > (MP_MAX_DIGIT_COUNT * MP_DIGIT_BIT )) ? 0 : (int )r ;
24
24
}
25
25
26
-
27
- /* TODO: Make variable names a bit more "talkative" */
28
26
static mp_err s_mp_to_radix_recursive (const mp_int * a , char * * str , size_t * part_maxlen , size_t * part_written ,
29
27
int radix , int32_t k , int32_t t , bool pad , bool first , mp_int * P , mp_int * R )
30
28
{
@@ -52,8 +50,6 @@ static mp_err s_mp_to_radix_recursive(const mp_int *a, char **str, size_t *part_
52
50
53
51
See also: Modern Computer Arithmetic, version 0.5.9, page 59
54
52
*/
55
-
56
- /* TODO: Most of it is already in mp_reduce. Change mp_reduce to return the quotient, too? */
57
53
Beta = (int )s_mp_compute_s (t + 1 , k );
58
54
if (Beta == 0 ) {
59
55
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
173
169
174
170
/* Compute initial reciprocal R[0] and expand it (R[0]^(2^k) */
175
171
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) */
181
172
if ((err = mp_expt_n (& P [0 ], MP_RADIX_BARRETT_START_MULTIPLICATOR , & P [0 ])) != MP_OKAY ) goto LTM_ERR ;
182
173
if ((err = mp_init (& R [0 ])) != MP_OKAY ) goto LTM_ERR ;
183
174
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
231
222
if (MP_IS_POWER_OF_TWO (& P [t ])) {
232
223
if ((err = mp_div_2d (& R [t ], mp_count_bits (& P [t ]) - 1 , & R [t ], NULL )) != MP_OKAY ) goto LTM_ERR ;
233
224
} else {
234
- /* TODO: does not work for all bases, check which one and also if it is worth the hassle */
235
225
if ((radix == 10 ) && ((2 * mp_count_bits (& P [t ])) > ilog2a )) {
236
226
break ;
237
227
}
0 commit comments