Commit Graph

882 Commits

Author SHA1 Message Date
Steffen Jaeckel
235e831db0
Merge pull request #255 from libtom/hardening
hardening: add MP_ZERO_BUFFER, MP_ZERO_DIGITS
2019-05-12 11:52:48 +02:00
Daniel Mendler
61d9e528a4
hardening: add MP_ZERO_BUFFER, MP_ZERO_DIGITS
* (!) Always zero buffer before freeing if MP_NO_ZERO_ON_FREE is not defined
* Add MP_NO_ZERO_ON_FREE to disable hardening
* Add MP_ZERO_BUFFER, MP_ZERO_DIGITS, MP_FREE_BUFFFER, MP_FREE_DIGITS
* Never use MP_FREE directly, use MP_FREE_DIGITS or MP_FREE_BUFFER
* Add MP_USE_MEMSET to use memset instead of loop
* Disable astyle backups which are annonying in the times of git
2019-05-12 01:01:03 +02:00
Steffen Jaeckel
55e312b1c1
Merge pull request #244 from libtom/warn-unused-result
add warn_unused_result, found one missing check!
2019-05-11 20:09:18 +02:00
Daniel Mendler
adf9605d6c
add warn_unused_result, found one missing check! 2019-05-11 19:26:58 +02:00
Steffen Jaeckel
5d8f04a944
Merge pull request #241 from fperrad/20190508_lint
more linting
2019-05-11 19:26:36 +02:00
Francois Perrad
5e66cfc66c remove useless cast 2019-05-11 16:57:04 +02:00
Francois Perrad
67756d7b48 explicit operator precedence 2019-05-11 16:57:04 +02:00
Francois Perrad
493c3c23f8 use same paramater name as in prototype 2019-05-11 16:57:04 +02:00
Francois Perrad
cc703a849b add missing parameter name in prototype 2019-05-11 16:57:04 +02:00
Steffen Jaeckel
be7ee4d025
Merge pull request #238 from fperrad/20190508_macros
new macros
2019-05-11 16:11:26 +02:00
Francois Perrad
7d4e8363e0 refactor with new private macro MP_MAXFAST 2019-05-11 12:05:38 +02:00
Francois Perrad
556219aa5b refactor with new private macro MP_SIZEOF_BITS
CHAR_BIT is no longer directly used
2019-05-11 12:05:38 +02:00
Steffen Jaeckel
17719ea69f
Merge pull request #249 from libtom/remove-artifacts
remove some historical artifacts
2019-05-11 08:43:14 +02:00
Daniel Mendler
483f66c64a
remove some historical artifacts
* pretty.build: build system is already pretty baroque and we are
  not using this anywhere in CI etc.
* rename.sh: only used for internal renaming. can be retrieved from
  git history if needed again.
