summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-07-07 22:08:30 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-07-07 22:09:10 +0200
commit2acb2200b547f89a6f8e745c65ebd49300012cc6 (patch)
tree5c0e2523426eba2803fdf7062c9c59c9e9050bde
parentecb853615560da4d386e0008822677591e929b4f (diff)
downloadcryptodev-linux-2acb2200b547f89a6f8e745c65ebd49300012cc6.tar.gz
cryptodev-linux-2acb2200b547f89a6f8e745c65ebd49300012cc6.tar.xz
cryptodev-linux-2acb2200b547f89a6f8e745c65ebd49300012cc6.zip
additions to compile on 32-bit machines.
-rw-r--r--libtommath/tommath.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/libtommath/tommath.h b/libtommath/tommath.h
index a637605..f9845d8 100644
--- a/libtommath/tommath.h
+++ b/libtommath/tommath.h
@@ -63,8 +63,13 @@ extern "C" {
* At the very least a mp_digit must be able to hold 7 bits
* [any size beyond that is ok provided it doesn't overflow the data type]
*/
-#if BITS_PER_LONG <= 64
- /* this is the default case, 28-bit digits */
+#if BITS_PER_LONG <= 32
+
+ typedef uint16_t mp_digit;
+ typedef uint32_t mp_word;
+# define DIGIT_BIT 15
+
+#elif BITS_PER_LONG == 64
typedef uint32_t mp_digit;
typedef uint64_t mp_word;