From e60149dec7e934acab47e69ce79b77823b3c1adc Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Tue, 29 Oct 2019 20:26:25 +0100 Subject: [PATCH] simplifications: replace mp_mod_d by macro --- mp_mod_d.c | 10 ---------- tommath.h | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 mp_mod_d.c 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 <--- */