diff --git a/_service b/_service
new file mode 100644
index 0000000..ef3f528
--- /dev/null
+++ b/_service
@@ -0,0 +1,17 @@
+
+
+ argon2
+ 0.0
+ 0.0+git%cd.%h
+ https://github.com/P-H-C/phc-winner-argon2.git
+ git
+ enable
+
+ 20171227
+
+
+ xz
+ *.tar
+
+
+
diff --git a/_servicedata b/_servicedata
new file mode 100644
index 0000000..5e36dd1
--- /dev/null
+++ b/_servicedata
@@ -0,0 +1,4 @@
+
+
+ https://github.com/P-H-C/phc-winner-argon2.git
+ 670229c849b9fe882583688b74eb7dfdc846f9f6
\ No newline at end of file
diff --git a/argon2-0.0+git20171227.670229c.tar.xz b/argon2-0.0+git20171227.670229c.tar.xz
new file mode 100644
index 0000000..1861b2a
--- /dev/null
+++ b/argon2-0.0+git20171227.670229c.tar.xz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:412899b064fa8c444eb4cf7516f90812dc194414516145c72aede6a73989342e
+size 1339200
diff --git a/argon2.changes b/argon2.changes
index cdf6ab1..c45551b 100644
--- a/argon2.changes
+++ b/argon2.changes
@@ -1,3 +1,14 @@
+-------------------------------------------------------------------
+Tue Jan 09 08:10:20 UTC 2018 - lnussel@suse.de
+
+- Update to version 0.0+git20171227.670229c:
+ * Added ABI version number
+ * AVX2/AVX-512F optimizations of BLAMKA
+ * Set Argon2 version number from the command line
+ * New bindings
+ * Minor bug and warning fixes (no security issue)
+- use _service file
+
-------------------------------------------------------------------
Tue Apr 18 14:01:09 UTC 2017 - meissner@suse.com
diff --git a/argon2.spec b/argon2.spec
index 3b08e47..2c61087 100644
--- a/argon2.spec
+++ b/argon2.spec
@@ -1,7 +1,7 @@
#
# spec file for package argon2
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,20 +16,26 @@
#
-%define lname libargon2-0
-%define _version 20161029
+%ifarch i686 x86_64
+%define no_optimize 0
+%else
+%define no_optimize 1
+%endif
+# for convenience
+%define make %__make OPTFLAGS="%{optflags}" OPTTEST=%no_optimize LIB_ST= LIBRARY_REL=%_lib
+
+%define lname libargon2-1
Name: argon2
-Version: 0.0+%{_version}
+Version: 0.0+git20171227.670229c
Release: 0
Summary: The reference C implementation of Argon2
License: CC0-1.0 or Apache-2.0
Group: Productivity/Networking/Security
Url: https://github.com/P-H-C/phc-winner-argon2
-Source: https://github.com/P-H-C/phc-winner-argon2/archive/%{_version}.tar.gz#/phc-winner-argon2-%{_version}.tar.gz
+Source: %{name}-%{version}.tar.xz
Patch1: optflags.patch
BuildRequires: pkgconfig
BuildRequires: sed
-ExclusiveArch: i686 x86_64
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -67,34 +73,29 @@ Headers for argon2, the reference C implementation of Argon2, the
password-hashing function that won the Password Hashing Competition (PHC).
%prep
-%setup -q -n phc-winner-argon2-%{_version}
-%patch1 -p1
-
-sed -i s,"LIBRARY_REL = lib","LIBRARY_REL = %{_lib}", Makefile
+%autosetup
%build
-make %{?_smp_mflags} CFLAGS="-pthread %{optflags} -Iinclude -Isrc"
+%make %{?_smp_mflags}
+# fix pkgconfig file
+sed -e 's:lib/@HOST_MULTIARCH@:%{_lib}:;s/@UPSTREAM_VER@/%{version}/' -i libargon2.pc
%install
-make %{?_smp_mflags} DESTDIR=%{buildroot} install
-
-chmod -x %{buildroot}%{_includedir}/argon2.h
-
-mv %{buildroot}%{_libdir}/libargon2.so %{buildroot}%{_libdir}/libargon2.so.0
-ln -s %{_libdir}/libargon2.so.0 %{buildroot}%{_libdir}/libargon2.so
+%make DESTDIR=%{buildroot} install
install -D -m 644 man/argon2.1 %{buildroot}%{_mandir}/man1/argon2.1
install -D -m 644 libargon2.pc %{buildroot}/%{_libdir}/pkgconfig/libargon2.pc
%check
-make CFLAGS="-pthread %{optflags} -Iinclude -Isrc" test
+%make test
%post -n %{lname} -p /sbin/ldconfig
%postun -n %{lname} -p /sbin/ldconfig
%files
%defattr(-,root,root)
-%doc LICENSE CHANGELOG.md README.md
+%license LICENSE
+%doc CHANGELOG.md README.md
%{_bindir}/argon2
%{_mandir}/man1/argon2.1%{ext_man}
@@ -104,7 +105,7 @@ make CFLAGS="-pthread %{optflags} -Iinclude -Isrc" test
%files -n %{lname}
%defattr(-,root,root)
-%{_libdir}/libargon2.so.0
+%{_libdir}/libargon2.so.1
%files devel
%defattr(-,root,root)
diff --git a/optflags.patch b/optflags.patch
index 2da25a8..9127c81 100644
--- a/optflags.patch
+++ b/optflags.patch
@@ -1,66 +1,31 @@
-Index: phc-winner-argon2-20161029/Makefile
-===================================================================
---- phc-winner-argon2-20161029.orig/Makefile
-+++ phc-winner-argon2-20161029/Makefile
-@@ -21,28 +21,14 @@ GENKAT = genkat
-
- DIST = phc-winner-argon2
-
--SRC = src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c
-+SRC = src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c src/opt.c
- SRC_RUN = src/run.c
- SRC_BENCH = src/bench.c
+diff --git a/Makefile b/Makefile
+index 1e1129f..33fe491 100644
+--- a/Makefile
++++ b/Makefile
+@@ -30,7 +30,7 @@ SRC_BENCH = src/bench.c
SRC_GENKAT = src/genkat.c
OBJ = $(SRC:.c=.o)
--CFLAGS += -std=c89 -pthread -O3 -Wall -g -Iinclude -Isrc
--CI_CFLAGS := $(CFLAGS) -Werror=declaration-after-statement -D_FORTIFY_SOURCE=2 \
-- -Wextra -Wno-type-limits -Werror -coverage -DTEST_LARGE_RAM
--
+-CFLAGS += -std=c89 -O3 -Wall -g -Iinclude -Isrc
++CFLAGS += $(OPTFLAGS) -Iinclude -Isrc
+
+ ifeq ($(NO_THREADS), 1)
+ CFLAGS += -DARGON2_NO_THREADS
+@@ -41,16 +41,12 @@ endif
+ CI_CFLAGS := $(CFLAGS) -Werror=declaration-after-statement -D_FORTIFY_SOURCE=2 \
+ -Wextra -Wno-type-limits -Werror -coverage -DTEST_LARGE_RAM
+
-OPTTARGET ?= native
- OPTTEST := $(shell $(CC) -Iinclude -Isrc -march=$(OPTTARGET) src/opt.c -c \
- -o /dev/null 2>/dev/null; echo $$?)
--# Detect compatible platform
--ifneq ($(OPTTEST), 0)
--$(info Building without optimizations)
-- SRC += src/ref.c
--else
+-OPTTEST := $(shell $(CC) -Iinclude -Isrc -march=$(OPTTARGET) src/opt.c -c \
+- -o /dev/null 2>/dev/null; echo $$?)
+ # Detect compatible platform
+ ifneq ($(OPTTEST), 0)
+ $(info Building without optimizations)
+ SRC += src/ref.c
+ else
-$(info Building with optimizations for $(OPTTARGET))
- CFLAGS += -march=$(OPTTARGET)
-- SRC += src/opt.c
--endif
++$(info Building with optimizations)
+ SRC += src/opt.c
+ endif
- BUILD_PATH := $(shell pwd)
- KERNEL_NAME := $(shell uname -s)
-@@ -88,7 +74,7 @@ endif
-
- LIB_SH := lib$(LIB_NAME).$(LIB_EXT)
- LIB_ST := lib$(LIB_NAME).a
--LIBRARIES = $(LIB_SH) $(LIB_ST)
-+LIBRARIES = $(LIB_SH)
- HEADERS = include/argon2.h
-
- INSTALL = install
-@@ -105,11 +91,11 @@ INST_BINARY = $(DESTDIR)$(PREFIX)/$(BINA
-
- .PHONY: clean dist format $(GENKAT) all install
-
--all: clean $(RUN) libs
-+all: $(RUN) libs
- libs: $(LIBRARIES)
-
- $(RUN): $(SRC) $(SRC_RUN)
-- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
-+ $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
-
- $(BENCH): $(SRC) $(SRC_BENCH)
- $(CC) $(CFLAGS) $^ -o $@
-@@ -118,7 +104,7 @@ $(GENKAT): $(SRC) $(SRC_GENKAT)
- $(CC) $(CFLAGS) $^ -o $@ -DGENKAT
-
- $(LIB_SH): $(SRC)
-- $(CC) $(CFLAGS) $(LIB_CFLAGS) $(LDFLAGS) $(SO_LDFLAGS) $^ -o $@
-+ $(CC) $(CFLAGS) $(LIB_CFLAGS) $(SO_LDFLAGS) $^ -o $@ $(LDFLAGS)
-
- $(LIB_ST): $(OBJ)
- ar rcs $@ $^
diff --git a/phc-winner-argon2-20161029.tar.gz b/phc-winner-argon2-20161029.tar.gz
deleted file mode 100644
index adf850b..0000000
--- a/phc-winner-argon2-20161029.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:fe0049728b946b58b94cc6db89b34e2d050c62325d16316a534d2bedd78cd5e7
-size 1506864