tommath_private.h

Branch


Log

Author Commit Date CI Message
Steffen Jaeckel 34e16d3c 2020-09-13T19:06:43 allow testing of shared library * move jenkins' prng out of the library into the demo's. * add CI test for shared library
Sizhe Zhao 56dc9df1 2020-04-26T11:36:28 Add _M_IX86 for testing for MSVC x86
Steffen Jaeckel c1cf8073 2020-03-05T13:57:07 introduce MP_HAS_SET_DOUBLE
Daniel Mendler 08d281c4 2019-12-05T00:48:25 introduce MP_MAX_DIGIT_COUNT to prevent overflow
czurnieden 1e65c0bf 2019-10-11T00:06:45 Introduction of a fast but slightly over-estimating radix_size
Daniel Mendler f0ab662f 2019-11-22T16:01:42 do not use long long for minimum prec calculation, improve comment
Daniel Mendler f6a7bedb 2019-10-29T20:52:29 suffix _u32 -> _n of mp_(expt|log|root) functions, use int for now
nijtmans 1cc289d2 2019-11-09T20:23:03 better use of mp_isneg() and mp_iszero()
Daniel Mendler 6777baaf 2019-11-06T16:59:51 add macro MP_IS_2EXPT
Daniel Mendler 4f00e75b 2019-11-06T16:51:51 make mp_div_3 private
Daniel Mendler 91d88ce3 2019-11-05T20:35:19 fix generate_def, rename some internal files
nijtmans bbb17808 2019-10-30T14:19:50 mp_radix off-by-one error and other related code-cleanup
Daniel Mendler 93f8e760 2019-11-05T18:04:05 rename MP_MAXFAST to MP_MAX_COMBA
Daniel Mendler 5c335f84 2019-10-30T17:26:27 rename mul/sqr functions for consistency, comba instead of fast suffix
Daniel Mendler 795cd201 2019-10-29T21:48:50 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.
Daniel Mendler 448f35e2 2019-10-29T20:07:29 simplifications: prime functions
Daniel Mendler 2bbdbd06 2019-11-03T16:55:35 MP_MIN_PREC>=3 is needed for s_mp_div_school test with MP_PREC=MP_MIN_PREC
Daniel Mendler 3cdcec43 2019-10-29T18:41:25 first batch of simplifications
Daniel Mendler a5d5b101 2019-10-27T23:51:38 mp_read_radix and mp_fread should behave the same
Daniel Mendler bf9507a9 2019-10-24T22:02:29 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
Daniel Mendler 58fb93fd 2019-10-24T18:14:18 cleanup prime rand function
Daniel Mendler a44e68e6 2019-10-24T17:43:31 remove MP_IS_* macros
Daniel Mendler f8b2f5d6 2019-10-23T20:07:33 s_mp_reverse is only used by mp_to_radix
Francois Perrad 814d0387 2019-10-22T17:54:33 literal suffix
Francois Perrad f2efe746 2019-10-22T17:53:27 more cast
nijtmans a8ca1c3c 2019-10-25T13:02:45 fix win32 includes, remove support for everything older than Windows XP
Francois Perrad 90516948 2019-10-24T18:11:36 literal suffix
Francois Perrad d0e26bb3 2019-10-24T18:26:25 explicit operator precedence
Daniel Mendler 87b4e517 2019-10-23T09:06:04 move out s_mp_log_pow2, fix limitation of base
Daniel Mendler 14642642 2019-10-22T18:01:08 add prefix to cutoff variables
Daniel Mendler 00b263f3 2019-10-22T17:52:26 remove private_mp_word
czurnieden 9edd185f 2019-10-04T17:41:09 Addition of fast division (recursive divrem only)
Steffen Jaeckel d06e2986 2019-10-22T11:47:42 Merge tag 'v1.2.0' into develop v1.2.0
Daniel Mendler f0c83aea 2019-10-19T19:25:55 split mp_log_u32 for more configurability
Daniel Mendler 5c6391dd 2019-10-19T18:35:57 remove some MP_8BIT remnants
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
nijtmans 3eaa268e 2019-10-18T10:00:09 Adapt mingw-build of libtommath.dll to respect internal symbols too
Daniel Mendler 42ebcbfe 2019-10-16T10:08:15 enable MP_PRIVATE (visibility=hidden)
nijtmans 7bba19e0 2019-10-18T14:53:42 Add comment
nijtmans 785e32eb 2019-10-18T14:35:08 Move disabling of warning C4003 from makefile.msvc to tommath_private.h
Daniel Mendler 20dcc923 2019-10-17T16:59:02 rename internal constant radix arrays
Daniel Mendler 45a3bf76 2019-10-16T09:21:19 remove deprecated functions
Daniel Mendler fce429d0 2019-07-24T15:54:01 tommath.h: do not expose limits.h
Francois Perrad b1975063 2019-10-10T20:15:13 use literal char
czurnieden b6813a41 2019-09-27T03:40:08 replace mp_export/import by mp_pack/unpack
czurnieden abdb0334 2019-09-25T00:29:19 Refactored functions to read and write binaries and added "maxlen"
Francois Perrad 8cf0d3db 2019-09-07T12:28:26 literal suffix
Daniel Mendler 625defdc 2019-05-31T11:31:53 fix gcc version check for deprecations
Daniel Mendler 8c1b296e 2019-04-08T23:48:39 add feature detection macro MP_HAS
nijtmans 91b113cb 2019-06-12T13:44:59 Macro consistancy: Always use function-name as first parameter and type(s) last, as in SET macro's
Daniel Mendler 8cf43639 2019-06-06T23:14:15 MP_SET_SIGNED: add utype parameter
Daniel Mendler 5302b907 2019-06-06T21:06:06 use MP_SIZEOF_BITS
Steffen Jaeckel a3637457 2019-06-06T11:48:42 change macros to contain types
Steffen Jaeckel 6c39b07b 2019-06-06T11:44:02 split up again into separate files
Daniel Mendler 4b475aca 2019-05-26T09:29:58 fixes for msvc
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 c7a7bd47 2019-05-23T16:37:34 MP_PREC is an internal macro, it should be defined in tommath_private.h
Daniel Mendler 3289c959 2019-05-20T10:41:06 introduce various mp_set_sint/mp_set_uint functions with precise types
Daniel Mendler 18f6e464 2019-05-23T16:00:31 add MP_STATIC_ASSERT
Francois Perrad 330b980d 2019-05-18T11:55:27 literal char
Francois Perrad 8d73e158 2019-05-18T12:37:54 literal suffix
Francois Perrad a4f9818b 2019-05-18T12:36:45 more cast
Daniel Mendler bd8f7e55 2019-05-20T06:57:20 introduce MP_PRIVATE to hide symbols (opt-in for now)
Daniel Mendler 0dfa9da5 2019-05-19T12:53:49 make tommath_class.h and tommath_superclass.h private These headers are used for configuration during build time. Therefore they shouldn't be exposed as part of the public API.
Daniel Mendler 6631d426 2019-05-19T10:05:15 remove __cplusplus stuff from tommath_private.h tommath_private.h is an internal header which won't be included by a C++ source file.
Daniel Mendler 0b840b78 2019-05-17T20:53:24 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.
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 668cda01 2019-05-13T19:18:09 remove unnecessary duplication of multiplication
Daniel Mendler 334c32e0 2019-05-13T18:08:03 fix signature
Daniel Mendler 0b73dab6 2019-05-13T15:04:30 MP_FREE_DIGITS: add missing cast
Daniel Mendler 4534056c 2019-05-13T00:22:18 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
Francois Perrad 38116079 2019-05-13T17:51:07 literal suffix
Francois Perrad 3c5afa91 2019-05-13T17:34:12 add missing parameter name in prototype
Francois Perrad fa2d86af 2019-05-13T03:27:02 explicit operator precedence
Francois Perrad 07aaa4c3 2019-05-13T03:48:20 explicit condition
Francois Perrad 783e3cdf 2019-05-13T03:47:24 format block macros
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 7365442a 2019-05-10T23:59:46 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
Daniel Mendler 61d9e528 2019-05-11T10:22:20 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
Daniel Mendler adf9605d 2019-05-09T03:28:49 add warn_unused_result, found one missing check!
Francois Perrad cc703a84 2019-05-11T12:09:59 add missing parameter name in prototype
Francois Perrad 7d4e8363 2019-05-08T19:43:21 refactor with new private macro MP_MAXFAST
Francois Perrad 556219aa 2019-05-09T22:07:13 refactor with new private macro MP_SIZEOF_BITS CHAR_BIT is no longer directly used
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 250751be 2019-05-07T09:32:59 tommath.h: do not expose stdlib.h
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.
Daniel Mendler 90eccd57 2019-04-25T15:36:35 prefix private macros by PRIVATE_
Daniel Mendler 632601f4 2019-04-13T17:34:11 MP_WARRAY is an internal macro
Daniel Mendler e45f75fd 2019-04-13T08:46:57 deprecate DIGIT_BIT, use MP_DIGIT_BIT
Daniel Mendler a8c76138 2019-04-12T21:15:56 deprecate macros in tommath.h * move MP_DEPRECATED to tommath.h since we need it later * add MP_DEPRECATED_PRAGMA
Daniel Mendler fbfcb661 2019-04-12T14:56:29 apply rename
Daniel Mendler 7469e852 2019-03-07T04:02:32 add rename script
Daniel Mendler 87292ed1 2019-04-09T12:19:40 move mp_balance_mul to tommath_private.h
Daniel Mendler df8fcb0e 2019-04-09T11:18:23 add MP_DEPRECATED macro
Daniel Mendler e09a5c99 2019-04-09T11:10:57 remove s_mp_mul which is only used once
Daniel Mendler c4fb2241 2019-04-09T11:08:26 rename macros in tommath_private to use MP_* prefix
Francois Perrad 42193f89 2019-04-09T20:26:08 explicit operator precedence