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
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