Merge branch 'fix/x32' into develop

This closes #51
This commit is contained in:
Steffen Jaeckel 2014-09-28 22:43:58 +02:00
commit cb2322f8de
12 changed files with 18 additions and 13 deletions

View File

@ -210,7 +210,7 @@ library: $(LIBNAME)
.PHONY: testprof/$(LIBTEST) .PHONY: testprof/$(LIBTEST)
testprof/$(LIBTEST): testprof/$(LIBTEST):
$(MAKE) -C testprof -f makefile.mingw CFLAGS_OPTS="$(CFLAGS)" LIBTEST_S=$(LIBTEST) CC=$(CC) LD=$(LD) AR=$(AR) ARFLAGS=$(ARFLAGS) RANLIB=$(RANLIB) $(MAKE) -C testprof -f makefile.mingw CFLAGS_OPTS="$(CFLAGS)" LIBTEST_S=$(LIBTEST) CC="$(CC)" LD=$(LD) AR=$(AR) ARFLAGS="$(ARFLAGS)" RANLIB=$(RANLIB)
$(LIBNAME): $(OBJECTS) $(LIBNAME): $(OBJECTS)
$(AR) $(ARFLAGS) $@ $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS)

View File

@ -263,7 +263,7 @@ library: $(LIBNAME)
.PHONY: testprof/$(LIBTEST) .PHONY: testprof/$(LIBTEST)
testprof/$(LIBTEST): testprof/$(LIBTEST):
cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) LT=$(LT) CC=$(CC) make -f makefile.shared cd testprof ; CFLAGS="$(CFLAGS)" GROUP=$(GROUP) USER=$(USER) VERSION=$(VERSION) LIBPATH=$(LIBPATH) LIBTEST=$(LIBTEST) LIBTEST_S=$(LIBTEST_S) LT=$(LT) CC="$(CC)" make -f makefile.shared
.c.o: .c.o:
$(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $< $(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $<

View File

@ -210,7 +210,7 @@ library: $(LIBNAME)
.PHONY: testprof/$(LIBTEST) .PHONY: testprof/$(LIBTEST)
testprof/$(LIBTEST): testprof/$(LIBTEST):
cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) $(MAKE) cd testprof ; CFLAGS="$(CFLAGS)" LIBTEST_S=$(LIBTEST_S) CC="$(CC)" LD="$(LD)" AR="$(AR)" RANLIB="$(RANLIB)" $(MAKE)
$(LIBNAME): $(OBJECTS) $(LIBNAME): $(OBJECTS)
$(AR) $(ARFLAGS) $@ $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS)

View File

@ -122,6 +122,11 @@ typedef ulong32 __attribute__((__may_alias__)) LTC_FAST_TYPE;
#endif #endif
#endif #endif
#ifdef ENDIAN_64BITWORD
typedef ulong64 ltc_mp_digit;
#else
typedef ulong32 ltc_mp_digit;
#endif
#ifdef LTC_NO_FAST #ifdef LTC_NO_FAST
#ifdef LTC_FAST #ifdef LTC_FAST

View File

@ -80,7 +80,7 @@ typedef struct {
@param n The number of the digit to fetch @param n The number of the digit to fetch
@return The bits_per_digit sized n'th digit of a @return The bits_per_digit sized n'th digit of a
*/ */
unsigned long (*get_digit)(void *a, int n); ltc_mp_digit (*get_digit)(void *a, int n);
/** Get the number of digits that represent the number /** Get the number of digits that represent the number
@param a The number to count @param a The number to count

View File

@ -74,7 +74,7 @@ static unsigned long get_int(void *a)
return mpz_get_ui(a); return mpz_get_ui(a);
} }
static unsigned long get_digit(void *a, int n) static ltc_mp_digit get_digit(void *a, int n)
{ {
LTC_ARGCHK(a != NULL); LTC_ARGCHK(a != NULL);
return mpz_getlimbn(a, n); return mpz_getlimbn(a, n);
@ -430,6 +430,7 @@ static int montgomery_reduce(void *a, void *b, void *c)
/* clean up */ /* clean up */
static void montgomery_deinit(void *a) static void montgomery_deinit(void *a)
{ {
LTC_UNUSED_PARAM(a);
} }
static int exptmod(void *a, void *b, void *c, void *d) static int exptmod(void *a, void *b, void *c, void *d)

View File

@ -100,7 +100,7 @@ static unsigned long get_int(void *a)
return mp_get_int(a); return mp_get_int(a);
} }
static unsigned long get_digit(void *a, int n) static ltc_mp_digit get_digit(void *a, int n)
{ {
mp_int *A; mp_int *A;
LTC_ARGCHK(a != NULL); LTC_ARGCHK(a != NULL);

View File

@ -99,7 +99,7 @@ static unsigned long get_int(void *a)
return A->used > 0 ? A->dp[0] : 0; return A->used > 0 ? A->dp[0] : 0;
} }
static unsigned long get_digit(void *a, int n) static ltc_mp_digit get_digit(void *a, int n)
{ {
fp_int *A; fp_int *A;
LTC_ARGCHK(a != NULL); LTC_ARGCHK(a != NULL);

View File

@ -393,7 +393,6 @@ const char *crypt_build_settings =
" LTC_ECC_SHAMIR " " LTC_ECC_SHAMIR "
#endif #endif
"\n" "\n"
"\n\n\n"
; ;

View File

@ -41,7 +41,7 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map)
ecc_point *tG, *M[8]; ecc_point *tG, *M[8];
int i, j, err; int i, j, err;
void *mu, *mp; void *mu, *mp;
unsigned long buf; ltc_mp_digit buf;
int first, bitbuf, bitcpy, bitcnt, mode, digidx; int first, bitbuf, bitcpy, bitcnt, mode, digidx;
LTC_ARGCHK(k != NULL); LTC_ARGCHK(k != NULL);

View File

@ -39,7 +39,7 @@ int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map)
ecc_point *tG, *M[3]; ecc_point *tG, *M[3];
int i, j, err; int i, j, err;
void *mu, *mp; void *mu, *mp;
unsigned long buf; ltc_mp_digit buf;
int bitcnt, mode, digidx; int bitcnt, mode, digidx;
LTC_ARGCHK(k != NULL); LTC_ARGCHK(k != NULL);