* tombc/grammer.txt: ?
2019-05-11 08:39:55 +02:00
Steffen Jaeckel
0971e05c7a
Merge pull request #242 from libtom/random-prime
deprecate mp_prime_random_ex in favor of mp_prime_rand
2019-05-11 08:35:10 +02:00
Daniel Mendler
0669e92e78
deprecate mp_prime_random_ex in favor of mp_prime_rand
We can use the internal mp_rand generator now, since it generates
numbers which are safe for crypto purposes.
2019-05-11 00:48:48 +02:00
Steffen Jaeckel
d4c5fbf572
Merge pull request #245 from libtom/deprecations
deprecate old macros, deprecate mp_rand_digit
2019-05-11 00:40:59 +02:00
Daniel Mendler
e05215a894
deprecate old macros, deprecate mp_rand_digit 2019-05-09 15:05:47 +02:00
Steffen Jaeckel
385d1a823f
Merge pull request #248 from libtom/test-mp_rand
Test mp_rand
2019-05-09 14:44:19 +02:00
Steffen Jaeckel
1a12486d4b add mp_rand test 2019-05-09 10:47:35 +02:00
Steffen Jaeckel
eedf1624f0 allow filtering of tests executed 2019-05-09 10:47:35 +02:00
Steffen Jaeckel
cc3be56501
Merge pull request #246 from libtom/error-string
add MP_ERR to mp_error_to_string
2019-05-09 09:31:49 +02:00
Daniel Mendler
53c30fff5f
add MP_ERR to mp_error_to_string 2019-05-09 04:16:24 +02:00
Steffen Jaeckel
be11f12bcd
Merge pull request #236 from libtom/custom-rand-source
support custom random data source via mp_rand_source
2019-05-08 17:16:12 +02:00
Daniel Mendler
56fb5e4a9a
mp_rand_source(NULL) sets to platform random source 2019-05-08 15:17:37 +02:00
Daniel Mendler
9e28ef9fa2
mp_rand: use #else after arcrandom 2019-05-08 15:15:45 +02:00
Daniel Mendler
2a0021a447
mp_rand: remove superflous mp_clamp 2019-05-08 14:57:49 +02:00
Daniel Mendler
9ddf1e5838
support custom random data source via mp_rand_source
* deprecate MP_PRNG_ENABLE_LTM_RNG
* custom mp_rand_source is used always if set, which should be more aligned with user expectations
* use custom source in tune.c
* don't call random number generator once per digit, which is slow
2019-05-08 11:21:10 +02:00
Daniel Mendler
f0f75186cd
set std=c89
we cannot set it together with -Wsystem-headers since the system headers
are usually not c89 but c99
2019-05-08 11:13:58 +02:00
Steffen Jaeckel
50fe11bfb7 fix help-output of tune program
[skip ci]
2019-05-07 16:34:33 +02:00
Steffen Jaeckel
f4d8b463f8
Merge pull request #235 from libtom/tune-fixes
Tune fixes
2019-05-07 16:33:44 +02:00
Daniel Mendler
e0e8c3d5f0
just use one .gitignore for simplicity 2019-05-07 12:36:11 +02:00
Daniel Mendler
e8ff342904
cleanup make output 2019-05-07 12:36:11 +02:00
Daniel Mendler
4f5334e4c6
etc/tune.c: add missing break 2019-05-07 12:36:11 +02:00
Daniel Mendler
6fb233c989
gitignore dos2unix, ignore file from make tune 2019-05-07 12:36:11 +02:00
Steffen Jaeckel
e98797263b
Merge pull request #234 from libtom/more-deprecations
More deprecations
2019-05-07 12:09:26 +02:00
Daniel Mendler
fe9a8189f8
sanitize comments in helper.pl 2019-05-07 10:56:13 +02:00
Daniel Mendler
2ea04fb782
dep.pl: strip comments 2019-05-07 10:42:47 +02:00
Daniel Mendler
c7596983ae
fix dep.pl - use lookahead to only generated dependencies for 'mp_*(' 2019-05-07 10:28:32 +02:00
Daniel Mendler
290c28c10e
deprecate PRIME_SIZE in favor of MP_PRIME_SIZE 2019-05-07 09:49:26 +02:00
Daniel Mendler
44d03a6f8b
deprecate LTM_PRIME_* macros in favor of MP_PRIME_* 2019-05-07 09:45:38 +02:00
Daniel Mendler
e2ee39b536
deprecate ltm_prime_callback 2019-05-07 09:36:24 +02:00
Daniel Mendler
80f5fac53b
rename LTM_NO_FILE to MP_NO_FILE 2019-05-07 09:33:56 +02:00
Daniel Mendler
0337d48b67
add MP_NULL_TERMINATED 2019-05-07 09:33:46 +02:00
Daniel Mendler
250751be46
tommath.h: do not expose stdlib.h 2019-05-07 09:32:59 +02:00
Steffen Jaeckel
79c8743015
Merge pull request #232 from czurnieden/autotune
Autotuning functionality for the Toom-Cook cut-offs
2019-05-07 09:10:37 +02:00
Steffen Jaeckel
a7fcb6f53c update etc/tune_it.sh after merging #231 2019-05-06 23:29:08 +02:00
czurnieden
db76bed220 added autotuning functionality for the Toom-Cook cut-offs 2019-05-06 23:29:08 +02:00
Steffen Jaeckel
9e1a75cfdc
Merge pull request #231 from libtom/tune-via-D
Tunable cutoff parameters
2019-05-06 22:18:33 +02:00
Daniel Mendler
818d8fb7f5
Rework handling of tunable cutoffs
* In the default settings, a cutoff X can be modified at runtime
   by adjusting the corresponding X_CUTOFF variable.

 * Tunability of the library can be disabled at compile time
   by defining the MP_FIXED_CUTOFFS macro.

 * There is an additional file tommath_cutoffs.h, which defines
   the default cutoffs. These can be adjusted manually or by the
   autotuner.
2019-05-04 13:08:37 +02:00