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)
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)
$(AR) $(ARFLAGS) $@ $(OBJECTS)

View File

@ -263,7 +263,7 @@ library: $(LIBNAME)
.PHONY: 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:
$(LTCOMPILE) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -c $<

View File

@ -210,7 +210,7 @@ library: $(LIBNAME)
.PHONY: 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)
$(AR) $(ARFLAGS) $@ $(OBJECTS)

View File

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

View File

@ -80,7 +80,7 @@ typedef struct {
@param n The number of the digit to fetch
@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
@param a The number to count

View File

@ -74,7 +74,7 @@ static unsigned long get_int(void *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);
return mpz_getlimbn(a, n);
@ -430,6 +430,7 @@ static int montgomery_reduce(void *a, void *b, void *c)
/* clean up */
static void montgomery_deinit(void *a)
{
LTC_UNUSED_PARAM(a);
}
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);
}
static unsigned long get_digit(void *a, int n)
static ltc_mp_digit get_digit(void *a, int n)
{
mp_int *A;
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;
}
static unsigned long get_digit(void *a, int n)
static ltc_mp_digit get_digit(void *a, int n)
{
fp_int *A;
LTC_ARGCHK(a != NULL);

View File

@ -393,7 +393,6 @@ const char *crypt_build_settings =
" LTC_ECC_SHAMIR "
#endif
"\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];
int i, j, err;
void *mu, *mp;
unsigned long buf;
ltc_mp_digit buf;
int first, bitbuf, bitcpy, bitcnt, mode, digidx;
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];
int i, j, err;
void *mu, *mp;
unsigned long buf;
ltc_mp_digit buf;
int bitcnt, mode, digidx;
LTC_ARGCHK(k != NULL);