Sisyphus repository
Last update: 1 april 2023 | SRPMs: 18287 | Visits: 27241085
en ru br
ALT Linux repos

Group :: System/Libraries
RPM: libblake3

 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: libblake3
Version: 1.3.1
Release: alt1
Summary: The official C implementations of the BLAKE3 cryptographic hash function
License: Apache-2.0 or CC0-1.0
Group: System/Libraries
# Docs:

Source: %name-%version.tar

BuildRequires: banner
%{?!_without_check:%{?!_disable_check:BuildRequires: python3 /proc}}

BLAKE3 is a cryptographic hash function that is:
- Much faster than MD5, SHA-1, SHA-2, SHA-3, and BLAKE2.
- Secure, unlike MD5 and SHA-1. And secure against length extension,
 unlike SHA-2.
- Highly parallelizable across any number of threads and SIMD lanes, because
 it's a Merkle tree on the inside.
- Capable of verified streaming and incremental updates, again because it's
 a Merkle tree.
- A PRF, MAC, KDF, and XOF, as well as a regular hash.
- One algorithm with no variants, which is fast on x86-64 and also on smaller

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

%description devel

%package checkinstall
Summary: Checkinstall for %name-devel
Group: Development/Other
BuildArch: noarch
Requires(pre): %name-devel = %EVR
Requires(pre): gcc

%description checkinstall

sed -i 's/"blake3.h"/<blake3.h>/' c/example.c
ln -s Makefile.altlinux c/GNUmakefile

%define _optlevel 3
%add_optflags -Wextra -Wa,--noexecstack
CFLAGS="%optflags" \
%make_build -C c

%makeinstall_std -C c

cd c
banner check
set -o pipefail
%ifarch aarch64
 # Leak sanitizer is so slow there.
 export ASAN_OPTIONS=leak_check_at_exit=0
make check 2>&1 | tail

%pre checkinstall
set -ex
cd /tmp
gcc -o example %_defaultdocdir/%name-devel-%version/example.c -lblake3
./example < /dev/null | grep af1349b9f5f9a1a6a0404dea36dcc9499bcb25c9adc112b7cc9a93cae41f3262
rm example


%files devel
%doc c/ c/example.c blake3.pdf

%files checkinstall


Full changelog you can see here

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