Commit Graph

88 Commits

Author SHA1 Message Date
czurnieden
e8fc3a58db removed code needed for MP_8BIT 2019-10-20 12:38:20 +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
czurnieden
80f5818e0f
Addition of BN_MP_LOG_U32 to tommath_superclass.h 2019-10-19 15:35:04 +02:00
czurnieden
d4f6b43fa8
use of mp_ilogb in mp_radix_size 2019-10-19 15:35:04 +02:00
Daniel Mendler
b4099e1ed2
remove empty bn_deprecated.c file 2019-10-17 16:56:30 +02:00
Daniel Mendler
45a3bf7694
remove deprecated functions 2019-10-17 16:56:27 +02:00
Daniel Mendler
cb1b2dc879
mp_log_u32: return uint32_t 2019-10-15 14:47:43 +02:00
Steffen Jaeckel
c9d41fba73
rename mp_ilogb() to mp_log_u32() 2019-10-15 14:47:43 +02:00
Daniel Mendler
049e2e85e2
add back missing symbols 2019-10-15 14:02:44 +02:00
Daniel Mendler
fe2f91a1b8
to_sbin/to_ubin/pack: don't write anything in case of buffer overflow 2019-10-09 20:46:41 +02:00
czurnieden
b6813a4122
replace mp_export/import by mp_pack/unpack 2019-10-08 22:30:25 +02:00
czurnieden
d68e28771d bugfix for an edgecase 2019-10-06 21:12:04 +02:00
czurnieden
abdb033402 Refactored functions to read and write binaries and added "maxlen" 2019-10-06 03:38:16 +02:00
Steffen Jaeckel
702e5391d0 add function pointers to tommath_class.h 2019-09-07 17:28:16 +02:00
Francois Perrad
49abba0937 refactor with mp_init_multi 2019-09-03 05:30:01 +02:00
Steffen Jaeckel
f0e6ae59ab add mp_to_radix()
...a 100% copy&paste of `mp_toradix_n()` besides the changed API signature
2019-09-02 18:25:44 +02:00
Daniel Mendler
8c1b296e86
add feature detection macro MP_HAS 2019-07-24 11:09:42 +02:00
Daniel Mendler
ca89e9c0ef
rename mp_root/mp_expt to mp_*_u32 2019-07-17 15:45:04 +02:00
Daniel Mendler
71696549a8
deprecate mp_expt_d and mp_n_root in favor of mp_expt and mp_root 2019-07-17 15:45:04 +02:00
nijtmans
0db64fc83c Rename bn_get_magxx -> bn_get_mag_uxx. Documentation updated too 2019-07-03 14:45:14 +02:00
nijtmans
fde8524945 @minad 's suggestions 2019-07-03 12:49:19 +02:00
nijtmans
db4afb3d5e Provide explicit symbols for bn_xxx_l and bn_xxx_ll functions. 2019-07-03 12:49:19 +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
Steffen Jaeckel
0d06d67ef7
generate tommath_class from pre-processed code 2019-06-07 08:28:32 +02:00
Steffen Jaeckel
30e8fbbc8e
Update makefiles etc 2019-06-07 08:28:32 +02:00
Daniel Mendler
c7314fa400
deprecate mp_n_root_ex and mp_expt_d_ex
These functions were introduced to give some timing guarantees.
However the guarantees are too weak to be useful.
The functions seem to be unused essentially by downstream users.
2019-05-27 15:59:40 +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
Daniel Mendler
0a9f5e9bc1
use u32 i64 suffix 2019-05-24 10:21:54 +02:00
Daniel Mendler
b58c996686
use int32 and uint32 instead of sint and uint 2019-05-24 00:15:57 +02:00
Daniel Mendler
3289c9590b
introduce various mp_set_sint/mp_set_uint functions with precise types 2019-05-24 00:15:57 +02:00
Francois Perrad
991aea532f explicit condition 2019-05-22 08:23:37 +02:00
czurnieden
228e487bc4 faster Toom-Cook 3 algorithm 2019-05-21 23:44:13 +02:00
Daniel Mendler
1af0de1f91
deprecate mp_tc_(and|or|xor) in favor of mp_(and|or|xor)
* same behavior for positive numbers
* generalisation for negative numbers, treating them as two complement
* improve algorithm, iterate once over the digits, manually perform two complement
* simplify mp_add_d, mp_sub_d
* functions are safe in case of a==c or b==c
* renamed mp_tc_div_2d to mp_signed_rsh (signed right shift)
2019-05-21 18:28:11 +02:00
Daniel Mendler
6552f55f78
handle EOF condition in mp_fread, fix #163 2019-05-21 18:23:43 +02:00
Francois Perrad
c1f5b06d4b refactor with mp_init_multi 2019-05-20 05:36:08 +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
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
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
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
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
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
Steffen Jaeckel
e05b1e181b fix includes
as of @czurnieden "there's always leftovers" and he's right

that's a leftover of #127
2019-04-12 19:07:08 +02:00
Daniel Mendler
fbfcb66184
apply rename 2019-04-12 14:56:29 +02:00
nijtmans
3afec571e7 Re-generate callgraph and tommath_class.h 2019-04-10 15:19:23 +02:00