summaryrefslogtreecommitdiffstats
path: root/libtommath
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-10-23 18:37:54 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-10-23 18:37:54 (GMT)
commit7e67cf48ebc00a5378ef2ef349aa3ba613d127d9 (patch)
treeee6d5dcc69bb947dc41fc49c1970fc5190c6e6b3 /libtommath
parentf8876cc390ecf388114f426db15e641a5adb20fc (diff)
downloadtcl-7e67cf48ebc00a5378ef2ef349aa3ba613d127d9.zip
tcl-7e67cf48ebc00a5378ef2ef349aa3ba613d127d9.tar.gz
tcl-7e67cf48ebc00a5378ef2ef349aa3ba613d127d9.tar.bz2
Branch [https://github.com/libtom/libtommath/commits/no-stdint-h] from libtommath, by karel-m.
Diffstat (limited to 'libtommath')
-rw-r--r--libtommath/bn_mp_radix_smap.c2
-rw-r--r--libtommath/tommath.h17
-rw-r--r--libtommath/tommath_private.h2
3 files changed, 10 insertions, 11 deletions
diff --git a/libtommath/bn_mp_radix_smap.c b/libtommath/bn_mp_radix_smap.c
index 6e9f64a..caba69f 100644
--- a/libtommath/bn_mp_radix_smap.c
+++ b/libtommath/bn_mp_radix_smap.c
@@ -15,7 +15,7 @@
/* chars used in radix conversions */
const char *const mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/";
-const uint8_t mp_s_rmap_reverse[] = {
+const unsigned char mp_s_rmap_reverse[] = {
0xff, 0xff, 0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f, /* ()*+,-./ */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 01234567 */
0x08, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 89:;<=>? */
diff --git a/libtommath/tommath.h b/libtommath/tommath.h
index 9cec473..5c90b90 100644
--- a/libtommath/tommath.h
+++ b/libtommath/tommath.h
@@ -15,7 +15,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <stdint.h>
#include <limits.h>
#include <tommath_class.h>
@@ -56,30 +55,30 @@ extern "C" {
* [any size beyond that is ok provided it doesn't overflow the data type]
*/
#ifdef MP_8BIT
-typedef uint8_t mp_digit;
-typedef uint16_t mp_word;
+typedef unsigned char mp_digit;
+typedef unsigned short mp_word;
# define MP_SIZEOF_MP_DIGIT 1
# ifdef DIGIT_BIT
# error You must not define DIGIT_BIT when using MP_8BIT
# endif
#elif defined(MP_16BIT)
-typedef uint16_t mp_digit;
-typedef uint32_t mp_word;
+typedef unsigned short mp_digit;
+typedef unsigned int mp_word;
# define MP_SIZEOF_MP_DIGIT 2
# ifdef DIGIT_BIT
# error You must not define DIGIT_BIT when using MP_16BIT
# endif
#elif defined(MP_64BIT)
/* for GCC only on supported platforms */
-typedef uint64_t mp_digit;
+typedef unsigned long long mp_digit;
typedef unsigned long mp_word __attribute__((mode(TI)));
# define DIGIT_BIT 60
#else
/* this is the default case, 28-bit digits */
/* this is to make porting into LibTomCrypt easier :-) */
-typedef uint32_t mp_digit;
-typedef uint64_t mp_word;
+typedef unsigned int mp_digit;
+typedef unsigned long long mp_word;
# ifdef MP_31BIT
/* this is an extension that uses 31-bit digits */
@@ -94,7 +93,7 @@ typedef uint64_t mp_word;
/* otherwise the bits per digit is calculated automatically from the size of a mp_digit */
#ifndef DIGIT_BIT
# define DIGIT_BIT (((CHAR_BIT * MP_SIZEOF_MP_DIGIT) - 1)) /* bits per digit */
-typedef uint_least32_t mp_min_u32;
+typedef unsigned long mp_min_u32;
#else
typedef mp_digit mp_min_u32;
#endif
diff --git a/libtommath/tommath_private.h b/libtommath/tommath_private.h
index 133aea9..e9dbd5b 100644
--- a/libtommath/tommath_private.h
+++ b/libtommath/tommath_private.h
@@ -74,7 +74,7 @@ int s_mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y, i
void bn_reverse(unsigned char *s, int len);
extern const char *const mp_s_rmap;
-extern const uint8_t mp_s_rmap_reverse[];
+extern const unsigned char mp_s_rmap_reverse[];
extern const size_t mp_s_rmap_reverse_sz;
/* Fancy macro to set an MPI from another type.