From 85f6e6d6703eee90e02bfa6a4ca27188f49fe8e3 Mon Sep 17 00:00:00 2001 From: Asanka Herath Date: Wed, 26 May 2010 12:17:30 -0400 Subject: [PATCH] Build Tom's fast math library on Windows --- lib/hcrypto/NTMakefile | 14 +++- lib/hcrypto/tomsfastmath/NTMakefile | 162 ++++++++++++++++++++++++++++++++++++ windows/NTMakefile.w32 | 1 + 3 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 lib/hcrypto/tomsfastmath/NTMakefile diff --git a/lib/hcrypto/NTMakefile b/lib/hcrypto/NTMakefile index 7f1a6fc72..89b002cf0 100644 --- a/lib/hcrypto/NTMakefile +++ b/lib/hcrypto/NTMakefile @@ -29,12 +29,22 @@ # POSSIBILITY OF SUCH DAMAGE. # +SUBDIRS=tomsfastmath + RELDIR=lib\hcrypto AUXCFLAGS=$(AUXCFLAGS) -DKRB5 -I$(HCRYPTOINCLUDEDIR) !include ../../windows/NTMakefile.w32 +# Do dependencies first + +all:: subdirs + +clean:: clean-subdirs + +test:: test-subdirs + # Include files HCRYPTOINCLUDEDIR=$(INCDIR)\hcrypto @@ -108,6 +118,7 @@ libhcrypto_OBJs = \ $(OBJ)\rsa.obj \ $(OBJ)\rsa-gmp.obj \ $(OBJ)\rsa-imath.obj \ + $(OBJ)\rsa-tfm.obj \ $(OBJ)\sha.obj \ $(OBJ)\sha256.obj \ $(OBJ)\ui.obj @@ -116,7 +127,7 @@ libhcrypto_OBJs = \ $(LIBHCRYPTO): $(BINDIR)\libhcrypto.dll -$(BINDIR)\libhcrypto.dll: $(libhcrypto_OBJs) $(LIBROKEN) $(LIBASN1) +$(BINDIR)\libhcrypto.dll: $(libhcrypto_OBJs) $(LIBROKEN) $(LIBASN1) $(LIBTFM) $(DLLGUILINK) -def:libhcrypto-exports.def -implib:$(LIBHCRYPTO) $(DLLPREP) @@ -258,3 +269,4 @@ test-run: cd $(SRCDIR) test:: $(TESTLIB) test-binaries test-run + diff --git a/lib/hcrypto/tomsfastmath/NTMakefile b/lib/hcrypto/tomsfastmath/NTMakefile new file mode 100644 index 000000000..fc75b6c23 --- /dev/null +++ b/lib/hcrypto/tomsfastmath/NTMakefile @@ -0,0 +1,162 @@ +######################################################################## +# +# Copyright (c) 2009, Secure Endpoints Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +RELDIR=lib\hcrypto\tomsfastmath + +!include ../../../windows/NTMakefile.w32 + +INCFILES=$(INCDIR)\tfm.h + +libtfm_OBJs= \ + $(OBJ)\fp_add.obj \ + $(OBJ)\fp_add_d.obj \ + $(OBJ)\fp_addmod.obj \ + $(OBJ)\fp_cmp.obj \ + $(OBJ)\fp_cmp_d.obj \ + $(OBJ)\fp_cmp_mag.obj \ + $(OBJ)\fp_sub.obj \ + $(OBJ)\fp_sub_d.obj \ + $(OBJ)\fp_submod.obj \ + $(OBJ)\s_fp_add.obj \ + $(OBJ)\s_fp_sub.obj \ + $(OBJ)\fp_radix_size.obj \ + $(OBJ)\fp_read_radix.obj \ + $(OBJ)\fp_read_signed_bin.obj \ + $(OBJ)\fp_read_unsigned_bin.obj \ + $(OBJ)\fp_reverse.obj \ + $(OBJ)\fp_s_rmap.obj \ + $(OBJ)\fp_signed_bin_size.obj \ + $(OBJ)\fp_to_signed_bin.obj \ + $(OBJ)\fp_to_unsigned_bin.obj \ + $(OBJ)\fp_toradix.obj \ + $(OBJ)\fp_unsigned_bin_size.obj \ + $(OBJ)\fp_cnt_lsb.obj \ + $(OBJ)\fp_count_bits.obj \ + $(OBJ)\fp_div_2.obj \ + $(OBJ)\fp_div_2d.obj \ + $(OBJ)\fp_lshd.obj \ + $(OBJ)\fp_mod_2d.obj \ + $(OBJ)\fp_rshd.obj \ + $(OBJ)\fp_div.obj \ + $(OBJ)\fp_div_d.obj \ + $(OBJ)\fp_mod.obj \ + $(OBJ)\fp_mod_d.obj \ + $(OBJ)\fp_2expt.obj \ + $(OBJ)\fp_exptmod.obj \ + $(OBJ)\fp_ident.obj \ + $(OBJ)\fp_set.obj \ + $(OBJ)\fp_montgomery_calc_normalization.obj \ + $(OBJ)\fp_montgomery_reduce.obj \ + $(OBJ)\fp_montgomery_setup.obj \ + $(OBJ)\fp_mul.obj \ + $(OBJ)\fp_mul_2.obj \ + $(OBJ)\fp_mul_2d.obj \ + $(OBJ)\fp_mul_comba.obj \ + $(OBJ)\fp_mul_comba_12.obj \ + $(OBJ)\fp_mul_comba_17.obj \ + $(OBJ)\fp_mul_comba_20.obj \ + $(OBJ)\fp_mul_comba_24.obj \ + $(OBJ)\fp_mul_comba_28.obj \ + $(OBJ)\fp_mul_comba_3.obj \ + $(OBJ)\fp_mul_comba_32.obj \ + $(OBJ)\fp_mul_comba_4.obj \ + $(OBJ)\fp_mul_comba_48.obj \ + $(OBJ)\fp_mul_comba_6.obj \ + $(OBJ)\fp_mul_comba_64.obj \ + $(OBJ)\fp_mul_comba_7.obj \ + $(OBJ)\fp_mul_comba_8.obj \ + $(OBJ)\fp_mul_comba_9.obj \ + $(OBJ)\fp_mul_comba_small_set.obj \ + $(OBJ)\fp_mul_d.obj \ + $(OBJ)\fp_mulmod.obj \ + $(OBJ)\fp_gcd.obj \ + $(OBJ)\fp_invmod.obj \ + $(OBJ)\fp_isprime.obj \ + $(OBJ)\fp_lcm.obj \ + $(OBJ)\fp_prime_miller_rabin.obj \ + $(OBJ)\fp_prime_random_ex.obj \ + $(OBJ)\fp_sqr.obj \ + $(OBJ)\fp_sqr_comba.obj \ + $(OBJ)\fp_sqr_comba_12.obj \ + $(OBJ)\fp_sqr_comba_17.obj \ + $(OBJ)\fp_sqr_comba_20.obj \ + $(OBJ)\fp_sqr_comba_24.obj \ + $(OBJ)\fp_sqr_comba_28.obj \ + $(OBJ)\fp_sqr_comba_3.obj \ + $(OBJ)\fp_sqr_comba_32.obj \ + $(OBJ)\fp_sqr_comba_4.obj \ + $(OBJ)\fp_sqr_comba_48.obj \ + $(OBJ)\fp_sqr_comba_6.obj \ + $(OBJ)\fp_sqr_comba_64.obj \ + $(OBJ)\fp_sqr_comba_7.obj \ + $(OBJ)\fp_sqr_comba_8.obj \ + $(OBJ)\fp_sqr_comba_9.obj \ + $(OBJ)\fp_sqr_comba_generic.obj \ + $(OBJ)\fp_sqr_comba_small_set.obj \ + $(OBJ)\fp_sqrmod.obj + +{src\addsub}.c{$(OBJ)}.obj: + $(C2OBJ) + +{src\bin}.c{$(OBJ)}.obj: + $(C2OBJ) + +{src\bit}.c{$(OBJ)}.obj: + $(C2OBJ) + +{src\divide}.c{$(OBJ)}.obj: + $(C2OBJ) + +{src\exptmod}.c{$(OBJ)}.obj: + $(C2OBJ) + +{src\misc}.c{$(OBJ)}.obj: + $(C2OBJ) + +{src\mont}.c{$(OBJ)}.obj: + $(C2OBJ) + +{src\mul}.c{$(OBJ)}.obj: + $(C2OBJ) + +{src\numtheory}.c{$(OBJ)}.obj: + $(C2OBJ) + +{src\sqr}.c{$(OBJ)}.obj: + $(C2OBJ) + +{src\headers}.h{$(INCDIR)}.h: + $(CP) $** $@ + +$(LIBTFM): $(libtfm_OBJs) + $(LIBCON) + +all:: $(INCFILES) $(LIBTFM) diff --git a/windows/NTMakefile.w32 b/windows/NTMakefile.w32 index cab7e805a..8391afae6 100644 --- a/windows/NTMakefile.w32 +++ b/windows/NTMakefile.w32 @@ -456,3 +456,4 @@ LIBHDB =$(LIBDIR)\libhdb.lib LIBKADM5SRV =$(LIBDIR)\libkadm5srv.lib LIBKADM5CLNT=$(LIBDIR)\libkadm5clnt.lib LIBKDC =$(LIBDIR)\libkdc.lib +LIBTFM =$(LIBDIR)\libtfm.lib -- 2.11.4.GIT