tommath_class.h


Log

Author Commit Date CI Message
Daniel Mendler 61ebe7c0 2019-11-07T01:00:13 simplify mod functions
Daniel Mendler 91d88ce3 2019-11-05T20:35:19 fix generate_def, rename some internal files
Daniel Mendler 410bf493 2019-10-29T20:26:50 apply a series of simplifications * this is the final commit of a series of simplifications, containing only the regenerated files and the explanation in the commit message * This is in preparation of the size_t change/a potential representation change to use full width as in tfm, if a (partial?) merge with tfm is desired. These changes have their own merits however. * Remove obfuscating tmpx digit pointers (fewer variables, it is more obvious what is being manipulated) * Reduce scope of variables where possible * Stricter error handling/checking (for example handling in karatsuba was broken) * In some cases the result was written even in the case of an error (e.g. s_mp_is_divisible). This will hide bugs, since the user should check the return value (enforced by MP_WUR). Furthermore if the user accesses the non-initialized result, valgrind will complain for example. Global static analysis like coverity will also detect the issue. Therefore this improves the status quo. * Introduce generic, private MP_EXCH macro which can be used to swap values. * Introduce s_mp_copy_digs/s_mp_zero_digs/s_mp_zero_buf * Some control flow simplifications, e.g, loops instead of goto * Renamings of variables/labels for consistency * Renamings of mul/sqr functions for more consistency, e.g., comba instead of fast suffix * I didn't read through some very complex functions. They are so complex, I am too afraid and lazy to touch them. Maybe someone resposible wants to simplify them if possible. Hint... Hint... - mp_prime_strong_lucas_selfridge.c - s_mp_exptmod.c - s_mp_exptmod_fast.c
Daniel Mendler 7afecabd 2019-10-24T17:33:38 regen files
Daniel Mendler 87b4e517 2019-10-23T09:06:04 move out s_mp_log_pow2, fix limitation of base
czurnieden 9edd185f 2019-10-04T17:41:09 Addition of fast division (recursive divrem only)
Daniel Mendler d8da85a9 2019-10-19T19:54:20 mp_sqrtmod_prime: use mp_set
Daniel Mendler f0c83aea 2019-10-19T19:25:55 split mp_log_u32 for more configurability
czurnieden e8fc3a58 2019-10-19T19:39:29 removed code needed for MP_8BIT
Steffen Jaeckel 7a68f128 2019-10-19T16:24:39 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
czurnieden 80f5818e 2019-10-16T00:31:43 Addition of BN_MP_LOG_U32 to tommath_superclass.h
czurnieden d4f6b43f 2019-10-11T00:29:20 use of mp_ilogb in mp_radix_size
Daniel Mendler b4099e1e 2019-10-16T10:28:28 remove empty bn_deprecated.c file
Daniel Mendler 45a3bf76 2019-10-16T09:21:19 remove deprecated functions
Daniel Mendler cb1b2dc8 2019-10-15T14:04:32 mp_log_u32: return uint32_t
Steffen Jaeckel c9d41fba 2019-10-15T10:40:40 rename mp_ilogb() to mp_log_u32()
Daniel Mendler 049e2e85 2019-10-15T14:02:22 add back missing symbols
Daniel Mendler fe2f91a1 2019-10-09T20:22:11 to_sbin/to_ubin/pack: don't write anything in case of buffer overflow
czurnieden b6813a41 2019-09-27T03:40:08 replace mp_export/import by mp_pack/unpack
czurnieden d68e2877 2019-10-02T05:47:04 bugfix for an edgecase
czurnieden abdb0334 2019-09-25T00:29:19 Refactored functions to read and write binaries and added "maxlen"
Steffen Jaeckel 702e5391 2019-09-06T10:22:45 add function pointers to tommath_class.h
Francois Perrad 49abba09 2019-09-02T18:32:33 refactor with mp_init_multi
Steffen Jaeckel f0e6ae59 2019-09-02T14:36:06 add `mp_to_radix()` ...a 100% copy&paste of `mp_toradix_n()` besides the changed API signature
Daniel Mendler 8c1b296e 2019-04-08T23:48:39 add feature detection macro MP_HAS
Daniel Mendler ca89e9c0 2019-07-03T13:10:05 rename mp_root/mp_expt to mp_*_u32
Daniel Mendler 71696549 2019-05-29T20:36:18 deprecate mp_expt_d and mp_n_root in favor of mp_expt and mp_root
nijtmans 0db64fc8 2019-07-03T14:45:14 Rename bn_get_magxx -> bn_get_mag_uxx. Documentation updated too
nijtmans fde85249 2019-06-13T16:58:06 @minad 's suggestions
nijtmans db4afb3d 2019-06-12T13:11:58 Provide explicit symbols for bn_xxx_l and bn_xxx_ll functions.
Daniel Mendler 3ef6efd3 2019-06-06T23:01:51 sort tommath_class.h dependencies: this makes it easier to see changes
Steffen Jaeckel 0d06d67e 2019-06-06T12:44:36 generate tommath_class from pre-processed code
Steffen Jaeckel 30e8fbbc 2019-06-06T12:09:39 Update makefiles etc
Daniel Mendler c7314fa4 2019-05-25T06:42:01 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.
Daniel Mendler bcec605a 2019-05-22T15:34:49 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)
Daniel Mendler 0a9f5e9b 2019-05-24T10:21:54 use u32 i64 suffix
Daniel Mendler b58c9966 2019-05-23T23:39:47 use int32 and uint32 instead of sint and uint
Daniel Mendler 3289c959 2019-05-20T10:41:06 introduce various mp_set_sint/mp_set_uint functions with precise types
Francois Perrad 991aea53 2019-05-22T08:23:37 explicit condition
czurnieden 228e487b 2019-05-16T23:51:02 faster Toom-Cook 3 algorithm
Daniel Mendler 1af0de1f 2019-05-20T19:11:25 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)
Daniel Mendler 6552f55f 2019-05-20T08:38:25 handle EOF condition in mp_fread, fix #163
Francois Perrad c1f5b06d 2019-05-20T05:36:08 refactor with mp_init_multi
Daniel Mendler f55f0a9e 2019-05-18T09:28:33 fix some usages of enum types
Daniel Mendler a8239c24 2019-05-13T11:32:42 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.
Daniel Mendler 56e7a401 2019-05-13T02:46:11 deprecate mp_jacobi
Daniel Mendler 75e85a73 2019-05-13T11:18:34 move mp_prime_random_ex to bn_deprecated.c
Daniel Mendler 2a2e2716 2019-05-12T11:33:17 move jenkins prng to bn_s_mp_rand_jenkins.c
Daniel Mendler c8cc3657 2019-05-11T09:09:12 mov s_mp_rand_source_platform to separate file
Daniel Mendler 0669e92e 2019-05-08T20:18:53 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.
Daniel Mendler 2a0021a4 2019-05-08T14:57:04 mp_rand: remove superflous mp_clamp
Daniel Mendler 9ddf1e58 2019-05-07T12:26:46 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
Daniel Mendler 2ea04fb7 2019-05-07T10:42:26 dep.pl: strip comments
Daniel Mendler c7596983 2019-05-07T10:28:32 fix dep.pl - use lookahead to only generated dependencies for 'mp_*('
Daniel Mendler 818d8fb7 2019-05-03T17:39:10 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.
Steffen Jaeckel e05b1e18 2019-04-12T19:07:08 fix includes as of @czurnieden "there's always leftovers" and he's right that's a leftover of #127
Daniel Mendler fbfcb661 2019-04-12T14:56:29 apply rename
nijtmans 3afec571 2019-04-10T15:19:23 Re-generate callgraph and tommath_class.h
czurnieden 35311aea 2019-04-03T23:50:57 added function mp_ilogb
czurnieden 27ca25cb 2019-04-06T18:55:43 added multiplcation balancing for the Toom-Cook algorithms
Daniel Mendler ff561404 2019-04-07T15:29:11 shorter headers
Daniel Mendler 70a30ae7 2019-04-07T02:29:28 remove footers
czurnieden 984d3ff6 2019-04-01T03:41:26 changed seed to make nth-root usable
Steffen Jaeckel 58e9084e 2019-04-06T17:38:41 run `make new_file`
czurnieden 769218cc 2019-04-03T18:59:09 additional functions mp_incr and mp_decr
Steffen Jaeckel 646ac880 2019-04-04T07:55:02 update callgraph and tommath_class
Francois Perrad b879bd49 2018-12-31T12:15:44 refactor with new macros IS_*
Francois Perrad 6ce271c4 2018-12-28T09:41:54 mp_iseven & mp_isodd becomes C functions
Francois Perrad 487cbba0 2018-12-28T09:34:02 refactor without macro mp_isneg
Steffen Jaeckel 662a1709 2019-01-15T18:28:31 run `make new_file`
Steffen Jaeckel 1c8c5348 2019-01-15T18:20:24 Merge pull request #147 from czurnieden/moarvm_workarounds workaround for the MoarVM problem with MP_GEN_RAND et al. (cherry picked from commit 11d6e0391421bc996b2cf780f3f4c3fa634001d0)
Steffen Jaeckel c93afda1 2019-01-15T17:05:39 run `make new_file`
czurnieden 08eb995d 2019-01-13T20:21:36 implemented Steffen Jaeckels superior suggestion regarding MoarVM's problem
Steffen Jaeckel 6a9deb79 2018-12-26T15:44:26 fix & run dep.pl
Steffen Jaeckel 18355de6 2018-12-29T17:56:20 Update file headers [skip ci]
czurnieden 3ec93dab 2018-12-12T00:14:05 bugfix in bn_mp_kronecker.c, cleanup and formatting in div. files
Steffen Jaeckel 4f245b04 2018-12-02T21:18:32 Update makefiles etc.
Karel Miko 0493739d 2018-12-02T13:10:09 add missing comments
Mikhail Novosyolov adbadc70 2018-11-18T01:30:51 Fix includes Header files which are located in the same directory that the file from where it is included must be included using `" "`, not `< >`. Otherwise the compiler (gcc 5) cannot understand `#include <tommath_class.h>` in `/usr/include/tommath/tommath.h`.
Daniel Mendler 81cdb9ac 2018-09-10T18:52:29 regenerate files
Daniel Mendler 109bfa57 2018-09-10T18:49:10 regenerate files
czurnieden 22550d41 2018-05-02T22:01:09 Do not use tommath.h from the system for building
czurnieden 9034e712 2018-05-02T21:43:17 Do not use installed headers for building
Francois Perrad 82a2d385 2017-08-30T05:56:38 refactor indentation of preprocessor directives
Steffen Jaeckel 49e54320 2017-08-28T16:59:11 update tommath_class.h
Steffen Jaeckel 3ab918e7 2017-04-09T01:00:00 update tommath_class.h
Steffen Jaeckel 1f889479 2015-04-18T11:03:22 update makefiles etc.
Steffen Jaeckel d4cccd52 2014-12-10T18:59:56 udpate makefiles etc.
Steffen Jaeckel cf045216 2014-12-10T17:21:14 update makefiles etc.
Steffen Jaeckel d7171985 2014-10-18T18:56:56 update after removing balance multiplication
Steffen Jaeckel b425b0ea 2014-10-18T18:54:06 Revert "balancing multiplication like that in Ruby 1.9" This reverts commit e68439aae10d003250afa6c1f57025bfee5f82ed. Conflicts: bn_mp_balance_mul.c makefile
Steffen Jaeckel 52cfd5ff 2014-02-14T11:26:07 mp_n_root: add mp_n_root_ex() with parameter 'fast' for mp_expt_d_ex() This change is introduced to be able to choose the underlying implementation of mp_expt_d_ex() The implementation of the root_n functionality is now implemented in the mp_n_root_ex() function. The parameter 'fast' is just passed over to mp_expt_d_ex(). mp_n_root() defaults to the pre 921be35779f7d71080ad85c27ed58671602d59b3 implementation
Steffen Jaeckel e9b1837c 2014-02-13T20:21:18 mp_expt_d: bring back pre 921be35779f7d71080ad85c27ed58671602d59b3 state The implementation of the expt_d functionality is now implemented in the mp_expt_d_ex() function. The user can now choose between the old (more timing resistant) version and the new version by modification of the parameter 'fast'. mp_expt_d() defaults to the old version
Steffen Jaeckel c8202864 2014-01-22T17:53:34 add missing updates
lomereiter e68439aa 2011-05-23T19:44:05 balancing multiplication like that in Ruby 1.9
Christopher Brown 3e1ae078 2013-01-22T21:29:12 added mp_import / mp_export
Tom St Denis 9294e791 2005-08-01T16:37:28 added libtommath-0.36
Tom St Denis fdfa2f4f 2005-03-12T11:55:11 added libtommath-0.35
Tom St Denis 3d0fcaab 2005-02-12T08:40:15 added libtommath-0.34
Tom St Denis 4b7111d9 2004-12-23T02:40:37 added libtommath-0.33