Commit Graph

125 Commits

Author SHA1 Message Date
Daniel Mendler
f6a7bedb95 suffix _u32 -> _n of mp_(expt|log|root) functions, use int for now 2019-11-14 09:16:00 +01:00
nijtmans
1cc289d215 better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
Daniel Mendler
6777baaf97
add macro MP_IS_2EXPT 2019-11-09 06:43:59 +01:00
Daniel Mendler
4f00e75b8f
make mp_div_3 private 2019-11-09 06:43:58 +01:00
Daniel Mendler
91d88ce3db
fix generate_def, rename some internal files 2019-11-05 21:11:58 +01:00
nijtmans
bbb178089d
mp_radix off-by-one error and other related code-cleanup 2019-11-05 20:15:24 +01:00
Daniel Mendler
93f8e7603d
rename MP_MAXFAST to MP_MAX_COMBA 2019-11-05 20:09:23 +01:00
Daniel Mendler
5c335f8407
rename mul/sqr functions for consistency, comba instead of fast suffix 2019-11-04 15:41:33 +01:00
Daniel Mendler
795cd2013f
simplifications: add s_mp_zero_(digs|buf) and s_mp_copy_digs
Originally I made those as macros. However we have many
other small functions like mp_clamp, mp_exch which are also not implemented
as macros right now.

If we would use c99, I would implement them as private static inline
functions. And mp_exch would be a public static inline function.

But since we are bound to c89, we simply use normal functions.
To achieve optimal performance one should either use link time
optimization or amalgamation.
2019-11-04 15:41:32 +01:00
Daniel Mendler
448f35e2e1
simplifications: prime functions 2019-11-04 15:41:32 +01:00
Daniel Mendler
2bbdbd0651
MP_MIN_PREC>=3 is needed for s_mp_div_school
test with MP_PREC=MP_MIN_PREC
2019-11-03 17:23:59 +01:00
Daniel Mendler
3cdcec43e6
first batch of simplifications 2019-10-29 19:30:23 +01:00
Daniel Mendler
a5d5b10154
mp_read_radix and mp_fread should behave the same 2019-10-27 23:51:38 +01:00
Daniel Mendler
bf9507a9d4
replace mp_bool by stdbool
* This gives the advantage that static analysis **understands** bool,
  but complains about using an enum type instead of bool.

* If stdbool.h is not desired, true/false/bool can be replaced using sed
  as in the no-stdint-h branch.

* We already include stdint.h and stdbool.h is not more harmful than
  this header
2019-10-27 18:36:56 +01:00
Daniel Mendler
58fb93fd79
cleanup prime rand function 2019-10-27 18:36:56 +01:00
Daniel Mendler
a44e68e652
remove MP_IS_* macros 2019-10-27 18:36:55 +01:00
Daniel Mendler
f8b2f5d6fe
s_mp_reverse is only used by mp_to_radix 2019-10-27 18:36:55 +01:00
Francois Perrad
814d0387a6 literal suffix 2019-10-27 14:27:53 +01:00
Francois Perrad
f2efe74676 more cast 2019-10-27 14:27:53 +01:00
nijtmans
a8ca1c3cc6
fix win32 includes, remove support for everything older than Windows XP 2019-10-27 13:14:28 +01:00
Francois Perrad
9051694850 literal suffix 2019-10-24 18:26:31 +02:00
Francois Perrad
d0e26bb3ff explicit operator precedence 2019-10-24 18:26:25 +02:00
Daniel Mendler
87b4e51794
move out s_mp_log_pow2, fix limitation of base 2019-10-23 19:18:15 +02:00
Daniel Mendler
14642642f9
add prefix to cutoff variables 2019-10-23 18:21:57 +02:00
Daniel Mendler
00b263f303
remove private_mp_word 2019-10-23 18:19:16 +02:00
czurnieden
9edd185f66 Addition of fast division (recursive divrem only) 2019-10-22 21:02:18 +02:00
Steffen Jaeckel
d06e2986ca v1.2.0
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 Comment: Gnu Privacy Tools
 
 iF4EABEIAAYFAl2uz5oACgkQrwyxdiHtrXLIngD/WoeRRt9sYkjNiSmiKYuBvgAi
 pF0Sdfe7vAAhY3jpRX0A/2rJdJFGiFiuAB72qWiGJZg0Rr+kbOGwKfvYgE6jROw6
 =EL7p
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 Comment: Gnu Privacy Tools
 
 iF4EABEIAAYFAl2u0EEACgkQrwyxdiHtrXIQkQD+I8Z6IYTtVmG0patanpT1EFyA
 SZUKP2z50owej4uF3QAA/32m1dmpG6MSYhfu9zu4435PwaI+RgCaUrZ1YaoWroXJ
 =agqw
 -----END PGP SIGNATURE-----

Merge tag 'v1.2.0' into develop

v1.2.0
2019-10-22 11:47:42 +02:00
Daniel Mendler
f0c83aea6c split mp_log_u32 for more configurability 2019-10-20 15:48:55 +02:00
Daniel Mendler
5c6391dd7c
remove some MP_8BIT remnants 2019-10-20 15:39:09 +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
3eaa268e21
Adapt mingw-build of libtommath.dll to respect internal symbols too 2019-10-19 15:01:33 +02:00
Daniel Mendler
42ebcbfee4
enable MP_PRIVATE (visibility=hidden) 2019-10-19 15:00:47 +02:00
nijtmans
7bba19e044 Add comment 2019-10-18 14:53:42 +02:00
nijtmans
785e32eb9c Move disabling of warning C4003 from makefile.msvc to tommath_private.h 2019-10-18 14:35:08 +02:00
Daniel Mendler
20dcc923f6
rename internal constant radix arrays 2019-10-17 17:07:02 +02:00
Daniel Mendler
45a3bf7694
remove deprecated functions 2019-10-17 16:56:27 +02:00
Daniel Mendler
fce429d08b
tommath.h: do not expose limits.h 2019-10-16 14:42:21 +02:00
Francois Perrad
b19750633c use literal char 2019-10-10 20:32:53 +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
Francois Perrad
8cf0d3db85 literal suffix 2019-09-07 12:29:28 +02:00
Daniel Mendler
625defdcff
fix gcc version check for deprecations 2019-07-24 11:09:44 +02:00
Daniel Mendler
8c1b296e86
add feature detection macro MP_HAS 2019-07-24 11:09:42 +02:00
nijtmans
91b113cb95 Macro consistancy: Always use function-name as first parameter and type(s) last, as in SET macro's 2019-07-03 12:49:19 +02:00
Daniel Mendler
8cf4363992
MP_SET_SIGNED: add utype parameter 2019-06-07 08:28:32 +02:00
Daniel Mendler
5302b907ff
use MP_SIZEOF_BITS 2019-06-07 08:28:32 +02:00
Steffen Jaeckel
a36374578f
change macros to contain types 2019-06-07 08:28:05 +02:00
Steffen Jaeckel
6c39b07bc2
split up again into separate files 2019-06-07 08:28:05 +02:00
Daniel Mendler
4b475aca03
fixes for msvc 2019-05-26 11:47:26 +02:00
Daniel Mendler
bcec605af5
deprecate mp_prime_is_divisible and ltm_prime_tab
* it is an implementation detail used for prime testing
* there is upcoming work by @czurnieden regarding a generalised prime sieve
* furthermore remove jacobi test (replaced by kronecker)
2019-05-24 12:30:55 +02:00