diff --git a/libxcrypt-4.4.28.tar.xz b/libxcrypt-4.4.28.tar.xz deleted file mode 100644 index 20fced6376a64b28bf3f26d4af8d114453862447..0000000000000000000000000000000000000000 Binary files a/libxcrypt-4.4.28.tar.xz and /dev/null differ diff --git a/libxcrypt-4.4.28.tar.xz.asc b/libxcrypt-4.4.28.tar.xz.asc deleted file mode 100644 index a2de990453fbeca5e76efe143f97135209556e29..0000000000000000000000000000000000000000 --- a/libxcrypt-4.4.28.tar.xz.asc +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCAAdFiEEZ4zj/uQwMRWW24wW9S6YAHWUwh0FAmH5tQIACgkQ9S6YAHWU -wh0Vsg/7BG+aIoVGuE5aEl9ILoCaujen52ezT+z0wbmwW75sz+QSRgvCsN7DeF6v -KqXfQVdD6tvRPKY2tzJ9wJerzeKTDbYSYhgiQ5Ic4cS3YwGi6fJ+I7j67MTnG0ci -dtUPwL05XcpO5tVCiUj/NOSVo9KZwl3Fj1/SvCs3VzS1ECJ47Fr2jlOftHkLcdy7 -FEGji8WKsEIdLEtszKk1r9TmuXIacYESFxrNSMEqR19B6hVMMSzEtDfxD258p7xz -0lVUetsSrpU7BJ7jVJrariicKs7BuRvTBnpylkXp2Oep+AkD70sfRFUhauMkWfvr -6qjhHRmerqaN2+GTU/A55oPY3gbtvrKqaIMRf+qIEvr4o/Ju/hyTgRQUe2cHXK1t -zduSr52Ctjj3FUBBFIeseA24YkWpgouHoVmeKjrDn8NbXB2oeR6SlZdbrp0eXFjD -J4GhJIjWmArJP3FE8qLbw2OD72Bxruwr2906osVMtvV/XpyWUTGAcjqWSu+YxZHk -KB9RpHlaF0AALqfBJZlWeft7PAIJxzw8CCgGucAVqnQmF6y1QWVYaIubh0jX8Pla -ehG3re76C1XFm5atRsasSP8au+JYFZN8ARuPhLzKrRDQpLr3Ro0Fg9gSoCvMgjW6 -S3l5fOd2GmKpelzEHjnRgj9srSNFDH6ID3KVKX861tbkC8lSeQU= -=ZNX1 ------END PGP SIGNATURE----- diff --git a/libxcrypt-4.4.28.tar.xz.sha256sum b/libxcrypt-4.4.28.tar.xz.sha256sum deleted file mode 100644 index 29dc4942afa3b6ad28eaf8bacf6583530cbd754c..0000000000000000000000000000000000000000 --- a/libxcrypt-4.4.28.tar.xz.sha256sum +++ /dev/null @@ -1,2 +0,0 @@ -9e936811f9fad11dbca33ca19bd97c55c52eb3ca15901f27ade046cc79e69e87 libxcrypt-4.4.28.tar.xz -746ddc76239e00ae3a4085049538266e08791de88f0b974c68ceaa59669fc9c6 libxcrypt-4.4.28.tar.xz.asc diff --git a/libxcrypt-4.4.33-SHA512_Maj_optimization.patch b/libxcrypt-4.4.33-SHA512_Maj_optimization.patch new file mode 100644 index 0000000000000000000000000000000000000000..6f975d7d10aaff49690a3e3e1182f0492a73530f --- /dev/null +++ b/libxcrypt-4.4.33-SHA512_Maj_optimization.patch @@ -0,0 +1,56 @@ +From 59823543d095ad0fe4a063d819c52953249c9ba0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Wed, 7 Dec 2022 07:04:51 +0100 +Subject: [PATCH] alg-sha512.c: SHA-2 Maj() optimization proposed by Wei Dai. + +This patch has already been applied to 'lib/alg-sha256.c' +in commit bb1721800932268a537c804a4b7655af8c62d5e8. +--- + lib/alg-sha512.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/lib/alg-sha512.c b/lib/alg-sha512.c +index c30f8a01..4e9965db 100644 +--- a/lib/alg-sha512.c ++++ b/lib/alg-sha512.c +@@ -1,6 +1,7 @@ + /*- + * Copyright 2005 Colin Percival + * Copyright (c) 2015 Allan Jude ++ * Copyright 2021, 2022 Alexander Peslyak + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -78,7 +79,11 @@ static const uint64_t K[80] = { + + /* Elementary functions used by SHA512 */ + #define Ch(x, y, z) ((x & (y ^ z)) ^ z) +-#define Maj(x, y, z) ((x & (y | z)) | (y & z)) ++#if 1 /* Explicit caching/reuse of common subexpression between rounds */ ++#define Maj(x, y, z) (y ^ ((x_xor_y = x ^ y) & y_xor_z)) ++#else /* Let the compiler cache/reuse or not */ ++#define Maj(x, y, z) (y ^ ((x ^ y) & (y ^ z))) ++#endif + #define SHR(x, n) (x >> n) + #define ROTR(x, n) ((x >> n) | (x << (64 - n))) + #define S0(x) (ROTR(x, 28) ^ ROTR(x, 34) ^ ROTR(x, 39)) +@@ -90,7 +95,8 @@ static const uint64_t K[80] = { + #define RND(a, b, c, d, e, f, g, h, k) \ + h += S1(e) + Ch(e, f, g) + k; \ + d += h; \ +- h += S0(a) + Maj(a, b, c); ++ h += S0(a) + Maj(a, b, c); \ ++ y_xor_z = x_xor_y; + + /* Adjusted round function for rotating state */ + #define RNDr(S, W, i, ii) \ +@@ -123,6 +129,7 @@ SHA512_Transform(uint64_t * state, const unsigned char block[SHA512_BLOCK_LENGTH + + /* 3. Mix. */ + for (i = 0; i < 80; i += 16) { ++ uint64_t x_xor_y, y_xor_z = S[(65 - i) % 8] ^ S[(66 - i) % 8]; + RNDr(S, W, 0, i); + RNDr(S, W, 1, i); + RNDr(S, W, 2, i); + +-- \ No newline at end of file diff --git a/libxcrypt-4.4.33-yescrypt_platform_cast_performance.patch b/libxcrypt-4.4.33-yescrypt_platform_cast_performance.patch new file mode 100644 index 0000000000000000000000000000000000000000..c16ed54531807d2e5e83a25fef27712182ce479c --- /dev/null +++ b/libxcrypt-4.4.33-yescrypt_platform_cast_performance.patch @@ -0,0 +1,24 @@ +From 9d5e7b7307f264c2d177a1f014fa3a3b9da524df Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Sun, 20 Nov 2022 09:57:15 +0100 +Subject: [PATCH] alg-yescrypt-platform.c: Optimize some cast operation for + performance. + +--- + lib/alg-yescrypt-platform.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/alg-yescrypt-platform.c b/lib/alg-yescrypt-platform.c +index d68af2d..fbad1dc 100644 +--- a/lib/alg-yescrypt-platform.c ++++ b/lib/alg-yescrypt-platform.c +@@ -59,7 +59,7 @@ static void *alloc_region(yescrypt_region_t *region, size_t size) + if (base != MAP_FAILED) { + base_size = new_size; + } else if (flags & MAP_HUGETLB) { +- flags &= (unsigned int)~(MAP_HUGETLB | MAP_HUGE_2MB); ++ flags &= ~(unsigned int)(MAP_HUGETLB | MAP_HUGE_2MB); + base = mmap(NULL, size, PROT_READ | PROT_WRITE, (int)flags, -1, 0); + } + +-- \ No newline at end of file diff --git a/libxcrypt-4.4.33.tar.xz b/libxcrypt-4.4.33.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..85f0a52d6d808076fcd4bf763c8793e9e861e239 Binary files /dev/null and b/libxcrypt-4.4.33.tar.xz differ diff --git a/libxcrypt-4.4.33.tar.xz.asc b/libxcrypt-4.4.33.tar.xz.asc new file mode 100644 index 0000000000000000000000000000000000000000..4eba9d5abf422a90aaeb3f423d5a810f6f81ab93 --- /dev/null +++ b/libxcrypt-4.4.33.tar.xz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCAAdFiEEZ4zj/uQwMRWW24wW9S6YAHWUwh0FAmN3044ACgkQ9S6YAHWU +wh32zQ/+Kkw7VpFYVhgkfYfmyS/08LCp6EMYHhLP8OxMxFqRxA3boSGJll4GFTU9 +/+UiWpnFs/3prr+0w9WiF4iK8A230urzMVwql1y2KvUvoHOxtagBdtBjP0pxzSJc +MWR9cXNMTRLQFrADov+1lrrZr+fHPs5bVcLa8THD9TGBRXN8RUg1Yt6RGyJX+fsd +Gf72yfQh9lKZEzf42zd9wUE9zkEEeUoHh4gOvy6EYVvjSoQnM7l5Vs3nP9XVJpvi +RxFvioeo32JSebvFV+yLx62SSQaJfMIqP7xHtrCQS41VbGxqd/N411z+9q+bQEWi +cwytUDKSbM8ax1Bqj4EQeCulLMuLZF/hNY9abzzfYWlVYQktYaE+/ZVubOF8Ng/k +IZ2WBZCq2U2lOrxEJCSrZ7php6XXIq+dEEcsUXXCLQZjfOn/8tdsXblp3eFF6XIh +Xf+UDW8BEKXcE1EFqMwf2Vsd4sBd9qsqEaHiDhz6AW+3qz1QcGIBtYjAKv0bo2Vi +CGX/ggtEHruff0PVwRC+ALo6bHW+R/q54rWA3+cPBm7nGqQkJib42UJDyHvCziw6 +OWZgYY6Prac+jPu8TIZelIBmM+lS0kvCAvREUf1Ec9I1iYkG9kboA80gvOx2smfB +vWcTAr/NqYZF3CmkIz3t606n6FrXnKudAiWN6si+HEHsY6efw8o= +=zK1h +-----END PGP SIGNATURE----- diff --git a/libxcrypt-4.4.33.tar.xz.sha256sum b/libxcrypt-4.4.33.tar.xz.sha256sum new file mode 100644 index 0000000000000000000000000000000000000000..cbbc3712038150bb27dc8ad6df328ec07ac59e21 --- /dev/null +++ b/libxcrypt-4.4.33.tar.xz.sha256sum @@ -0,0 +1,2 @@ +e87acf9c652c573a4713d5582159f98f305d56ed5f754ce64f57d4194d6b3a6f libxcrypt-4.4.33.tar.xz +23347dc4535e050ef0ca4f0f95b3d95625c868c876fdca0d341412eb1871e0b3 libxcrypt-4.4.33.tar.xz.asc diff --git a/libxcrypt.spec b/libxcrypt.spec index 2a210ca73172c547934a4a98dbb2588a93058c78..0444e15d4e9d6ed042cc1bd4d41383388e00c8b4 100644 --- a/libxcrypt.spec +++ b/libxcrypt.spec @@ -1,3 +1,5 @@ +%define anolis_release 1 + %bcond_without new_api %bcond_without compat_pkg %bcond_without enosys_stubs @@ -98,8 +100,8 @@ fi \ Name: libxcrypt -Version: 4.4.28 -Release: 1%{?dist} +Version: 4.4.33 +Release: %{anolis_release}%{?dist} Summary: Extended crypt library for descrypt, md5crypt, bcrypt, and others License: LGPLv2+ and BSD and Public Domain @@ -109,6 +111,9 @@ Source1: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.xz.a Source2: %{url}/releases/download/v%{version}/%{name}-gpgkey.gpg Source3: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.xz.sha256sum +Patch0000: libxcrypt-4.4.33-yescrypt_platform_cast_performance.patch +Patch0001: libxcrypt-4.4.33-SHA512_Maj_optimization.patch + BuildRequires: fipscheck BuildRequires: gcc BuildRequires: glibc-devel >= %{glibc_minver} @@ -211,6 +216,14 @@ You don't need this, unless you link statically, which is highly discouraged. %endif +%package doc +Summary: Documents for %{name} +BuildArch: noarch +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description doc +Doc pages for %{name}. + %prep %if %{without bootstrap} @@ -315,6 +328,7 @@ unset LT_SYS_LIBRARY_PATH pushd %{_vpath_builddir}-all_possible_tests %configure \ +ac_cv_func_arc4random_buf=no \ %if %{with compat_pkg} %{common_configure_options} \ --enable-hashes=all \ @@ -353,7 +367,6 @@ install -Dpm 0644 -t %{buildroot}%{_pkgdocdir} \ rm -f %{buildroot}%{_pkgdocdir}/README.md - %check build_dirs="%{_vpath_builddir}" %if %{with compat_pkg} @@ -381,15 +394,6 @@ done %files %dir %{_fipsdir} %doc %dir %{_pkgdocdir} -%doc %{_pkgdocdir}/NEWS -%doc %{_pkgdocdir}/README -%if %{with new_api} -%doc %{_pkgdocdir}/README%{distname} -%endif -%if %{with enosys_stubs} && %{without compat_pkg} -%doc %{_pkgdocdir}/README.posix -%endif -%doc %{_pkgdocdir}/THANKS %license AUTHORS COPYING.LIB LICENSING %{_fipsdir}/libcrypt.so.%{soc}.hmac %{_fipsdir}/libcrypt.so.%{sov}.hmac @@ -449,7 +453,23 @@ done %endif %endif +%files doc +%doc %{_pkgdocdir}/NEWS +%doc %{_pkgdocdir}/README +%if %{with new_api} +%doc %{_pkgdocdir}/README%{distname} +%endif +%if %{with enosys_stubs} && %{without compat_pkg} +%doc %{_pkgdocdir}/README.posix +%endif +%doc %{_pkgdocdir}/THANKS + %changelog +* Fri Dec 30 2022 Ziyang Zhang 4.4.33-1 +- Update to 4.4.33 +- Add doc subpackage including NEWS, README and THANKS +- Add two newest patches optimizing performance + * Thu Mar 17 2022 forrest_ly - 4.4.28-1 - Init for Anolis OS 23