diff --git a/argon2.spec b/argon2.spec new file mode 100644 index 0000000..a30ac46 --- /dev/null +++ b/argon2.spec @@ -0,0 +1,109 @@ +Name: argon2 +Version: 20161029 +Release: 7 +Summary: A password-hashing tool +License: Public Domain or ASL 2.0 +URL: https://github.com/P-H-C/phc-winner-argon2 +Source0: https://github.com/P-H-C/phc-winner-argon2/archive/1c4fc41f81f358283755eea88d4ecd05e43b7fd3/phc-winner-argon2-20161029-1c4fc41.tar.gz + +BuildRequires: gcc +Provides: libargon2 +Obsoletes: libargon2 + +%description +Argon2 is a password-hashing function that summarizes the state of the art in the design of +memory-hard functions and can be used to hash passwords for credential storage, key derivation, +or other applications. + +It has a simple design aimed at the highest memory filling rate and effective use of multiple +computing units, while still providing defense against tradeoff attacks (by exploiting the +cache and memory organization of the recent processors). + +Argon2 has three variants: Argon2i, Argon2d, and Argon2id. Argon2d is faster and uses data-depending +memory access, which makes it highly resistant against GPU cracking attacks and suitable for +applications with no threats from side-channel timing attacks (eg. cryptocurrencies). Argon2i +instead uses data-independent memory access, which is preferred for password hashing and +password-based key derivation, but it is slower as it makes more passes over the memory to +protect from tradeoff attacks. Argon2id is a hybrid of Argon2i and Argon2d, using a combination +of data-depending and data-independent memory accesses, which gives some of Argon2i's resistance +to side-channel cache timing attacks and much of Argon2d's resistance to GPU cracking attacks. + +Argon2i, Argon2d, and Argon2id are parametrized by: + +- A time cost, which defines the amount of computation realized and therefore the execution +time, given in number of iterations +- A memory cost, which defines the memory usage, given in kibibytes +- A parallelism degree, which defines the number of parallel threads + +%package devel +Summary: Development library files for argon2 +Requires: %{name}%{?_isa} = %{version}-%{release} +Provides: libargon2-devel +Obsoletes: libargon2-devel + +%description devel +This package contains development library files and headers for the argon2. + +%package_help + +%prep +%setup -qn phc-winner-argon2-1c4fc41f81f358283755eea88d4ecd05e43b7fd3 + +if ! grep -q 'soname,libargon2.so.*' Makefile; then + : soname have changed + grep soname Makefile + exit 1 +fi + +sed -e 's:lib/@HOST_MULTIARCH@:%{_lib}:;s/@UPSTREAM_VER@/%{version}/' -i libargon2.pc + +sed -e '/^CFLAGS/s:^CFLAGS:LDFLAGS=%{build_ldflags}\nCFLAGS:' \ + -e 's:-O3 -Wall:%{optflags}:' \ + -e '/^LIBRARY_REL/s:lib:%{_lib}:' \ + -e 's:-march=\$(OPTTARGET) :${CFLAGS} :' \ + -e 's:CFLAGS += -march=\$(OPTTARGET)::' \ + -i Makefile + +%build +make -j1 + +%install +%make_install +%delete_la_and_a + +install -Dpm 644 libargon2.pc %{buildroot}%{_libdir}/pkgconfig/libargon2.pc +install -Dpm 644 man/argon2.1 %{buildroot}%{_mandir}/man1/argon2.1 + +mv %{buildroot}%{_libdir}/libargon2.so %{buildroot}%{_libdir}/libargon2.so.0 +ln -s libargon2.so.0 %{buildroot}%{_libdir}/libargon2.so + +%check +make test + +%pre + +%preun + +%post -n %{name} -p /sbin/ldconfig + +%postun -n %{name} -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%{_bindir}/%{name} +%license LICENSE +%{_libdir}/libargon2.so.* + +%files devel +%defattr(-,root,root) +%{_includedir}/%{name}.h +%{_libdir}/libargon2.so +%{_libdir}/pkgconfig/*pc + +%files help +%doc *md +%{_mandir}/man1/* + +%changelog +* Tue Sep 10 2019 openEuler Buildteam - 20161029-7 +- Package init diff --git a/phc-winner-argon2-20161029-1c4fc41.tar.gz b/phc-winner-argon2-20161029-1c4fc41.tar.gz new file mode 100644 index 0000000..3059d42 Binary files /dev/null and b/phc-winner-argon2-20161029-1c4fc41.tar.gz differ