Commit Graph

176 Commits

Author SHA1 Message Date
Daniel Mendler
14642642f9
add prefix to cutoff variables 2019-10-23 18:21:57 +02:00
Steffen Jaeckel
3180c66ca6 also use MP_YES/NO in tests 2019-10-23 18:17:20 +02:00
czurnieden
9edd185f66 Addition of fast division (recursive divrem only) 2019-10-22 21:02:18 +02:00
Daniel Mendler
a29aa59baa
use size_t for mp_radix_size 2019-10-22 14:25:58 +02:00
Francois Perrad
485be9de79 explicit condition 2019-10-20 17:31:04 +02:00
Francois Perrad
3995ece51b const parameter 2019-10-20 17:30:55 +02:00
Francois Perrad
315975db7a remove useless initialization 2019-10-20 17:30:50 +02:00
Francois Perrad
7f05df0a80 const parameter 2019-10-20 17:30:47 +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
36fca2f9a0
remove support for 8-bit (MP_8BIT) 2019-10-19 16:03:26 +02:00
czurnieden
d4f6b43fa8
use of mp_ilogb in mp_radix_size 2019-10-19 15:35:04 +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
Steffen Jaeckel
1cc02f2d88
fix build of timing.c 2019-10-15 14:47:43 +02:00
Daniel Mendler
b4f7d8d4c8
test: use malloc/free
tests are library consumers, MP_MALLOC is an internal macro
2019-10-09 20:46:44 +02:00
Daniel Mendler
6e3dae5625
add MP_BUF error 2019-10-08 22:30:29 +02:00
czurnieden
b6813a4122
replace mp_export/import by mp_pack/unpack 2019-10-08 22:30:25 +02:00
czurnieden
71d1b7b9d8 make mp_to_radix return the count of characters of the converted number 2019-10-06 21:26:49 +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
4ebdaca223 "fix" warnings 2019-10-05 19:47:24 +02:00
Steffen Jaeckel
baff51e9f2 allow to run specific timing tests 2019-10-05 19:47:24 +02:00
Steffen Jaeckel
47ab9c60d8 fix printf 2019-10-05 19:47:24 +02:00
Steffen Jaeckel
f8d64c645a create mtest_opponent instead of alt version of test 2019-09-30 23:44:49 +02:00
Steffen Jaeckel
234d474fe6 only run tests if the module is available 2019-09-07 17:28:16 +02:00
Steffen Jaeckel
75c52a893b be nice and tell when it's hex output
did you know that 0x35 is equal to 53? ... ;-)
2019-09-07 17:28:16 +02:00
Steffen Jaeckel
54661db6a4 allow RSA superclass to be built with tests 2019-09-07 17:28:16 +02:00
Steffen Jaeckel
9eecab7b49 print jenkins seed on startup
I just had a case around where the `mp_prime_rand()` testcase failed
but I couldn't reproduce.
I'm pretty sure that was caused by all my changes and partial rebuilds
but anyways it'll give us in the future the possibility to debug such
a case.
2019-09-07 17:28:16 +02:00
Steffen Jaeckel
72f9251939 fix last occurrences of mp_toradix() 2019-09-03 11:08:56 +02:00
czurnieden
8bb11ded99 included tests for mp_prime_next_prime 2019-09-02 21:25:22 +02:00
Steffen Jaeckel
6cd570d08b use mp_to_radix etc. 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
ea3353b673 Simplify test-cases, by using mp_set_l. Also fix use of types in 2 other files 2019-06-13 15:44:00 +02:00
Daniel Mendler
5302b907ff
use MP_SIZEOF_BITS 2019-06-07 08:28:32 +02:00
nijtmans
dfbb5ecd56 MSVC compile: higher warning-level -Wall, but warning-free 2019-06-06 16:22:54 +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
Steffen Jaeckel
0e1a0e6529 also test mp_shrink() 2019-05-27 15:34:53 +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
d7e1cb4a09
another proposal: use _ul and _l for the long macros 2019-05-24 00:15:57 +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
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
0b840b78a3
make mp_word private
mp_word is an internal type and it is problematic if it is exposed
in the public api. See for example #216 - MSVC does not support 128 bit
mp_words. But it is perfectly ok to use those internally in the library,
as long as the library is compiled with GCC.
2019-05-21 15:34:04 +02:00
czurnieden
03ca7bcdae added tests for Karatsuba and Toom-Cook 3-way 2019-05-21 15:21:39 +02:00
Steffen Jaeckel
51cda5b82b use correct amount of MR trials in tests 2019-05-21 09:48:48 +02:00