Commit Graph

1230 Commits

Author SHA1 Message Date
Steffen Jaeckel
1cbfbe069e do 2 MR rounds for numbers >=2048bits 2019-05-21 09:48:48 +02:00
Christoph Zurnieden
d46cb169f8 removed obsolete check 2019-05-21 09:48:30 +02:00
Steffen Jaeckel
b31a1086ed
Merge pull request #268 from libtom/improve-coverage
improve coverage
2019-05-21 09:46:05 +02:00
Steffen Jaeckel
cb3ff8c28d improve coverage 2019-05-21 09:45:22 +02:00
Steffen Jaeckel
702ebdf7d3
Merge pull request #274 from fperrad/20190519_refactor
some refactoring
2019-05-21 09:44:23 +02:00
Francois Perrad
be42ce203e remove literal prefix 2019-05-20 05:36:27 +02:00
Francois Perrad
150c47cce2 refactor literal suffix with u lowercase 2019-05-20 05:36:24 +02:00
Francois Perrad
fd68b6526c refactor without err initialization 2019-05-20 05:36:21 +02:00
Francois Perrad
8b2daf7817 always use varname err with mp_err 2019-05-20 05:36:18 +02:00
Francois Perrad
c1f5b06d4b refactor with mp_init_multi 2019-05-20 05:36:08 +02:00
Francois Perrad
d185c1d7bd refactor without inner scope 2019-05-19 14:56:04 +02:00
Steffen Jaeckel
97bc7ca032
Merge pull request #260 from libtom/deprecations2
Various deprecations
2019-05-18 10:54:44 +02:00
Daniel Mendler
f55f0a9ef5
fix some usages of enum types 2019-05-18 10:03:47 +02:00
Daniel Mendler
a8239c2465
deprecate mp_get_bit
The return type of mp_get_bit was imprecise (either mp_err or mp_bool),
therefore this function is deprecated in favor of s_mp_get_bit for now.

If we need s_mp_get_bit to be public, we should add it under a different
name. However since mp_set_bit is not available, I don't think there any
downstream users (ab)using mp_int as bitsets.
2019-05-18 10:03:47 +02:00
Daniel Mendler
56e7a40123
deprecate mp_jacobi 2019-05-18 10:03:46 +02:00
Daniel Mendler
75e85a7341
move mp_prime_random_ex to bn_deprecated.c 2019-05-18 10:03:46 +02:00
Daniel Mendler
885e5e19b4
move mp_rand_digit to bn_deprecated.c 2019-05-18 10:03:46 +02:00
Steffen Jaeckel
b96d82dff7
Merge pull request #264 from libtom/rand-test-bugfix
bugfix: don't revert to platform rand source, but to jenkins source!
2019-05-18 10:00:26 +02:00
Daniel Mendler
198418ba5e
bugfix: don't revert to platform rand source, but to jenkins source! 2019-05-18 10:00:07 +02:00
Steffen Jaeckel
07b479a62e
Merge pull request #263 from fperrad/20190514_lint
more linting
2019-05-18 09:59:27 +02:00
Francois Perrad
91474f6e14 remove useless initialization 2019-05-15 09:22:39 +02:00
Francois Perrad
7395cc69c1 final else after a chain of if/else if 2019-05-15 09:22:36 +02:00
Francois Perrad
62602414fb use anonymous struct 2019-05-15 09:22:31 +02:00
Francois Perrad
ea3afecc67 avoid shift
note: redmode becomes a good candidate for a new enum
2019-05-14 18:54:38 +02:00
Steffen Jaeckel
4b334b4e08
Merge pull request #258 from libtom/more-explicit-types
Use enums/More explicit types
2019-05-14 09:27:10 +02:00
Daniel Mendler
668cda01e8
remove unnecessary duplication of multiplication 2019-05-13 19:18:09 +02:00
Daniel Mendler
334c32e034
fix signature 2019-05-13 19:15:59 +02:00
Daniel Mendler
89bac3a7a0
deprecate MP_RANGE 2019-05-13 19:15:14 +02:00
Daniel Mendler
0b73dab69f
MP_FREE_DIGITS: add missing cast 2019-05-13 19:15:14 +02:00
Daniel Mendler
4534056c28
use enums mp_err, mp_ord, mp_bool, mp_sign
* MP_USE_ENUMS enables enums
* Wc++-compat catches some implicit conversions if MP_USE_ENUMS is defined
* 100% backwards compatible API/ABI if MP_USE_ENUMS is not defined
2019-05-13 19:15:14 +02:00
Francois Perrad
38116079e4 literal suffix 2019-05-13 17:53:10 +02:00
Francois Perrad
04cff08991 explicit operator precedence 2019-05-13 17:53:03 +02:00
Francois Perrad
2d508723aa const parameter 2019-05-13 17:53:00 +02:00
Francois Perrad
3c5afa9115 add missing parameter name in prototype 2019-05-13 17:52:56 +02:00
Francois Perrad
fa2d86af95 explicit operator precedence 2019-05-13 17:52:34 +02:00
Francois Perrad
07aaa4c381 explicit condition 2019-05-13 17:52:34 +02:00
Francois Perrad
783e3cdf82 format block macros 2019-05-13 17:52:34 +02:00
Steffen Jaeckel
6327a69321
Merge pull request #256 from libtom/rand-cleanup
Use Jenkins rand in test suite
2019-05-13 10:22:08 +02:00
Daniel Mendler
f85bd31e4e
fix undefined behavior in labs 2019-05-12 23:45:36 +02:00
Daniel Mendler
16ff016ebe
win32 rand - just leak the crypt handle
* it will be closed so or so atexit
* the user could request more random data in another atexit routine
  leading to another atexit routine being registered
2019-05-12 23:45:36 +02:00
Daniel Mendler
2a2e2716c2
move jenkins prng to bn_s_mp_rand_jenkins.c 2019-05-12 23:45:36 +02:00
Daniel Mendler
c8cc3657e7
mov s_mp_rand_source_platform to separate file 2019-05-12 23:45:36 +02:00
Daniel Mendler
8d71a9e33b
travis: add -fsanitize=undefined 2019-05-12 23:45:36 +02:00
Steffen Jaeckel
625c2460af
Merge pull request #257 from libtom/use-fwrite
use fwrite instead of fputc
2019-05-12 23:45:23 +02:00
Daniel Mendler
dd4863abf4
use fwrite instead of fputc 2019-05-12 23:43:23 +02:00
Steffen Jaeckel
1c9481936c
Merge pull request #253 from libtom/no_grow_in_set_int2
No grow in mp_set_int (2)
2019-05-12 23:42:44 +02:00
Daniel Mendler
6fc673d645
statically check MP_PREC >= MP_MIN_PREC 2019-05-12 15:52:32 +02:00
Daniel Mendler
7365442ace
No grow necessary in mp_set_int* functions
* mp_set_int* always return MP_OKAY
* remove return checks for mp_set_int*
* introduce MP_MIN_PREC
2019-05-12 13:04:45 +02:00
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