Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ntl for openSUSE:Factory checked in at 2021-05-07 17:15:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ntl (Old) and /work/SRC/openSUSE:Factory/.ntl.new.2988 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ntl" Fri May 7 17:15:36 2021 rev:29 rq:891332 version:11.4.4 Changes: -------- --- /work/SRC/openSUSE:Factory/ntl/ntl.changes 2020-03-05 23:26:05.761436755 +0100 +++ /work/SRC/openSUSE:Factory/.ntl.new.2988/ntl.changes 2021-05-07 17:15:47.088924300 +0200 @@ -1,0 +2,7 @@ +Fri May 7 14:31:32 UTC 2021 - Jan Engelhardt <[email protected]> + +- Update to release 11.4.4 + * Improved Karatsuba code for ZZX and GF2EX (as well as the + non-GMP implementation of ZZ). + +------------------------------------------------------------------- Old: ---- ntl-11.4.3.tar.gz New: ---- ntl-11.4.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ntl.spec ++++++ --- /var/tmp/diff_new_pack.Vro5Lq/_old 2021-05-07 17:15:47.556923815 +0200 +++ /var/tmp/diff_new_pack.Vro5Lq/_new 2021-05-07 17:15:47.556923815 +0200 @@ -1,7 +1,7 @@ # # spec file for package ntl # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,13 +18,14 @@ Name: ntl %define lname libntl43 -Version: 11.4.3 +Version: 11.4.4 Release: 0 Summary: Library for Number Theory License: LGPL-2.1-or-later Group: Productivity/Scientific/Math URL: https://shoup.net/ntl/ +#Git-Clone: https://github.com/libntl/ntl Source: https://shoup.net/ntl/ntl-%version.tar.gz Patch1: no-static.diff BuildRequires: fdupes ++++++ ntl-11.4.3.tar.gz -> ntl-11.4.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntl-11.4.3/README new/ntl-11.4.4/README --- old/ntl-11.4.3/README 2020-01-04 19:49:16.000000000 +0100 +++ new/ntl-11.4.4/README 2021-03-05 17:49:14.000000000 +0100 @@ -1,5 +1,5 @@ -NTL -- a library for doing numbery theory -- version 11.4.3 -Release date: 2020.01.04 +NTL -- a library for doing numbery theory -- version 11.4.4 +Release date: 2021.03.05 Author: Victor Shoup ([email protected]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntl-11.4.3/doc/copying.txt new/ntl-11.4.4/doc/copying.txt --- old/ntl-11.4.3/doc/copying.txt 2020-01-04 19:49:16.000000000 +0100 +++ new/ntl-11.4.4/doc/copying.txt 2021-03-05 17:49:16.000000000 +0100 @@ -2,7 +2,7 @@ COPYRIGHT NOTICE NTL -- A Library for Doing Number Theory -Copyright (C) 1996-2020 Victor Shoup +Copyright (C) 1996-2021 Victor Shoup The most recent version of NTL is available at http://www.shoup.net diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntl-11.4.3/doc/tour-changes.html new/ntl-11.4.4/doc/tour-changes.html --- old/ntl-11.4.3/doc/tour-changes.html 2020-01-04 19:49:17.000000000 +0100 +++ new/ntl-11.4.4/doc/tour-changes.html 2021-03-05 17:49:16.000000000 +0100 @@ -18,6 +18,20 @@ <p><hr><p> <h3> +2021.03.05: Changes between NTL 11.4.3 and 11.4.4 +</h3> + +<ul> +<li> +Improved Karatsuba code for <tt>ZZX</tt> and <tt>GF2EX</tt> +(as well as the non-GMP implementation of <tt>ZZ</tt>). +(Thanks to Marco Bodrato) + +</ul> + + +<p><hr><p> +<h3> 2020.01.04: Changes between NTL 11.4.2 and 11.4.3 </h3> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntl-11.4.3/include/NTL/config.h new/ntl-11.4.4/include/NTL/config.h --- old/ntl-11.4.3/include/NTL/config.h 2020-01-04 19:49:16.000000000 +0100 +++ new/ntl-11.4.4/include/NTL/config.h 2021-03-05 17:49:16.000000000 +0100 @@ -117,7 +117,7 @@ #endif -#if 1 +#if 0 #define NTL_GF2X_LIB /* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntl-11.4.3/include/NTL/version.h new/ntl-11.4.4/include/NTL/version.h --- old/ntl-11.4.3/include/NTL/version.h 2020-01-04 19:49:16.000000000 +0100 +++ new/ntl-11.4.4/include/NTL/version.h 2021-03-05 17:49:16.000000000 +0100 @@ -2,11 +2,11 @@ #ifndef NTL_version__H #define NTL_version__H -#define NTL_VERSION "11.4.3" +#define NTL_VERSION "11.4.4" #define NTL_MAJOR_VERSION (11) #define NTL_MINOR_VERSION (4) -#define NTL_REVISION (3) +#define NTL_REVISION (4) #endif Binary files old/ntl-11.4.3/src/._DoConfig and new/ntl-11.4.4/src/._DoConfig differ Binary files old/ntl-11.4.3/src/._ZZX.cpp and new/ntl-11.4.4/src/._ZZX.cpp differ Binary files old/ntl-11.4.3/src/._configure and new/ntl-11.4.4/src/._configure differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntl-11.4.3/src/DIRNAME new/ntl-11.4.4/src/DIRNAME --- old/ntl-11.4.3/src/DIRNAME 2020-01-04 19:49:16.000000000 +0100 +++ new/ntl-11.4.4/src/DIRNAME 2021-03-05 17:49:15.000000000 +0100 @@ -1 +1 @@ -ntl-11.4.3 +ntl-11.4.4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntl-11.4.3/src/FFT.cpp new/ntl-11.4.4/src/FFT.cpp --- old/ntl-11.4.3/src/FFT.cpp 2020-01-04 19:49:16.000000000 +0100 +++ new/ntl-11.4.4/src/FFT.cpp 2021-03-05 17:49:14.000000000 +0100 @@ -25,7 +25,7 @@ 2649-2658. I have almost completely re-written David's original code to make it fit into -NTL's software framework; however, all all of the key logic is still based on +NTL's software framework; however, all of the key logic is still based on David's code. David's original code also implemented a 2D transformation which is more cache friendly for *very* large transforms. However, my experimens indicated this was only beneficial for transforms of size at least 2^20, and so diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntl-11.4.3/src/GF2EX.cpp new/ntl-11.4.4/src/GF2EX.cpp --- old/ntl-11.4.3/src/GF2EX.cpp 2020-01-04 19:49:16.000000000 +0100 +++ new/ntl-11.4.4/src/GF2EX.cpp 2021-03-05 17:49:14.000000000 +0100 @@ -542,7 +542,7 @@ static void KarMul(GF2X *c, const GF2X *a, - long sa, const GF2X *b, long sb, GF2X *stk) + long sa, const GF2X *b, long sb, GF2X *stk, long sp) { if (sa < sb) { { long t = sa; sa = sb; sb = t; } @@ -558,18 +558,42 @@ return; } - if (sb == 2 && sa == 2) { + if (sa == 2) { /* (1 < sb <= sa == 2) implies sb == 2 */ + q_add(c[0], a[0], a[1]); + q_add(c[2], b[0], b[1]); + mul(c[1], c[0], c[2]); mul(c[0], a[0], b[0]); mul(c[2], a[1], b[1]); - q_add(stk[0], a[0], a[1]); - q_add(stk[1], b[0], b[1]); - mul(c[1], stk[0], stk[1]); q_add(c[1], c[1], c[0]); q_add(c[1], c[1], c[2]); return; } + if (sa == 3 && sb == 3) { + q_add(c[0], a[0], a[2]); /* a_0 + a_2 */ + q_add(c[2], a[1], a[2]); /* a_1 + a_2 */ + q_add(c[1], b[0], b[2]); /* b_0 + b_2 */ + q_add(c[4], b[1], b[2]); /* b_1 + b_2 */ + mul(c[3], c[2], c[4]); /* (a_1 + a_2) x (b_1 + b_2) */ + mul(c[2], c[0], c[1]); /* (a_0 + a_2) x (b_0 + b_2) */ + q_add(c[0], a[0], a[1]); /* a_0 + a_1 */ + q_add(c[4], b[0], b[1]); /* b_0 + b_1 */ + mul(c[1], c[0], c[4]); /* (a_0 + a_1) x (b_0 + b_1) */ + mul(c[0], a[1], b[1]); /* (a_1) x (b_1) */ + q_add(c[1], c[1], c[0]); + q_add(c[3], c[3], c[0]); + q_add(c[2], c[2], c[0]); + mul(c[0], a[0], b[0]); /* (a_0) x (b_0) */ + q_add(c[1], c[1], c[0]); + q_add(c[2], c[2], c[0]); + mul(c[4], a[2], b[2]); /* (a_2) x (b_2) */ + q_add(c[3], c[3], c[4]); + q_add(c[2], c[2], c[4]); + + return; + } + long hsa = (sa + 1) >> 1; if (hsa < sb) { @@ -579,8 +603,11 @@ GF2X *T1, *T2, *T3; - T1 = stk; stk += hsa; - T2 = stk; stk += hsa; + sp -= hsa2 - 1; + if (sp < 0) TerminalError("internal error: KarMul overflow"); + + T1 = c; + T2 = c + hsa; T3 = stk; stk += hsa2 - 1; /* compute T1 = a_lo + a_hi */ @@ -593,19 +620,19 @@ /* recursively compute T3 = T1 * T2 */ - KarMul(T3, T1, hsa, T2, hsa, stk); + KarMul(T3, T1, hsa, T2, hsa, stk, sp); /* recursively compute a_hi * b_hi into high part of c */ /* and subtract from T3 */ - KarMul(c + hsa2, a+hsa, sa-hsa, b+hsa, sb-hsa, stk); + KarMul(c + hsa2, a+hsa, sa-hsa, b+hsa, sb-hsa, stk, sp); KarAdd(T3, c + hsa2, sa + sb - hsa2 - 1); /* recursively compute a_lo*b_lo into low part of c */ /* and subtract from T3 */ - KarMul(c, a, hsa, b, hsa, stk); + KarMul(c, a, hsa, b, hsa, stk, sp); KarAdd(T3, c, hsa2 - 1); clear(c[hsa2 - 1]); @@ -619,15 +646,18 @@ GF2X *T; + sp -= hsa + sb - 1; + if (sp < 0) TerminalError("internal error: KarMul overflow"); + T = stk; stk += hsa + sb - 1; /* recursively compute b*a_hi into high part of c */ - KarMul(c + hsa, a + hsa, sa - hsa, b, sb, stk); + KarMul(c + hsa, a + hsa, sa - hsa, b, sb, stk, sp); /* recursively compute b*a_lo into T */ - KarMul(T, a, hsa, b, sb, stk); + KarMul(T, a, hsa, b, sb, stk, sp); KarFix(c, T, hsa + sb - 1, hsa); } @@ -796,7 +826,7 @@ sp = 0; do { hn = (n+1) >> 1; - sp += (hn << 2) - 1; + sp += (hn << 1) - 1; n = hn; } while (n > 1); @@ -812,7 +842,7 @@ stk[i+2*sa+sb-1] = rep(b.rep[i]); KarMul(&stk[0], &stk[sa+sb-1], sa, &stk[2*sa+sb-1], sb, - &stk[2*(sa+sb)-1]); + &stk[2*(sa+sb)-1], sp); c.rep.SetLength(sa+sb-1); @@ -871,7 +901,7 @@ sp = 0; do { hn = (n+1) >> 1; - sp += (hn << 2) - 1; + sp += (hn << 1) - 1; n = hn; } while (n > 1); @@ -887,7 +917,7 @@ stk[i+2*sa+sb-1] = rep(b.rep[i]); KarMul(&stk[0], &stk[sa+sb-1], sa, &stk[2*sa+sb-1], sb, - &stk[2*(sa+sb)-1]); + &stk[2*(sa+sb)-1], sp); c.rep.SetLength(sa+sb-1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntl-11.4.3/src/VERSION_INFO new/ntl-11.4.4/src/VERSION_INFO --- old/ntl-11.4.3/src/VERSION_INFO 2020-01-04 19:49:16.000000000 +0100 +++ new/ntl-11.4.4/src/VERSION_INFO 2021-03-05 17:49:15.000000000 +0100 @@ -1 +1 @@ -43:1:0 +43:2:0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntl-11.4.3/src/WINDIR new/ntl-11.4.4/src/WINDIR --- old/ntl-11.4.3/src/WINDIR 2020-01-04 19:49:16.000000000 +0100 +++ new/ntl-11.4.4/src/WINDIR 2021-03-05 17:49:15.000000000 +0100 @@ -1 +1 @@ -WinNTL-11_4_3 +WinNTL-11_4_4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntl-11.4.3/src/ZZX.cpp new/ntl-11.4.4/src/ZZX.cpp --- old/ntl-11.4.3/src/ZZX.cpp 2020-01-04 19:49:16.000000000 +0100 +++ new/ntl-11.4.4/src/ZZX.cpp 2021-03-05 17:49:14.625121791 +0100 @@ -650,7 +650,7 @@ static void KarMul(ZZ *c, const ZZ *a, - long sa, const ZZ *b, long sb, ZZ *stk) + long sa, const ZZ *b, long sb, ZZ *stk, long sp) { if (sa < sb) { { long t = sa; sa = sb; sb = t; } @@ -666,12 +666,12 @@ return; } - if (sb == 2 && sa == 2) { + if (sa == 2) { /* (sa => sb != 1) implies sb == 2 */ + add(c[0], a[0], a[1]); + add(c[2], b[0], b[1]); + mul(c[1], c[0], c[2]); mul(c[0], a[0], b[0]); mul(c[2], a[1], b[1]); - add(stk[0], a[0], a[1]); - add(stk[1], b[0], b[1]); - mul(c[1], stk[0], stk[1]); sub(c[1], c[1], c[0]); sub(c[1], c[1], c[2]); @@ -679,6 +679,30 @@ } + if (sa == 3 && sb == 3) { + add(c[0], a[0], a[2]); /* a_0 + a_2 */ + add(c[2], a[1], a[2]); /* a_1 + a_2 */ + add(c[1], b[0], b[2]); /* b_0 + b_2 */ + add(c[4], b[1], b[2]); /* b_1 + b_2 */ + mul(c[3], c[2], c[4]); /* (a_1 + a_2) x (b_1 + b_2) */ + mul(c[2], c[0], c[1]); /* (a_0 + a_2) x (b_0 + b_2) */ + add(c[0], a[0], a[1]); /* a_0 + a_1 */ + add(c[4], b[0], b[1]); /* b_0 + b_1 */ + mul(c[1], c[0], c[4]); /* (a_0 + a_1) x (b_0 + b_1) */ + mul(c[0], a[1], b[1]); /* (a_1) x (b_1) */ + sub(c[1], c[1], c[0]); + sub(c[3], c[3], c[0]); + add(c[2], c[2], c[0]); + mul(c[0], a[0], b[0]); /* (a_0) x (b_0) */ + sub(c[1], c[1], c[0]); + sub(c[2], c[2], c[0]); + mul(c[4], a[2], b[2]); /* (a_2) x (b_2) */ + sub(c[3], c[3], c[4]); + sub(c[2], c[2], c[4]); + + return; + } + long hsa = (sa + 1) >> 1; if (hsa < sb) { @@ -688,8 +712,11 @@ ZZ *T1, *T2, *T3; - T1 = stk; stk += hsa; - T2 = stk; stk += hsa; + sp -= hsa2 - 1; + if (sp < 0) TerminalError("internal error: KarMul overflow"); + + T1 = c; + T2 = c + hsa; T3 = stk; stk += hsa2 - 1; /* compute T1 = a_lo + a_hi */ @@ -702,19 +729,19 @@ /* recursively compute T3 = T1 * T2 */ - KarMul(T3, T1, hsa, T2, hsa, stk); + KarMul(T3, T1, hsa, T2, hsa, stk, sp); /* recursively compute a_hi * b_hi into high part of c */ /* and subtract from T3 */ - KarMul(c + hsa2, a+hsa, sa-hsa, b+hsa, sb-hsa, stk); + KarMul(c + hsa2, a+hsa, sa-hsa, b+hsa, sb-hsa, stk, sp); KarSub(T3, c + hsa2, sa + sb - hsa2 - 1); /* recursively compute a_lo*b_lo into low part of c */ /* and subtract from T3 */ - KarMul(c, a, hsa, b, hsa, stk); + KarMul(c, a, hsa, b, hsa, stk, sp); KarSub(T3, c, hsa2 - 1); clear(c[hsa2 - 1]); @@ -728,15 +755,18 @@ ZZ *T; + sp -= hsa + sb - 1; + if (sp < 0) TerminalError("internal error: KarMul overflow"); + T = stk; stk += hsa + sb - 1; /* recursively compute b*a_hi into high part of c */ - KarMul(c + hsa, a + hsa, sa - hsa, b, sb, stk); + KarMul(c + hsa, a + hsa, sa - hsa, b, sb, stk, sp); /* recursively compute b*a_lo into T */ - KarMul(T, a, hsa, b, sb, stk); + KarMul(T, a, hsa, b, sb, stk, sp); KarFix(c, T, hsa + sb - 1, hsa); } @@ -797,7 +827,7 @@ depth = 0; do { hn = (n+1) >> 1; - sp += (hn << 2) - 1; + sp += (hn << 1) - 1; n = hn; depth++; } while (n >= xover); @@ -807,7 +837,7 @@ ((maxa + maxb + NumBits(min(sa, sb)) + 2*depth + 10) + NTL_ZZ_NBITS-1)/NTL_ZZ_NBITS); - KarMul(cp, ap, sa, bp, sb, stk.elts()); + KarMul(cp, ap, sa, bp, sb, stk.elts(), sp); } c.normalize(); @@ -873,10 +903,10 @@ sqr(c[0], a[0]); mul(c[1], a[0], a[1]); add(c[1], c[1], c[1]); - sqr(stk[0], a[1]); + sqr(c[3], a[1]); mul(c[2], a[0], a[2]); add(c[2], c[2], c[2]); - add(c[2], c[2], stk[0]); + add(c[2], c[2], c[3]); mul(c[3], a[1], a[2]); add(c[3], c[3], c[3]); sqr(c[4], a[2]); @@ -890,7 +920,7 @@ ZZ *T1, *T2; - T1 = stk; stk += hsa; + T1 = c; T2 = stk; stk += hsa2-1; KarFold(T1, a, sa, hsa); @@ -952,7 +982,7 @@ depth = 0; do { hn = (n+1) >> 1; - sp += hn+hn+hn - 1; + sp += hn+hn - 1; n = hn; depth++; } while (n >= xover); @@ -1017,7 +1047,7 @@ depth = 0; do { hn = (n+1) >> 1; - sp += (hn << 2) - 1; + sp += (hn << 1) - 1; n = hn; depth++; } while (n >= xover); @@ -1089,7 +1119,7 @@ depth = 0; do { hn = (n+1) >> 1; - sp += (hn << 2) - 1; + sp += (hn << 1) - 1; n = hn; depth++; } while (n >= xover); @@ -1099,7 +1129,7 @@ ((maxa + maxb + NumBits(min(sa, sb)) + 2*depth + 10) + NTL_ZZ_NBITS-1)/NTL_ZZ_NBITS); - KarMul(cp, ap, sa, bp, sb, stk.elts()); + KarMul(cp, ap, sa, bp, sb, stk.elts(), sp); c.rep.SetLength(sc); for (long i = 0; i < sc; i++) conv(c.rep[i], cp[i]); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntl-11.4.3/src/lip.cpp new/ntl-11.4.4/src/lip.cpp --- old/ntl-11.4.3/src/lip.cpp 2020-01-04 19:49:16.000000000 +0100 +++ new/ntl-11.4.4/src/lip.cpp 2021-03-05 17:49:14.000000000 +0100 @@ -745,10 +745,10 @@ /* allocate space */ - sp -= (hsa + 1) + (hsa + 1) + ((hsa << 1) + 2); + sp -= (hsa + 1) + ((hsa << 1) + 2); if (sp < 0) TerminalError("internal error: kmem overflow"); - T1 = stk; stk += hsa + 1; + T1 = c; T2 = stk; stk += hsa + 1; T3 = stk; stk += (hsa << 1) + 2; @@ -808,7 +808,7 @@ long sp = 0; do { long hn = (n+1) >> 1; - sp += (hn << 2) + 7; + sp += hn * 3 + 7; n = hn+1; } while (n >= KARX); @@ -835,10 +835,10 @@ long hsa = (sa + 1) >> 1; _ntl_limb_t *T1, *T2; - sp -= (hsa + 1) + ((hsa << 1) + 2); + sp -= (hsa << 1) + 2; if (sp < 0) TerminalError("internal error: kmem overflow"); - T1 = stk; stk += hsa + 1; + T1 = c; T2 = stk; stk += (hsa << 1) + 2; long sT1 = kar_fold(T1, a, sa, hsa); @@ -862,7 +862,7 @@ long sp = 0; do { long hn = (n+1) >> 1; - sp += 3*hn + 5; + sp += 2*hn + 5; n = hn+1; } while (n >= KARSX);
