diff --git a/cyassl/ctaocrypt/integer.h b/cyassl/ctaocrypt/integer.h index 114f63ef9..200072d19 100644 --- a/cyassl/ctaocrypt/integer.h +++ b/cyassl/ctaocrypt/integer.h @@ -82,9 +82,9 @@ extern "C" { #ifdef MP_8BIT typedef unsigned char mp_digit; typedef unsigned short mp_word; -#elif defined(MP_16BIT) +#elif (defined(MP_16BIT) || defined(NO_64BIT)) typedef unsigned short mp_digit; - typedef unsigned long mp_word; + typedef unsigned int mp_word; #elif defined(MP_64BIT) /* for GCC only on supported platforms */ #ifndef CRYPT diff --git a/cyassl/ctaocrypt/tfm.h b/cyassl/ctaocrypt/tfm.h index 314feb608..b42dfdeaf 100644 --- a/cyassl/ctaocrypt/tfm.h +++ b/cyassl/ctaocrypt/tfm.h @@ -54,6 +54,7 @@ #endif +#ifndef NO_64BIT /* autodetect x86-64 and make sure we are using 64-bit digits with x86-64 asm */ #if defined(__x86_64__) #if defined(TFM_X86) || defined(TFM_SSE2) || defined(TFM_ARM) @@ -72,6 +73,7 @@ #if defined(__x86_64__) && !defined(FP_64BIT) #define FP_64BIT #endif +#endif /* NO_64BIT */ /* try to detect x86-32 */ #if defined(__i386__) && !defined(TFM_SSE2) @@ -214,8 +216,15 @@ typedef signed long long long64; #endif #endif - typedef unsigned int fp_digit; - typedef ulong64 fp_word; + #ifndef NO_64BIT + typedef unsigned int fp_digit; + typedef ulong64 fp_word; + #else + /* some procs like coldfire prefer not to place multiply into 64bit type + even though it exists */ + typedef unsigned short fp_digit; + typedef unsigned int fp_word; + #endif #endif /* # of digits this is */