Sisyphus repository
Last update: 4 october 2022 | SRPMs: 17717 | Visits: 25060148
en ru br
ALT Linux repos

Group :: System/Libraries
RPM: libblake2

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

# SPDX-License-Identifier: GPL-2.0-only
%define _unpackaged_files_terminate_build 1
%define _stripped_files_terminate_build 1
%set_verify_elf_method strict

Name: libblake2
Summary: BLAKE2 official implementations
Version: 20190724
Release: alt1
License: Apache-2.0 or CC0-1.0 or OpenSSL
Group: System/Libraries

Source: %name-%version.tar

BLAKE2 is a cryptographic hash function faster than MD5, SHA-1, SHA-2, and
SHA-3, yet is at least as secure as the latest standard SHA-3. BLAKE2 has been
adopted by many projects due to its high speed, security, and simplicity.

%package devel
Summary: %summary
Group: Development/C
Requires: %name = %EVR

%description devel

# Unused source files that will clobber glob.
rm neon/blake2b-neon.c
rm neon/blake2s-neon.c
# Delete invalid default options.
sed -i 's/-march=armv7-a//;s/-mfpu=neon-vfpv4//;s/-mfloat-abi=hard//;s/-fopenmp//' neon/makefile

%define _optlevel 3
FLAGS="%optflags -shared -fPIC -Wl,-soname,"
%ifarch x86_64
 cd sse
%ifarch aarch64
 cd neon
%ifarch ppc64le
 cd power8
 [ -e blake2.h ] || cd ref
# Build and test.
# Finally make lib.
gcc $FLAGS -o blake2*.c blake2*.h

cd $(dirname */
mkdir -p %buildroot%_includedir
install -Dp blake2.h %buildroot%_includedir/
install -Dp %buildroot%_libdir/
ln -s   %buildroot%_libdir/
ln -s   %buildroot%_libdir/

cd b2sum
export LD_LIBRARY_PATH=%buildroot%_libdir
gcc -o b2sum %optflags -I%buildroot%_includedir b2sum.c -L%buildroot%_libdir -lblake2
./b2sum -a blake2b  < /dev/null | grep 786a02f742015903c6c6fd852552d272912f4740e15847618a86e217f71f5419d25e1031afee585313896444934eb04b903a685b1448b755d56f701afe9be2ce
./b2sum -a blake2bp < /dev/null | grep b5ef811a8038f70b628fa8b294daae7492b1ebe343a80eaabbf1f6ae664dd67b9d90b0120791eab81dc96985f28849f6a305186a85501b405114bfa678df9380
./b2sum -a blake2s  < /dev/null | grep 69217a3079908094e11121d042354a7c1f55b6482ca1a51e1b250dfd1ed0eef9
./b2sum -a blake2sp < /dev/null | grep dd0e891776933f43c7d032b08a917e25741f8aa9a12c12e1cac8801500f2ca4f


%files devel


Full changelog you can see here

design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin