'mtest' can now optionally only run a given amount of loops.
the first parameter <n> when invoking 'mtest' is considered to determine
the amount
when <n> is in the range -63..-1: mtest will run 2^-n runs
when <n> is > 0: mtest will run n runs
else: mtest will exit immediately
This change is introduced to be able to choose the underlying
implementation of mp_expt_d_ex()
The implementation of the root_n functionality is now implemented in the
mp_n_root_ex() function.
The parameter 'fast' is just passed over to mp_expt_d_ex().
mp_n_root() defaults to the pre 921be35779
implementation
The implementation of the expt_d functionality is now implemented in the
mp_expt_d_ex() function.
The user can now choose between the old (more timing resistant) version
and the new version by modification of the parameter 'fast'.
mp_expt_d() defaults to the old version
change mp_digit/mp_word to unsigned long long
introduce new internal type mp_min_u32 that is minimum 32 bit wide
x32 target is 64 bit arch but has 32 bit wide 'unsigned long'
This change keeps static checkers happy.
This change originally came from Heimdal's bundled copy of
libtommath.
Signed-off-by: Ken Dreyer <ktdreyer@ktdreyer.com>
This avoids an unitialized variable warning in the compiler.
This change originally came from Heimdal's bundled copy of libtommath.
Signed-off-by: Ken Dreyer <ktdreyer@ktdreyer.com>
In mp_init_copy(), mp_init() is used to assign the memory with default block size, mp_copy() is used to grow the target mp_int size if it is required and copy the content.
My suggestion is to use mp_init_size() instead of mp_init() inside the mp_init_copy to assign required memory depending on the source mp_int size and then use mp_copy to copy the content. This will avoid the subsequent mp_grow() inside the mp_copy().
The associated issue number is 11 in GitHub.