Remove all traces of ulong64 as per comment by Karel M
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
diff --git a/demo/timing.c b/demo/timing.c
index 1bd8489..87224da 100644
--- a/demo/timing.c
+++ b/demo/timing.c
@@ -1,8 +1,9 @@
#include <tommath.h>
#include <time.h>
#include <unistd.h>
+#include <stdint.h>
-ulong64 _tt;
+uint64_t _tt;
#ifdef IOWNANATHLON
#include <unistd.h>
@@ -47,7 +48,7 @@ int lbit(void)
}
/* RDTSC from Scott Duplichan */
-static ulong64 TIMFUNC(void)
+static uint64_t TIMFUNC(void)
{
#if defined __GNUC__
#if defined(__i386__) || defined(__x86_64__)
@@ -56,7 +57,7 @@ static ulong64 TIMFUNC(void)
*/
unsigned hi, lo;
__asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
- return ((ulong64)lo)|( ((ulong64)hi)<<32);
+ return ((uint64_t)lo)|( ((uint64_t)hi)<<32);
#else /* gcc-IA64 version */
unsigned long result;
__asm__ __volatile__("mov %0=ar.itc":"=r"(result)::"memory");
@@ -101,7 +102,7 @@ static ulong64 TIMFUNC(void)
int main(void)
{
- ulong64 tt, gg, CLK_PER_SEC;
+ uint64_t tt, gg, CLK_PER_SEC;
FILE *log, *logb, *logc, *logd;
mp_int a, b, c, d, e, f;
int n, cnt, ix, old_kara_m, old_kara_s, old_toom_m, old_toom_s;
diff --git a/etc/tune.c b/etc/tune.c
index c2ac998..0208b60 100644
--- a/etc/tune.c
+++ b/etc/tune.c
@@ -1,9 +1,10 @@
/* Tune the Karatsuba parameters
*
- * Tom St Denis, tomstdenis@gmail.com
+ * Tom St Denis, tstdenis82@gmail.com
*/
#include <tommath.h>
#include <time.h>
+#include <stdint.h>
/* how many times todo each size mult. Depends on your computer. For slow computers
* this can be low like 5 or 10. For fast [re: Athlon] should be 25 - 50 or so
@@ -13,7 +14,7 @@
#ifndef X86_TIMER
/* RDTSC from Scott Duplichan */
-static ulong64 TIMFUNC (void)
+static uint64_t TIMFUNC (void)
{
#if defined __GNUC__
#if defined(__i386__) || defined(__x86_64__)
@@ -22,7 +23,7 @@ static ulong64 TIMFUNC (void)
*/
unsigned hi, lo;
__asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
- return ((ulong64)lo)|( ((ulong64)hi)<<32);
+ return ((uint64_t)lo)|( ((uint64_t)hi)<<32);
#else /* gcc-IA64 version */
unsigned long result;
__asm__ __volatile__("mov %0=ar.itc" : "=r"(result) :: "memory");
@@ -48,20 +49,20 @@ static ulong64 TIMFUNC (void)
/* generic ISO C timer */
-ulong64 LBL_T;
+uint64_t LBL_T;
void t_start(void) { LBL_T = TIMFUNC(); }
-ulong64 t_read(void) { return TIMFUNC() - LBL_T; }
+uint64_t t_read(void) { return TIMFUNC() - LBL_T; }
#else
extern void t_start(void);
-extern ulong64 t_read(void);
+extern uint64_t t_read(void);
#endif
-ulong64 time_mult(int size, int s)
+uint64_t time_mult(int size, int s)
{
unsigned long x;
mp_int a, b, c;
- ulong64 t1;
+ uint64_t t1;
mp_init (&a);
mp_init (&b);
@@ -87,11 +88,11 @@ ulong64 time_mult(int size, int s)
return t1;
}
-ulong64 time_sqr(int size, int s)
+uint64_t time_sqr(int size, int s)
{
unsigned long x;
mp_int a, b;
- ulong64 t1;
+ uint64_t t1;
mp_init (&a);
mp_init (&b);
@@ -117,7 +118,7 @@ ulong64 time_sqr(int size, int s)
int
main (void)
{
- ulong64 t1, t2;
+ uint64_t t1, t2;
int x, y;
for (x = 8; ; x += 2) {
diff --git a/tommath.h b/tommath.h
index 4c66e15..cec3722 100644
--- a/tommath.h
+++ b/tommath.h
@@ -57,11 +57,6 @@ extern "C" {
#endif
#elif defined(MP_64BIT)
/* for GCC only on supported platforms */
-#ifndef CRYPT
- typedef unsigned long long ulong64;
- typedef signed long long long64;
-#endif
-
typedef uint64_t mp_digit;
#if defined(_WIN32)
typedef unsigned __int128 mp_word;
@@ -78,11 +73,6 @@ extern "C" {
/* this is the default case, 28-bit digits */
/* this is to make porting into LibTomCrypt easier :-) */
-#ifndef CRYPT
- typedef unsigned long long ulong64;
- typedef signed long long long64;
-#endif
-
typedef uint32_t mp_digit;
typedef uint64_t mp_word;