Commit Graph

33 Commits

Author SHA1 Message Date
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
Steffen Jaeckel
9d954dc819 also check doc when running helper.pl -a 2019-10-27 16:19:02 +01:00
Steffen Jaeckel
59ee1416a0 fix ./helper.pl -d 2019-10-27 15:48:38 +01:00
nijtmans
448d00804d Fix commit in helper.pl 2019-10-24 08:47:17 +02: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
Daniel Mendler
b4099e1ed2
remove empty bn_deprecated.c file 2019-10-17 16:56:30 +02:00
Steffen Jaeckel
702e5391d0 add function pointers to tommath_class.h 2019-09-07 17:28:16 +02:00
Steffen Jaeckel
d1013c7726
fix generate_def() 2019-06-07 10:24:21 +02:00
Daniel Mendler
f5b2106a63
helper.pl: don't use sed, support CC variable for preprocessing 2019-06-07 08:28:32 +02:00
Daniel Mendler
3ef6efd32a
sort tommath_class.h dependencies: this makes it easier to see changes 2019-06-07 08:28:32 +02:00
Daniel Mendler
7eb6f32186
helper.pl - do not use heredocs for single lines 2019-06-07 08:28:32 +02:00
Daniel Mendler
e856b51b5c
remove version_from_tomcrypt 2019-06-07 08:28:32 +02:00
Steffen Jaeckel
0d06d67ef7
generate tommath_class from pre-processed code 2019-06-07 08:28:32 +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
Daniel Mendler
64be56e7d0
remove global $deplist 2019-05-27 15:54:45 +02:00
Daniel Mendler
dfcaf41f75
remove global %depmap 2019-05-27 15:54:45 +02:00
Daniel Mendler
25d663d047
rename deplist to depmap 2019-05-27 15:54:45 +02:00
Daniel Mendler
4f26de17a2
fix return value 2019-05-27 15:54:45 +02:00
Daniel Mendler
36b4411cc7
remove indent global var 2019-05-27 15:54:45 +02:00
Daniel Mendler
26548f0f4e
make helper-dep.pl part of helper.pl 2019-05-27 15:54:45 +02:00
Daniel Mendler
712919f337
[WIP] start to make dep.pl part of helper.pl 2019-05-27 15:54:45 +02:00
Daniel Mendler
fe9a8189f8
sanitize comments in helper.pl 2019-05-07 10:56:13 +02:00
Daniel Mendler
ff56140462
shorter headers 2019-04-07 17:26:31 +02:00
Daniel Mendler
70a30ae7a7
remove footers 2019-04-07 17:26:31 +02:00
Karel Miko
667ce28bb4 add doc checking to helper.pl 2019-02-11 15:44:53 +01:00
Steffen Jaeckel
18355de625 Update file headers
[skip ci]
2018-12-29 17:56:20 +01:00
Karel Miko
0329e828ae drop broken (not working) makefile.cygwin_dll 2018-12-02 18:28:59 +01:00
Karel Miko
8e4edf76d5 drop makefile.bcc+makefile.icc in favour of makefile.unix 2018-12-02 18:27:05 +01:00
Karel Miko
2c07579f7d add makefile.mingw 2018-12-02 14:59:05 +01:00
Karel Miko
934ee69bc0 update MSVC project file libtommath_VS2008.vcproj 2018-12-02 14:32:08 +01:00
Karel Miko
c852d5abe6 replace updatemakes.sh+filter.pl with updatemakes.sh+helper.pl 2018-12-02 14:27:53 +01:00