mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-03 11:54:02 +00:00
- Rewrote bignum type definition #ifdef tree to work better on all
systems
This commit is contained in:
parent
3338b792da
commit
62261d6bd6
@ -109,25 +109,41 @@ typedef UINT64 uint64_t;
|
|||||||
typedef signed char t_sint;
|
typedef signed char t_sint;
|
||||||
typedef unsigned char t_uint;
|
typedef unsigned char t_uint;
|
||||||
typedef uint16_t t_udbl;
|
typedef uint16_t t_udbl;
|
||||||
|
#define POLARSSL_HAVE_UDBL
|
||||||
#else
|
#else
|
||||||
#if defined(POLARSSL_HAVE_INT16)
|
#if defined(POLARSSL_HAVE_INT16)
|
||||||
typedef int16_t t_sint;
|
typedef int16_t t_sint;
|
||||||
typedef uint16_t t_uint;
|
typedef uint16_t t_uint;
|
||||||
typedef uint32_t t_udbl;
|
typedef uint32_t t_udbl;
|
||||||
|
#define POLARSSL_HAVE_UDBL
|
||||||
#else
|
#else
|
||||||
typedef int32_t t_sint;
|
#if ( defined(__MSC_VER) && defined(_M_AMD64) )
|
||||||
typedef uint32_t t_uint;
|
typedef int64_t t_sint;
|
||||||
#if ( defined(_MSC_VER) && defined(_M_IX86) ) || \
|
typedef uint64_t t_uint;
|
||||||
( defined(__GNUC__) && ( \
|
#else
|
||||||
defined(__amd64__) || defined(__x86_64__) || \
|
#if ( defined(__GNUC__) && ( \
|
||||||
defined(__ppc64__) || defined(__powerpc64__) || \
|
defined(__amd64__) || defined(__x86_64__) || \
|
||||||
defined(__ia64__) || defined(__alpha__) || \
|
defined(__ppc64__) || defined(__powerpc64__) || \
|
||||||
(defined(__sparc__) && defined(__arch64__)) || \
|
defined(__ia64__) || defined(__alpha__) || \
|
||||||
defined(__s390x__) ) )
|
(defined(__sparc__) && defined(__arch64__)) || \
|
||||||
#define POLARSSL_HAVE_INT64
|
defined(__s390x__) ) )
|
||||||
#endif
|
typedef int64_t t_sint;
|
||||||
#if defined(POLARSSL_HAVE_INT64)
|
typedef uint64_t t_uint;
|
||||||
typedef uint64_t t_udbl;
|
typedef unsigned int t_udbl __attribute__((mode(TI)));
|
||||||
|
#define POLARSSL_HAVE_UDBL
|
||||||
|
#else
|
||||||
|
typedef int32_t t_sint;
|
||||||
|
typedef uint32_t t_uint;
|
||||||
|
#if ( defined(_MSC_VER) && defined(_M_IX86) )
|
||||||
|
typedef uint64_t t_udbl;
|
||||||
|
#define POLARSSL_HAVE_UDBL
|
||||||
|
#else
|
||||||
|
#if defined( POLARSSL_HAVE_LONGLONG )
|
||||||
|
typedef unsigned long long t_udbl;
|
||||||
|
#define POLARSSL_HAVE_UDBL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif /* POLARSSL_HAVE_INT16 */
|
#endif /* POLARSSL_HAVE_INT16 */
|
||||||
#endif /* POLARSSL_HAVE_INT8 */
|
#endif /* POLARSSL_HAVE_INT8 */
|
||||||
|
@ -61,14 +61,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def POLARSSL_HAVE_INT64
|
* \def POLARSSL_HAVE_LONGLONG
|
||||||
*
|
*
|
||||||
* The compiler supports the use of 64-bit types.
|
* The compiler supports the 'long long' type.
|
||||||
* Code automatically enables on known working systems.
|
* (Only used on 32-bit platforms)
|
||||||
*
|
|
||||||
* Uncomment if the compiler supports 64-bit data types.
|
|
||||||
#define POLARSSL_HAVE_INT64
|
|
||||||
*/
|
*/
|
||||||
|
#define POLARSSL_HAVE_LONGLONG
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def POLARSSL_HAVE_ASM
|
* \def POLARSSL_HAVE_ASM
|
||||||
|
@ -1102,7 +1102,7 @@ int mpi_div_mpi( mpi *Q, mpi *R, const mpi *A, const mpi *B )
|
|||||||
Z.p[i - t - 1] = ~0;
|
Z.p[i - t - 1] = ~0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined(POLARSSL_HAVE_INT64)
|
#if defined(POLARSSL_HAVE_UDBL)
|
||||||
t_udbl r;
|
t_udbl r;
|
||||||
|
|
||||||
r = (t_udbl) X.p[i] << biL;
|
r = (t_udbl) X.p[i] << biL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user