Commit e60149dec7e934acab47e69ce79b77823b3c1adc

Daniel Mendler 2019-10-29T20:26:25

simplifications: replace mp_mod_d by macro

diff --git a/mp_mod_d.c b/mp_mod_d.c
deleted file mode 100644
index 3f7e191..0000000
--- a/mp_mod_d.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "tommath_private.h"
-#ifdef MP_MOD_D_C
-/* LibTomMath, multiple-precision integer library -- Tom St Denis */
-/* SPDX-License-Identifier: Unlicense */
-
-mp_err mp_mod_d(const mp_int *a, mp_digit b, mp_digit *c)
-{
-   return mp_div_d(a, b, NULL, c);
-}
-#endif
diff --git a/tommath.h b/tommath.h
index 86b19d3..823154a 100644
--- a/tommath.h
+++ b/tommath.h
@@ -398,7 +398,7 @@ mp_err mp_mul_d(const mp_int *a, mp_digit b, mp_int *c) MP_WUR;
 mp_err mp_div_d(const mp_int *a, mp_digit b, mp_int *c, mp_digit *d) MP_WUR;
 
 /* c = a mod b, 0 <= c < b  */
-mp_err mp_mod_d(const mp_int *a, mp_digit b, mp_digit *c) MP_WUR;
+#define mp_mod_d(a, b, c) mp_div_d((a), (b), NULL, (c))
 
 /* ---> number theory <--- */