Skip to content

Commit

Permalink
fix: remove blake hash
Browse files Browse the repository at this point in the history
reasons for this: it ended up unused, blake2s never worked and the
main reason it was added (implementing argon2) failed as argon2 makes
a weird use of blake internals that isn't portable to 32bits
  • Loading branch information
jaromil committed Aug 25, 2023
1 parent 0fee476 commit 671a2fd
Show file tree
Hide file tree
Showing 21 changed files with 16 additions and 2,986 deletions.
11 changes: 1 addition & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pwd := $(shell pwd)
PREFIX ?= /usr/local
# VERSION is set in src/Makefile
# Targets to be build in this order
BUILDS := apply-patches milagro lua54 embed-lua quantum-proof ed25519-donna mimalloc blake2
BUILDS := apply-patches milagro lua54 embed-lua quantum-proof ed25519-donna mimalloc

# DESTDIR is supported by install target

Expand Down Expand Up @@ -163,14 +163,6 @@ ed25519-donna:
LDFLAGS="${ldflags}" \
$(MAKE) -C ${pwd}/lib/ed25519-donna

blake2:
$(info -- Building Blake2 hash)
CC="${blake2_cc}" \
AR=${ar} \
CFLAGS="${cflags}" \
LDFLAGS="${ldflags}" \
$(MAKE) -C ${pwd}/lib/blake2

# -------------------
# Test suites for all platforms
include ${pwd}/build/tests.mk
Expand Down Expand Up @@ -198,7 +190,6 @@ clean:
$(MAKE) clean -C ${pwd}/lib/pqclean
rm -rf ${pwd}/lib/milagro-crypto-c/build
rm -rf ${pwd}/lib/mimalloc/build
$(MAKE) clean -C ${pwd}/lib/blake2
$(MAKE) clean -C ${pwd}/src
if [ -d "bindings" ]; then $(MAKE) clean -C ${pwd}/bindings; fi
rm -f ${extras}/index.*
Expand Down
3 changes: 0 additions & 3 deletions bindings/python3/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
MILAGRO_INCLUDE_DIR = os.path.join(ZENROOM_ROOT, 'lib/milagro-crypto-c/include')
QP_ROOT = os.path.join(ZENROOM_ROOT, 'lib/pqclean')
ED25519_INCLUDE_DIR = os.path.join(ZENROOM_ROOT, 'lib/ed25519-donna')
BLAKE2_INCLUDE_DIR = os.path.join(ZENROOM_ROOT, 'lib/blake2')
MIMALLOC_INCLUDE_DIR = os.path.join(ZENROOM_ROOT, 'lib/mimalloc/include')

def get_versions():
Expand Down Expand Up @@ -86,7 +85,6 @@ def get_versions():
LUA_ROOT,
MILAGRO_INCLUDE_DIR,
ED25519_INCLUDE_DIR,
BLAKE2_INCLUDE_DIR,
MIMALLOC_INCLUDE_DIR,
os.path.join(meson_root, 'milagro-crypto-c/include'),
os.path.join(meson_root, 'milagro-crypto-c/include'),
Expand All @@ -110,7 +108,6 @@ def get_versions():
os.path.join(meson_root, 'libqpz.a'),
os.path.join(meson_root, 'liblua.a'),
os.path.join(meson_root, 'libed25519.a'),
os.path.join(meson_root, 'libblake2.a'),
os.path.join(meson_root, 'libmimalloc-static.a'),
],
extra_link_args=['-lm']
Expand Down
1 change: 0 additions & 1 deletion bindings/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ fn main() {
println!("cargo:rustc-link-lib=static=amcl_curve_SECP256K1");
println!("cargo:rustc-link-lib=static=amcl_pairing_BLS381");
println!("cargo:rustc-link-lib=static=ed25519");
println!("cargo:rustc-link-lib=static=blake2");
println!("cargo:rustc-link-lib=static=mimalloc-static");
println!("cargo:rustc-link-search=native=clib");

Expand Down
5 changes: 0 additions & 5 deletions build/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ ldadd += ${milib}/libamcl_curve_${ecdh_curve}.a
ldadd += ${milib}/libamcl_core.a
ldadd += ${pwd}/lib/pqclean/libqpz.a
ldadd += ${pwd}/lib/ed25519-donna/libed25519.a
ldadd += ${pwd}/lib/blake2/libblake2.a
ldadd += ${pwd}/lib/mimalloc/build/libmimalloc-static.a

# ----------------
Expand Down Expand Up @@ -314,10 +313,6 @@ quantum_proof_cflags ?= -I ${pwd}/src -I ${pwd}/lib/mimalloc/include -I.
# ed25519 settings
ed25519_cc ?= ${gcc}

#-----------------
# blake2 settings
blake2_cc ?= ${gcc}

#-----------------
# mimalloc settings
mimalloc_cmake_flags += -DMI_BUILD_SHARED=OFF -DMI_BUILD_OBJECT=OFF
Expand Down
7 changes: 1 addition & 6 deletions build/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ add_project_link_arguments(
'liblua.a',
'libqpz.a',
'libed25519.a',
'libblake2.a',
'libmimalloc-static.a',
language: 'c'
)
Expand All @@ -68,8 +67,6 @@ lua_include_dirs = include_directories('../lib/lua54/src')

ed25519_include_dirs = include_directories('../lib/ed25519-donna')

blake2_include_dirs = include_directories('../lib/blake2')

zenroom_src = [
'../src/base58.c',
'../src/rmd160.c',
Expand Down Expand Up @@ -113,7 +110,6 @@ zenroom_lib = library(
milagro_include_dirs,
milagro_generated_include_dirs,
ed25519_include_dirs,
blake2_include_dirs,
lua_include_dirs,
mimalloc_include_dirs,
],
Expand All @@ -130,7 +126,6 @@ zenroom_dep = declare_dependency(
milagro_include_dirs,
milagro_generated_include_dirs,
ed25519_include_dirs,
blake2_include_dirs,
lua_include_dirs,
mimalloc_include_dirs,
],
Expand Down Expand Up @@ -176,7 +171,7 @@ endforeach
## BATS tests in vectors
test_dir = meson.source_root() + '/../test/'
bats_bin = find_program(test_dir+'bats/bin/bats')
tests = [ 'sha', 'aes', 'hmac', 'blake2' ]
tests = [ 'sha', 'aes', 'hmac' ]
foreach test_suite : tests
test('vectors_'+test_suite.underscorify(),
bats_bin,
Expand Down
1 change: 0 additions & 1 deletion build/meson.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ prepare-meson:
ln -sf ${pwd}/lib/pqclean/libqpz.a ${pwd}/meson/libqpz.a
ln -sf ${pwd}/lib/lua54/src/liblua.a ${pwd}/meson/liblua.a
ln -sf ${pwd}/lib/ed25519-donna/libed25519.a ${pwd}/meson/libed25519.a
ln -sf ${pwd}/lib/blake2/libblake2.a ${pwd}/meson/libblake2.a
ln -sf ${pwd}/lib/mimalloc/build/libmimalloc-static.a ${pwd}/meson/libmimalloc-static.a

run-meson:
Expand Down
19 changes: 0 additions & 19 deletions lib/blake2/Makefile

This file was deleted.

160 changes: 0 additions & 160 deletions lib/blake2/blake2-impl.h

This file was deleted.

Loading

0 comments on commit 671a2fd

Please sign in to comment.