math: change get_digit() return value
unsigned long is 32bit wide when compiling with the compiler flag "-mx32" but the digit size of the math libraries is still 64 bit which lead to the buggy ecc code. Therefore define a new type ltc_mp_digit with the correct width and use that as return value of get_digit() Has been tested with all three math providers
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user