Commit Graph

20 Commits

Author SHA1 Message Date
Daniel Mendler
41eca3425f regen 2019-11-14 09:17:00 +01:00
Daniel Mendler
53becf6569
regen files 2019-11-09 06:43:59 +01:00
Daniel Mendler
91d88ce3db
fix generate_def, rename some internal files 2019-11-05 21:11:58 +01:00
Daniel Mendler
410bf49385
apply a series of simplifications
* this is the final commit of a series of simplifications,
  containing only the regenerated files and the explanation in the
  commit message

* This is in preparation of the size_t change/a potential representation change to use
  full width as in tfm, if a (partial?) merge with tfm is desired.
  These changes have their own merits however.

* Remove obfuscating tmpx digit pointers (fewer variables, it is more obvious what is
  being manipulated)

* Reduce scope of variables where possible

* Stricter error handling/checking (for example handling in karatsuba
  was broken)

* In some cases the result was written even in the case of an error
  (e.g. s_mp_is_divisible). This will hide bugs, since the user should
  check the return value (enforced by MP_WUR). Furthermore if the user
  accesses the non-initialized result, valgrind will complain for
  example. Global static analysis like coverity will also detect the issue.
  Therefore this improves the status quo.

* Introduce generic, private MP_EXCH macro which can be used to swap values.

* Introduce s_mp_copy_digs/s_mp_zero_digs/s_mp_zero_buf

* Some control flow simplifications, e.g, loops instead of goto

* Renamings of variables/labels for consistency

* Renamings of mul/sqr functions for more consistency, e.g., comba
  instead of fast suffix

* I didn't read through some very complex functions.
  They are so complex, I am too afraid and lazy to touch them.
  Maybe someone resposible wants to simplify them if possible. Hint... Hint...
  - mp_prime_strong_lucas_selfridge.c
  - s_mp_exptmod.c
  - s_mp_exptmod_fast.c
2019-11-04 15:41:33 +01:00
Daniel Mendler
7afecabd9d
regen files 2019-10-27 19:19:47 +01:00
Steffen Jaeckel
7a68f12873 Execute move.sh - Rename files from bn_* to match the function names.
* git blame <renamed-file> is not affected
* git log --follow <renamed-file> can be used to show log across renames
2019-10-19 16:24:39 +02:00
nijtmans
700a79ea66 remove deprecated functions from tommath.def too 2019-10-18 09:28:11 +02:00
Steffen Jaeckel
c9d41fba73
rename mp_ilogb() to mp_log_u32() 2019-10-15 14:47:43 +02:00
czurnieden
b6813a4122
replace mp_export/import by mp_pack/unpack 2019-10-08 22:30:25 +02:00
czurnieden
abdb033402 Refactored functions to read and write binaries and added "maxlen" 2019-10-06 03:38:16 +02:00
Steffen Jaeckel
f0e6ae59ab add mp_to_radix()
...a 100% copy&paste of `mp_toradix_n()` besides the changed API signature
2019-09-02 18:25:44 +02:00
Daniel Mendler
ca89e9c0ef
rename mp_root/mp_expt to mp_*_u32 2019-07-17 15:45:04 +02:00
Daniel Mendler
71696549a8
deprecate mp_expt_d and mp_n_root in favor of mp_expt and mp_root 2019-07-17 15:45:04 +02:00
nijtmans
0db64fc83c Rename bn_get_magxx -> bn_get_mag_uxx. Documentation updated too 2019-07-03 14:45:14 +02:00
nijtmans
fde8524945 @minad 's suggestions 2019-07-03 12:49:19 +02:00
nijtmans
db4afb3d5e Provide explicit symbols for bn_xxx_l and bn_xxx_ll functions. 2019-07-03 12:49:19 +02:00
Daniel Mendler
8a1ae868ab
tommath.def should be 644 2019-06-07 08:27:09 +02:00
Daniel Mendler
f00cc99f8c
replace generate_def.sh with perl function 2019-06-07 08:27:09 +02:00
Steffen Jaeckel
28dc77ae0a update tommath.def always when updating the makefiles 2019-06-06 10:36:33 +02:00
nijtmans
a911999db9 Better interoperability between MSVC and mingw-w64, 3 2019-06-06 10:30:00 +02:00