From 18f644d8811d617db35f4d4e08a1cca60f8dba3a Mon Sep 17 00:00:00 2001 From: Jerry James Date: Jul 08 2022 20:41:51 +0000 Subject: New URLs. Add -mismatched-decl patch to silence warnings. --- diff --git a/.gitignore b/.gitignore index 4163a16..2f07951 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /gf2x-*.tar.gz +/gf2x-*.tar.bz2 diff --git a/README.md b/README.md new file mode 100644 index 0000000..1e4497a --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# gf2x + +[Gf2x](https://gitlab.inria.fr/gf2x/gf2x) is a C/C++ software package +containing routines for fast arithmetic in `GF(2)[x]` (multiplication, +squaring, GCD) and searching for irreducible/primitive trinomials. diff --git a/gf2x-mismatched-decls.patch b/gf2x-mismatched-decls.patch new file mode 100644 index 0000000..ac35dd2 --- /dev/null +++ b/gf2x-mismatched-decls.patch @@ -0,0 +1,145 @@ +--- gf2x-gf2x-1.3.0/fft/gf2x-cantor-fft.c.orig 2019-12-10 06:35:45.000000000 -0700 ++++ gf2x-gf2x-1.3.0/fft/gf2x-cantor-fft.c 2022-07-08 14:32:27.802452501 -0600 +@@ -95,7 +95,7 @@ static Kfield K; + * data in the high part is during the ift operation, and even then the + * data that comes out of the ift still has zero high part. + */ +-size_t gf2x_cantor_fft_transform_size(const gf2x_cantor_fft_info_t p) ++size_t gf2x_cantor_fft_transform_size(gf2x_cantor_fft_info_srcptr p) + { + return 1UL << p->k; + } +@@ -1444,7 +1444,7 @@ static void recomposeK_bits(unsigned lon + #endif + + /* nF is a number of coefficients == number of bits ; a.k.a. degree + 1 */ +-int gf2x_cantor_fft_info_init(gf2x_cantor_fft_info_t p, size_t nF, size_t nG) ++int gf2x_cantor_fft_info_init(gf2x_cantor_fft_info_ptr p, size_t nF, size_t nG) + { + unsigned int k; + size_t Hl; +@@ -1467,7 +1467,7 @@ int gf2x_cantor_fft_info_init(gf2x_canto + return 0; + } + +-int gf2x_cantor_fft_info_init_mp(gf2x_cantor_fft_info_t p, size_t nF, size_t nG) ++int gf2x_cantor_fft_info_init_mp(gf2x_cantor_fft_info_ptr p, size_t nF, size_t nG) + { + unsigned int k; + +@@ -1572,7 +1572,7 @@ char * GF2X_EXPORTED gf2x_cantor_fft_inf + } + + /* nF is a number of coefficients */ +-int gf2x_cantor_fft_dft(const gf2x_cantor_fft_info_t p, gf2x_cantor_fft_ptr x, const unsigned long * F, size_t nF, gf2x_cantor_fft_ptr temp1 GF2X_MAYBE_UNUSED) ++int gf2x_cantor_fft_dft(gf2x_cantor_fft_info_srcptr p, gf2x_cantor_fft_ptr x, const unsigned long * F, size_t nF, gf2x_cantor_fft_ptr temp1 GF2X_MAYBE_UNUSED) + { + size_t Fl = W(nF); + if (R(nF)) { +@@ -1602,7 +1602,7 @@ int gf2x_cantor_fft_dft(const gf2x_canto + } + + +-int gf2x_cantor_fft_compose(const gf2x_cantor_fft_info_t p, gf2x_cantor_fft_ptr y, gf2x_cantor_fft_srcptr x1, gf2x_cantor_fft_srcptr x2, gf2x_cantor_fft_ptr temp2 GF2X_MAYBE_UNUSED) ++int gf2x_cantor_fft_compose(gf2x_cantor_fft_info_srcptr p, gf2x_cantor_fft_ptr y, gf2x_cantor_fft_srcptr x1, gf2x_cantor_fft_srcptr x2, gf2x_cantor_fft_ptr temp2 GF2X_MAYBE_UNUSED) + { + for (size_t j = 0; j < significant_transform_size(p) ; j++) { + Kmul(y[j], x1[j], x2[j]); +@@ -1610,7 +1610,7 @@ int gf2x_cantor_fft_compose(const gf2x_c + return 0; + } + +-int gf2x_cantor_fft_addcompose_n(const gf2x_cantor_fft_info_t p, gf2x_cantor_fft_ptr y, gf2x_cantor_fft_srcptr * x1, gf2x_cantor_fft_srcptr * x2, size_t n, gf2x_cantor_fft_ptr temp2 GF2X_MAYBE_UNUSED, gf2x_cantor_fft_ptr temp1 GF2X_MAYBE_UNUSED) ++int gf2x_cantor_fft_addcompose_n(gf2x_cantor_fft_info_srcptr p, gf2x_cantor_fft_ptr y, gf2x_cantor_fft_srcptr * x1, gf2x_cantor_fft_srcptr * x2, size_t n, gf2x_cantor_fft_ptr temp2 GF2X_MAYBE_UNUSED, gf2x_cantor_fft_ptr temp1 GF2X_MAYBE_UNUSED) + { + Kelt er; + #if 0 +@@ -1684,20 +1684,20 @@ int gf2x_cantor_fft_addcompose_n(const g + return 0; + } + +-int gf2x_cantor_fft_addcompose(const gf2x_cantor_fft_info_t p, gf2x_cantor_fft_ptr y, gf2x_cantor_fft_srcptr x1, gf2x_cantor_fft_srcptr x2, gf2x_cantor_fft_ptr temp2, gf2x_cantor_fft_ptr temp1) ++int gf2x_cantor_fft_addcompose(gf2x_cantor_fft_info_srcptr p, gf2x_cantor_fft_ptr y, gf2x_cantor_fft_srcptr x1, gf2x_cantor_fft_srcptr x2, gf2x_cantor_fft_ptr temp2, gf2x_cantor_fft_ptr temp1) + { + gf2x_cantor_fft_addcompose_n(p, y, &x1, &x2, 1, temp2, temp1); + return 0; + } + +-void gf2x_cantor_fft_add(const gf2x_cantor_fft_info_t p, gf2x_cantor_fft_ptr y, gf2x_cantor_fft_srcptr x1, gf2x_cantor_fft_srcptr x2) ++void gf2x_cantor_fft_add(gf2x_cantor_fft_info_srcptr p, gf2x_cantor_fft_ptr y, gf2x_cantor_fft_srcptr x1, gf2x_cantor_fft_srcptr x2) + { + for (size_t j = 0; j < significant_transform_size(p) ; j++) { + Kadd(y[j], x1[j], x2[j]); + } + } + +-void gf2x_cantor_fft_cpy(const gf2x_cantor_fft_info_t p, gf2x_cantor_fft_ptr y, gf2x_cantor_fft_srcptr x, size_t n) ++void gf2x_cantor_fft_cpy(gf2x_cantor_fft_info_srcptr p, gf2x_cantor_fft_ptr y, gf2x_cantor_fft_srcptr x, size_t n) + { + memcpy(y, x, n * significant_transform_size(p) * sizeof(Kelt)); + } +@@ -1705,7 +1705,7 @@ void gf2x_cantor_fft_cpy(const gf2x_cant + /* nH is a number of coefficients */ + /* this destroys the input */ + int gf2x_cantor_fft_ift( +- const gf2x_cantor_fft_info_t p, ++ gf2x_cantor_fft_info_srcptr p, + unsigned long * H, + size_t nH, + gf2x_cantor_fft_ptr h, gf2x_cantor_fft_ptr temp1 GF2X_MAYBE_UNUSED) +@@ -1735,26 +1735,26 @@ int gf2x_cantor_fft_ift( + } + + +-gf2x_cantor_fft_ptr gf2x_cantor_fft_alloc(const gf2x_cantor_fft_info_t p, size_t n) ++gf2x_cantor_fft_ptr gf2x_cantor_fft_alloc(gf2x_cantor_fft_info_srcptr p, size_t n) + { + return (Kelt *) malloc(n * gf2x_cantor_fft_transform_size(p) * sizeof(Kelt)); + } + void gf2x_cantor_fft_free( +- const gf2x_cantor_fft_info_t p GF2X_MAYBE_UNUSED, ++ gf2x_cantor_fft_info_srcptr p GF2X_MAYBE_UNUSED, + gf2x_cantor_fft_ptr x, + size_t n GF2X_MAYBE_UNUSED) + { + free(x); + } +-gf2x_cantor_fft_srcptr gf2x_cantor_fft_get_const(const gf2x_cantor_fft_info_t p, gf2x_cantor_fft_srcptr x, size_t k) ++gf2x_cantor_fft_srcptr gf2x_cantor_fft_get_const(gf2x_cantor_fft_info_srcptr p, gf2x_cantor_fft_srcptr x, size_t k) + { + return x + k * gf2x_cantor_fft_transform_size(p); + } +-gf2x_cantor_fft_ptr gf2x_cantor_fft_get(const gf2x_cantor_fft_info_t p, gf2x_cantor_fft_ptr x, size_t k) ++gf2x_cantor_fft_ptr gf2x_cantor_fft_get(gf2x_cantor_fft_info_srcptr p, gf2x_cantor_fft_ptr x, size_t k) + { + return x + k * gf2x_cantor_fft_transform_size(p); + } +-void gf2x_cantor_fft_zero(const gf2x_cantor_fft_info_t p, gf2x_cantor_fft_ptr x, size_t n) ++void gf2x_cantor_fft_zero(gf2x_cantor_fft_info_srcptr p, gf2x_cantor_fft_ptr x, size_t n) + { + memset(x, 0, n * gf2x_cantor_fft_transform_size(p) * sizeof(Kelt)); + } +--- gf2x-gf2x-1.3.0/fft/gf2x-cantor-fft.h.orig 2019-12-10 06:35:45.000000000 -0700 ++++ gf2x-gf2x-1.3.0/fft/gf2x-cantor-fft.h 2022-07-08 14:23:32.289410384 -0600 +@@ -540,8 +540,8 @@ static inline int gf2x_cantor_fft_info_a + long val GF2X_MAYBE_UNUSED) + { return 0; } + +-static inline void gf2x_cantor_fft_info_clear(gf2x_cantor_fft_info_t t GF2X_MAYBE_UNUSED) { } +-static inline void gf2x_cantor_fft_info_init_empty(gf2x_cantor_fft_info_t t) { ++static inline void gf2x_cantor_fft_info_clear(gf2x_cantor_fft_info_ptr t GF2X_MAYBE_UNUSED) { } ++static inline void gf2x_cantor_fft_info_init_empty(gf2x_cantor_fft_info_ptr t) { + t->k = t->n = t->mp_shift = 0; + } + +--- gf2x-gf2x-1.3.0/fft/gf2x-ternary-fft.h.orig 2019-12-10 06:35:45.000000000 -0700 ++++ gf2x-gf2x-1.3.0/fft/gf2x-ternary-fft.h 2022-07-08 13:57:39.701566437 -0600 +@@ -498,7 +498,7 @@ extern "C" { + #endif + + static inline int gf2x_ternary_fft_info_order(gf2x_ternary_fft_info_srcptr o) { return ((o)->K * ((o)->split ? -1 : 1)); } +-static inline void gf2x_ternary_fft_info_init_empty(gf2x_ternary_fft_info_t t) ++static inline void gf2x_ternary_fft_info_init_empty(gf2x_ternary_fft_info_ptr t) + { + t->bits_a = 0; + t->bits_b = 0; diff --git a/gf2x.rpmlintrc b/gf2x.rpmlintrc deleted file mode 100644 index e2c1558..0000000 --- a/gf2x.rpmlintrc +++ /dev/null @@ -1,5 +0,0 @@ -# THIS FILE IS FOR WHITELISTING RPMLINT ERRORS AND WARNINGS IN TASKOTRON -# https://fedoraproject.org/wiki/Taskotron/Tasks/dist.rpmlint#Whitelisting_errors - -# The dictionary is missing some technical terms -addFilter(r'W: spelling-error .* trinomials') diff --git a/gf2x.spec b/gf2x.spec index 4a018ed..391f8fd 100644 --- a/gf2x.spec +++ b/gf2x.spec @@ -1,13 +1,16 @@ Name: gf2x Version: 1.3.0 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Polynomial multiplication over the binary field License: GPLv2+ -URL: http://gf2x.gforge.inria.fr/ -Source0: https://gforge.inria.fr/frs/download.php/file/38243/%{name}-%{version}.tar.gz +URL: https://gitlab.inria.fr/gf2x/gf2x +Source0: %{url}/-/archive/%{name}-%{version}/%{name}-%{name}-%{version}.tar.bz2 +# Fix mismatched declarations and definitions +Patch0: %{name}-mismatched-decls.patch BuildRequires: gcc-c++ +BuildRequires: libtool BuildRequires: make %description @@ -23,7 +26,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release} Headers and library files for developing applications that use %{name}. %prep -%autosetup +%autosetup -n %{name}-%{name}-%{version} -p1 # Fix the FSF's address for badfile in `grep -FRl 'Fifth Floor' .`; do @@ -33,10 +36,8 @@ for badfile in `grep -FRl 'Fifth Floor' .`; do rm -f $badfile.orig done -# Workaround broken configure macros -sed -e "s/GF2X_PCLMUL_AVAILABLE_TRUE=$/&'#'/" \ - -e "/GF2X_PCLMUL_AVAILABLE_FALSE/s/'#'//" \ - -i configure +# Generate the configure script +autoreconf -I config -fi . %build fixtimestamp() { @@ -98,6 +99,10 @@ LD_LIBRARY_PATH=$PWD/.libs:$PWD/fft/.libs make check %{_libdir}/pkgconfig/%{name}.pc %changelog +* Fri Jul 8 2022 Jerry James - 1.3.0-7 +- New URLs +- Add -mismatched-decl patch to silence warnings + * Thu Jan 20 2022 Fedora Release Engineering - 1.3.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild diff --git a/sources b/sources index 2149997..8c293fb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gf2x-1.3.0.tar.gz) = 4991568032483e0ecb4552a698e5b7d09f80875e54584a0060a9473be1f87e4e8f714e657f08fec0b9fcf493d969408e5a9000f900623b3694aba1ecf6dc239e +SHA512 (gf2x-gf2x-1.3.0.tar.bz2) = 2872d8ddeb1fd3966f8711573d6c090975fcd9acfa302f7537ebfa3350e83af224bfd18a33ea1106d81ab900c96413e413c04ba506d8bf928bb92b670c24d857