Commit b800b7610ad24ea75332a4fac0b477ae6c80082f

Daniel Mendler 2019-11-22T16:04:48

remove *_ll* setters/getters * they are non standard * they are incompatible with older compilers * u64/i64 functions should be used instead * these functions should be deprecated again in 1.x

diff --git a/doc/bn.tex b/doc/bn.tex
index 1d6cf83..711ebf8 100644
--- a/doc/bn.tex
+++ b/doc/bn.tex
@@ -978,30 +978,6 @@ unsigned long mp_get_mag_ul (const mp_int *a);
 This will return the least significant bits of the big integer $a$ that fit into the native data
 type \texttt{long}.
 
-\subsection{Long Long Constants - platform dependant}
-
-\index{mp\_set\_ll} \index{mp\_set\_ull}
-\begin{alltt}
-void mp_set_ll (mp_int *a, long long b);
-void mp_set_ull (mp_int *a, unsigned long long b);
-\end{alltt}
-
-This will assign the value of the platform--dependent sized variable $b$ to the big integer $a$.
-
-To retrieve the value, the following functions can be used.
-
-\index{mp\_get\_ll}
-\index{mp\_get\_ull}
-\index{mp\_get\_mag\_ull}
-\begin{alltt}
-long long mp_get_ll (const mp_int *a);
-unsigned long long mp_get_ull (const mp_int *a);
-unsigned long long mp_get_mag_ull (const mp_int *a);
-\end{alltt}
-
-This will return the least significant bits of $a$ that fit into the native data type \texttt{long
-  long}.
-
 \subsection{Floating Point Constants - platform dependant}
 
 \index{mp\_set\_double}
@@ -1023,7 +999,7 @@ double mp_get_double(const mp_int *a);
 \subsection{Initialize and Setting Constants}
 To both initialize and set small constants the following nine functions are available.
 \index{mp\_init\_set} \index{mp\_init\_i32} \index{mp\_init\_i64} \index{mp\_init\_u32} \index{mp\_init\_u64}
-\index{mp\_init\_l} \index{mp\_init\_ll} \index{mp\_init\_ul} \index{mp\_init\_ull}
+\index{mp\_init\_l} \index{mp\_init\_ul}
 \begin{alltt}
 mp_err mp_init_set (mp_int *a, mp_digit b);
 mp_err mp_init_i32 (mp_int *a, int32_t b);
@@ -1032,8 +1008,6 @@ mp_err mp_init_i64 (mp_int *a, int64_t b);
 mp_err mp_init_u64 (mp_int *a, uint64_t b);
 mp_err mp_init_l   (mp_int *a, long b);
 mp_err mp_init_ul  (mp_int *a, unsigned long b);
-mp_err mp_init_ll  (mp_int *a, long long b);
-mp_err mp_init_ull (mp_int *a, unsigned long long b);
 \end{alltt}
 
 Both functions work like the previous counterparts except they first initialize $a$ with the
diff --git a/mp_get_ll.c b/mp_get_ll.c
deleted file mode 100644
index d31457d..0000000
--- a/mp_get_ll.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "tommath_private.h"
-#ifdef MP_GET_LL_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis */
-/* SPDX-License-Identifier: Unlicense */
-
-MP_GET_SIGNED(mp_get_ll, mp_get_mag_ull, long long, unsigned long long)
-#endif
diff --git a/mp_get_mag_ull.c b/mp_get_mag_ull.c
deleted file mode 100644
index fea1ab1..0000000
--- a/mp_get_mag_ull.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "tommath_private.h"
-#ifdef MP_GET_MAG_ULL_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis */
-/* SPDX-License-Identifier: Unlicense */
-
-MP_GET_MAG(mp_get_mag_ull, unsigned long long)
-#endif
diff --git a/mp_init_ll.c b/mp_init_ll.c
deleted file mode 100644
index d8b44a6..0000000
--- a/mp_init_ll.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "tommath_private.h"
-#ifdef MP_INIT_LL_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis */
-/* SPDX-License-Identifier: Unlicense */
-
-MP_INIT_INT(mp_init_ll, mp_set_ll, long long)
-#endif
diff --git a/mp_init_ull.c b/mp_init_ull.c
deleted file mode 100644
index ef66c6a..0000000
--- a/mp_init_ull.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "tommath_private.h"
-#ifdef MP_INIT_ULL_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis */
-/* SPDX-License-Identifier: Unlicense */
-
-MP_INIT_INT(mp_init_ull, mp_set_ull, unsigned long long)
-#endif
diff --git a/mp_set_ll.c b/mp_set_ll.c
deleted file mode 100644
index 343012d..0000000
--- a/mp_set_ll.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "tommath_private.h"
-#ifdef MP_SET_LL_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis */
-/* SPDX-License-Identifier: Unlicense */
-
-MP_SET_SIGNED(mp_set_ll, mp_set_ull, long long, unsigned long long)
-#endif
diff --git a/mp_set_ull.c b/mp_set_ull.c
deleted file mode 100644
index cd10b1c..0000000
--- a/mp_set_ull.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "tommath_private.h"
-#ifdef MP_SET_ULL_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis */
-/* SPDX-License-Identifier: Unlicense */
-
-MP_SET_UNSIGNED(mp_set_ull, unsigned long long)
-#endif
diff --git a/tommath.h b/tommath.h
index 4b2bc04..95f7127 100644
--- a/tommath.h
+++ b/tommath.h
@@ -242,7 +242,6 @@ mp_err mp_init_u64(mp_int *a, uint64_t b) MP_WUR;
 uint32_t mp_get_mag_u32(const mp_int *a) MP_WUR;
 uint64_t mp_get_mag_u64(const mp_int *a) MP_WUR;
 unsigned long mp_get_mag_ul(const mp_int *a) MP_WUR;
-unsigned long long mp_get_mag_ull(const mp_int *a) MP_WUR;
 
 /* get integer, set integer (long) */
 long mp_get_l(const mp_int *a) MP_WUR;
@@ -254,16 +253,6 @@ mp_err mp_init_l(mp_int *a, long b) MP_WUR;
 void mp_set_ul(mp_int *a, unsigned long b);
 mp_err mp_init_ul(mp_int *a, unsigned long b) MP_WUR;
 
-/* get integer, set integer (long long) */
-long long mp_get_ll(const mp_int *a) MP_WUR;
-void mp_set_ll(mp_int *a, long long b);
-mp_err mp_init_ll(mp_int *a, long long b) MP_WUR;
-
-/* get integer, set integer (unsigned long long) */
-#define mp_get_ull(a) ((unsigned long long)mp_get_ll(a))
-void mp_set_ull(mp_int *a, unsigned long long b);
-mp_err mp_init_ull(mp_int *a, unsigned long long b) MP_WUR;
-
 /* set to single unsigned digit, up to MP_DIGIT_MAX */
 void mp_set(mp_int *a, mp_digit b);
 mp_err mp_init_set(mp_int *a, mp_digit b) MP_WUR;