Commit Graph

138 Commits

Author SHA1 Message Date
Steffen Jaeckel
7b2acf54d9 add fp_rand() docs 2017-04-04 00:56:13 +02:00
Steffen Jaeckel
1404af6262 allow external define of FP_GEN_RANDOM 2017-04-04 00:45:06 +02:00
Steffen Jaeckel
8e034dcf6e add FP_GEN_RANDOM logic as in libtommath 2017-03-30 16:15:35 +02:00
Steffen Jaeckel
637dfe6d44 send travis notifications to #libtom-notifications 2017-03-30 15:48:24 +02:00
Steffen Jaeckel
fb62c9cde8 add fp_rand to exported symbols 2017-03-22 19:38:22 +01:00
sebastianas
2304adbcbd Merge pull request #12 from mtausig/fix/include
Add missing include (prevent compiler warning)
2016-11-09 21:54:59 +01:00
Mathias Tausig
3eaee499a4 Add missing include (prevent compiler warning) 2016-10-25 11:13:07 +02:00
Reiner Herrmann
81aeb56951 Sort object files for deterministic linking order
This is from the Debian reproducible team.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2016-07-24 22:06:03 +02:00
Sebastian Andrzej Siewior
86acd501a4 makefile.shared: remove --silent argument
Remove the --silent argument from libtool so the build-log scanner does
complain about "compiler-flags-hidden 2"

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2016-07-24 22:05:55 +02:00
Sebastian Andrzej Siewior
2474e62247 Merge branch 'master' into develop 2016-07-24 22:02:57 +02:00
Steffen Jaeckel
b3cd60a4d8 add COMPILE_DEBUG option to makefile 2016-04-24 18:39:35 +02:00
Steffen Jaeckel
02c712c437 add silent compilation as in ltc and ltm 2016-04-24 18:38:28 +02:00
Steffen Jaeckel
6ae4762482 add 'uninstall' make target 2016-04-24 18:37:17 +02:00
Steffen Jaeckel
a5e8652fb1 fix headers in makefile.shared 2016-04-24 18:36:51 +02:00
Steffen Jaeckel
ca5b6823d0 show develop build state in readme
[skip ci]
2016-04-24 14:09:33 +02:00
Sebastian Andrzej Siewior
dac0895159 tfm: make a few functions static
clamav expects them to be static and it does not seem bad to do so.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2016-04-24 14:00:15 +02:00
Sebastian Andrzej Siewior
09c7b2dce0 tfm: make a few functions static
clamav expects them to be static and it does not seem bad to do so.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2015-12-17 21:26:31 +01:00
Steffen Jaeckel
d5795fda35 convert line-endings for the zip archive 2015-11-07 16:29:41 +01:00
Steffen Jaeckel
cb476584f2 create xz archives instead of bz2 2015-11-07 16:29:29 +01:00
Steffen Jaeckel
64c52efd6f start development on next version 2015-11-07 16:28:23 +01:00
Steffen Jaeckel
2bb1d4dd2c Merge tag 'v0.13.0' into develop
This is the v0.13.0 release
2015-10-24 14:57:39 +02:00
Steffen Jaeckel
5c395e04e6 Merge branch 'release/0.13.0' 2015-10-24 14:56:46 +02:00
Steffen Jaeckel
a170b64106 update changes again 2015-10-24 14:55:17 +02:00
Steffen Jaeckel
ea6098feea add tfm_private.h to headers, but only install tfm.h 2015-10-07 15:13:23 +02:00
Steffen Jaeckel
24ef85f9e9 trim trailing spaces in mpi.c 2015-10-07 15:13:03 +02:00
Sebastian Andrzej Siewior
f7e7f83718 provide tfm_private.h
tfm.h contains declarations for the public part of the library.
tfm_private.h contains the function which are private to tfm and should
not be exposed to the public.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2015-08-16 22:04:51 +02:00
Sebastian Andrzej Siewior
24d98570b0 define FP_64BIT on 64bit architectures
This should enable 64bit math on 64bit architecures besides amd64 (like
ppc64, sparc64 and so on)

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2015-08-16 15:27:31 +02:00
Steffen Jaeckel
993d85de7f as of [1] we have to use this version
[1] https://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
2015-08-07 10:51:36 +02:00
Steffen Jaeckel
8fc411f97a update tfm.pdf 2015-08-07 01:03:32 +02:00
Steffen Jaeckel
1f1fafe7fb bump version 2015-08-07 01:03:23 +02:00
Steffen Jaeckel
787ebd1507 update changes 2015-08-07 01:02:01 +02:00
Steffen Jaeckel
1b92bb399b update pre_gen/mpi.c 2015-08-06 20:45:00 +02:00
Steffen Jaeckel
725032ccf8 makefile: update zipup target 2015-08-06 19:54:38 +02:00
Steffen Jaeckel
229f1f890b update .gitignore 2015-04-25 15:25:56 +02:00
Steffen Jaeckel
846d7f36eb add version information 2015-04-25 15:25:42 +02:00
Steffen Jaeckel
6db706e857 bring back __DATE__ to fp_ident(), but it's disabled by default 2015-04-25 15:10:33 +02:00
Sebastian Andrzej Siewior
8ea169937d drop __DATE__ from fp_ident
To meet Debian's reproducible builds [0] goal I remove the __DATE__
macro.
In case this is not acceptable because the date of build is _really_
important / required I could come with a ifdef or something else.

