Commit Graph

169 Commits

Author SHA1 Message Date
Daniel Mendler
cf0042654e
define mp_isodd in terms of mp_iseven 2019-10-27 18:36:56 +01:00
Daniel Mendler
17a846f2bc
add "make c99" to convert back 2019-10-27 18:36:56 +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
27e142bc43
remove unnecessary == MP_YES/MP_NO comparisons 2019-10-27 18:36:55 +01:00
Daniel Mendler
eb70378bfb
mp_iseven/mp_isodd should be inline 2019-10-27 18:36:55 +01:00
Daniel Mendler
f21ea6ce18
add fast path to mp_add_d and mp_sub_d 2019-10-27 18:36:53 +01: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
Daniel Mendler
31e64aa640
mp_prime_next_prime: use mp_bool for bbs_style 2019-10-23 18:14:55 +02:00
Daniel Mendler
a29aa59baa
use size_t for mp_radix_size 2019-10-22 14:25:58 +02:00
Daniel Mendler
5c6391dd7c
remove some MP_8BIT remnants 2019-10-20 15:39:09 +02:00
Francois Perrad
b34aac09cb remove extraneous comma 2019-10-20 14:34:05 +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
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
Daniel Mendler
554310847a
tommath.h: use enums 2019-10-16 09:32:37 +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
Francois Perrad
e3eb13e4b6 use same parameter name as in the prototype 2019-10-10 20:32:57 +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
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
abdb033402 Refactored functions to read and write binaries and added "maxlen" 2019-10-06 03:38:16 +02:00
czurnieden
6b0caef471 add message that MP-8BIT is deprecated 2019-09-09 15:55:45 +02:00
nijtmans
bbe268ebd2 Fix deprecation messages and unnecessary includes 2019-09-03 10:53:40 +02:00
Steffen Jaeckel
684426b670 add new conversion macros 2019-09-02 18:25:44 +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
625defdcff
fix gcc version check for deprecations 2019-07-24 11:09:44 +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
Joachim Breitner
6c35dd7e11
Import stddef in tommath.h
At least here (compiling for WebAssembly
(`wasm32-unknown-unknown-wasm`), I need this, otherwise `size_t` is not
available.
2019-07-17 15:39:57 +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
nijtmans
a911999db9 Better interoperability between MSVC and mingw-w64, 3 2019-06-06 10:30:00 +02:00
nijtmans
ab309de02f Fix MSVC warning: bn_mp_rand.c(9): warning C4028: formal parameter 1 different from declaration 2019-06-05 14:50:12 +02:00
H.Merijn Brand - Tux
f5b6cd079e Fix building on HP-UX 11.11 / PA-RISC
$ perl -v
This is perl 5, version 28, subversion 2 (v5.28.2) built for PA-RISC2.0-thread-multi-LP64

$ perl Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for CryptX
Writing MYMETA.yml and MYMETA.json

$ make
:
:
gcc64 -Iltm -Iltc/headers -DLTC_SOURCE -DLTC_NO_TEST -DLTC_NO_PROTOTYPES -DLTM_DESC -D_POSIX_C_SOURCE=199506L -D_REENTRANT -mpa-risc-2-0 -fPIC -D_HPUX_SOURCE -fwrapv -fno-strict-aliasing -pipe -I/usr/local/pa20_64/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -fPIC -g -O -DARGTYPE=4 -c ltc/math/ltm_desc.c -o ltc/math/ltm_desc.o
In file included from ltc/math/ltm_desc.c:15:0:
ltm/tommath.h:74:1: error: unable to emulate 'TI'
make[1]: *** [ltc/math/ltm_desc.o] Error 1
make[1]: Leaving directory `/data/cpan-build/CryptX-0.063-0/src'
make: *** [src/liballinone.a] Error 2

$ gcc64 --version
gcc64 (GCC) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ perl -V:cppsymbols
cppsymbols='_FILE_OFFSET_BITS=64 _HPUX_SOURCE=1 _LARGEFILE_SOURCE=1 _LFS64_LARGEFILE=1 _LFS_LARGEFILE=1 _LP64=1 _PA_RISC2_0=1 _POSIX_C_SOURCE=199506L _PROTOTYPES= _REENTRANT=1 _XOPEN_SOURCE_EXTENDED=1 _XPG4= _XPG4_EXTENDED= __BYTE_ORDER__=4321 __ELF__=1 __GNUC_MINOR__=6 __GNUC__=4 __LP64__=1 __PIC__=2 __STDC_EXT__=1 __STDC__=1 __hp9000s700=1 __hp9000s700__=1 __hp9000s800=1 __hp9000s800__=1 __hppa=1 __hppa__=1 __hpux=1 __hpux__=1 __pic__=2 __unix=1 __unix__=1';
2019-06-05 09:40:33 +02:00
Steffen Jaeckel
0ebc4f9268 fix MP_DEPRECATED for non-gcc, -clang or -msvc 2019-06-05 09:40:10 +02:00
Francois Perrad
25ff85d2bf move cast inside macro 2019-05-29 08:16:46 +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
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
Daniel Mendler
c7a7bd47af
MP_PREC is an internal macro, it should be defined in tommath_private.h 2019-05-24 12:26:50 +02:00
Daniel Mendler
b0938d70f3
remove obsolete comment 2019-05-24 11:57:47 +02:00
Daniel Mendler
9f607dd5eb
disallow defining MP_DIGIT_BIT, only allow MP_8/16/31/32/64BIT 2019-05-24 11:57:47 +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