From 93c1f3af444e4e7b1897610e18f7fd2e9fdea5fb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 31 Mar 2024 22:17:46 +0000 Subject: More progress --- libtommath/bn_mp_to_ubin.c | 3 +-- libtommath/changes.txt | 6 ++++++ libtommath/libtommath.pc.in | 9 ++++----- libtommath/tommath.h | 1 + 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/libtommath/bn_mp_to_ubin.c b/libtommath/bn_mp_to_ubin.c index 4913c3a..1681ca7 100644 --- a/libtommath/bn_mp_to_ubin.c +++ b/libtommath/bn_mp_to_ubin.c @@ -10,8 +10,7 @@ mp_err mp_to_ubin(const mp_int *a, unsigned char *buf, size_t maxlen, size_t *wr mp_err err; mp_int t; - size_t size = (size_t)mp_count_bits(a); - count = (size / 8u) + (((size & 7u) != 0u) ? 1u : 0u); + count = mp_ubin_size(a); if (count > maxlen) { return MP_BUF; } diff --git a/libtommath/changes.txt b/libtommath/changes.txt index 956cdd4..ac9e49a 100644 --- a/libtommath/changes.txt +++ b/libtommath/changes.txt @@ -1,3 +1,9 @@ +Mar 27th, 2024 +v1.3.0 + -- Deprecate more APIs which are replaced in develop (PR #572) + -- Add support for CMake (PR #573) + -- Add support for GitHub Actions (PR #573) + Sep 04th, 2023 v1.2.1 -- Bugfix release because of potential integer overflow diff --git a/libtommath/libtommath.pc.in b/libtommath/libtommath.pc.in index 099b1cd..7ce50fd 100644 --- a/libtommath/libtommath.pc.in +++ b/libtommath/libtommath.pc.in @@ -1,10 +1,9 @@ -prefix=@to-be-replaced@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include +prefix=@CMAKE_INSTALL_PREFIX@ +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ Name: LibTomMath Description: public domain library for manipulating large integer numbers -Version: @to-be-replaced@ +Version: @PROJECT_VERSION@ Libs: -L${libdir} -ltommath Cflags: -I${includedir} diff --git a/libtommath/tommath.h b/libtommath/tommath.h index 9a0e3aa..0b89c23 100644 --- a/libtommath/tommath.h +++ b/libtommath/tommath.h @@ -408,6 +408,7 @@ mp_err mp_div_2(const mp_int *a, mp_int *b) MP_WUR; /* a/3 => 3c + d == a */ mp_err mp_div_3(const mp_int *a, mp_int *c, mp_digit *d) MP_WUR; +mp_err s_mp_div_3(const mp_int *a, mp_int *c, mp_digit *d) MP_WUR; /* c = a * 2**b, implemented as c = a << b */ mp_err mp_mul_2d(const mp_int *a, int b, mp_int *c) MP_WUR; -- cgit v0.12