[0] https://wiki.debian.org/ReproducibleBuilds

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2015-04-25 14:59:37 +02:00
Sebastian Andrzej Siewior
f0f92f033e Add symbols files
Export only used symbols and keep implemetations details hidden.
Stripped away symbols are:

fp_mul_comba20, fp_mul_comba24, fp_mul_comba28, fp_mul_comba32, fp_mul_comba48,
fp_mul_comba64, fp_mul_comba, fp_mul_comba_small, fp_prime_miller_rabin,
fp_sqr_comba20, fp_sqr_comba24, fp_sqr_comba28, fp_sqr_comba32, fp_sqr_comba48,
fp_sqr_comba64, fp_sqr_comba, fp_sqr_comba_small, s_fp_add, s_fp_sub,
fp_reverse, fp_s_rmap

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2015-04-25 14:58:23 +02:00
Sebastian Andrzej Siewior
c7ce75f920 use LDFLAGS in the link command
required for the hardening flags

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2015-04-25 14:25:56 +02:00
Sebastian Andrzej Siewior
5d83c4e5ab tfm: use unsigned int for fp_digit on !FP_64BIT
There is a bugzilla entry at clamav [0] reports a problem on s390x
  "mul/fp_mul_comba_20.c:91: warning: right shift count >= width of type"
because fp_digit is 64bit and according to the comment it should be
smaller.
s390x is 64bit platform i.e. long and long long are both 64bit. The
same is true for ppc64, arm64 or sparc64 (RIP alpha).

The headerfile seems only to define FP_64BIT on x86_64.
The current code seems to define SIZEOF_FP_DIGIT either to 8 (64bit) or
to 4 in the else case and 4 looks like int and not long. Therefore the
change here.

If this change makes no sense and you would prefer to use something like
    #if __SIZEOF_LONG__ == 8
       #define FP_64BIT
    #endif

to autodetect a 64bit platform then we could try do this instead. I
haven't tested this patch nor verified that the problem still occures.

If you have no obvious solution and would like to have a confirmation
that this patch solves a problem I could try to get my hands on
something not x86 with 64bit in order to verify.

[0] https://bugzilla.clamav.net/show_bug.cgi?id=9017

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2015-04-25 14:22:35 +02:00
Steven Morgan
522a092ffb fp_ident: fix incorrect length in strncat() call.
strncat' last argument is the remaining size of the buffer given in the
first argument, not the total buffer length.

Reported-by: contact@oppida.fr via clamav #11166
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2015-04-25 14:22:34 +02:00
David Raynor
060b2c5697 s_fp_add: completely init c after add
This was reported in clamav via a "coverity report" #11125/#11126. I can't
get the coverity report and I've been told that

|< linnatic> bigeasy: unfortunately, I can't get you the coverity report
|< linnatic> bigeasy: but it does seem that the patch is not
|required as the possible coverity issue is unlikely to occur

so if you thing that this patch is not required (which is what I assume) then
please drop that patch, I just added since it was in the clamav tree…

[sebastian@breakpoint: patch description]
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2015-04-25 14:22:34 +02:00
Sebastian Andrzej Siewior
6fbf2ba87d fp_toradix_n: make sure too small strings are recognized
If maxlen is too small then we get FP_OKAY as return value but not
everything is part of the string. This patch changes it so that the
caller learns about this short comming.

While at it, drop the doxygen style comment. It is the only of his kind
and does no longer match the code.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2015-04-25 14:22:34 +02:00
Steffen Jaeckel
e0fe602802 Merge pull request #9 from pattop/master
ppc32: fix fp_montgomery_reduce assembly
2015-04-25 14:22:22 +02:00
Patrick Oppenlander
c9ae4c70d4 ppc32: fix fp_montgomery_reduce assembly
Previous patch modified constraints from =m to =g. Turns out this also
allows registers which doesn't work with the inline assembly
instructions.

If we change back to =m GCC 5.0 warns that constraints do not allow a
register.

In order to work around these issues we now pass the arguments in
registers and let GCC handle the loading & storing.
2015-04-17 10:18:45 +10:00
Steffen Jaeckel
9fe2d66519 Merge pull request #8 from jwillemsen/master
Replace spaces with tab to file GNU make problems
2015-02-26 12:49:39 +01:00
Johnny Willemsen
52932db932 Replace spaces with tab to file GNU make problems 2015-02-26 09:17:20 +01:00
Steffen Jaeckel
87aa730c59 testme: fix traps 2015-02-15 23:40:45 +01:00
Steffen Jaeckel
dde4fbd881 makefiles: update with new file 2015-02-15 23:33:11 +01:00
Steffen Jaeckel
e4f8c04da6 fp_toradix[_n]: revise and split up 2015-02-15 23:33:11 +01:00