make fails with ld error: "cannot find -lkeccak"
Three Bears post-quantum encryption algorithms
Brought to you by:
bitwiseshiftlef
I am trying to build the C ref implementation and am unsure where to obtain/build the proper libkeccak.
Where may I obtain a compatible libkeccak? I am on Funtoo Linux x64 and unsure what, if any, package might provide a compatible implementation, so would prefer to build from source. Thank you.
$ cd src/ref
$ make clean all
...
cc -I. -Ibuild -Os -march=native -Wall -Wextra -Wpedantic -DNDEBUG -fomit-frame-pointer -std=c11 -c -o build/shake.o shake.c
cc -o build/threebears build/BabyBearEphem/threebears.o build/BabyBear/threebears.o build/MamaBearEphem/threebears.o build/MamaBear/threebears.o build/PapaBearEphem/threebears.o build/PapaBear/threebears.o build/BabyBearEphem/ring.o build/BabyBear/ring.o build/MamaBearEphem/ring.o build/MamaBear/ring.o build/PapaBearEphem/ring.o build/PapaBear/ring.o build/test_threebears.o build/melas_fec.o build/shake.o -lkeccak
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lkeccak
collect2: error: ld returned 1 exit status
make: *** [Makefile:17: build/threebears] Error 1
Hmm. Seems this -lkeccak isn't actually required. I can build with the following patch:
diff --git a/src/ref/Makefile b/src/ref/Makefile
index 9bc3238..90d43e9 100644
--- a/src/ref/Makefile
+++ b/src/ref/Makefile
@@ -14,7 +14,7 @@ BEARS_H = $(addprefix build/,$(addsuffix /threebears.h,$(BEARS)))
all: build/threebears build/test_fec
build/threebears: $(BEARS_O) $(BEARS_R) build/test_threebears.o build/melas_fec.o build/shake.o
- $(CC) $(LDFLAGS) -o $@ $^ -lkeccak
+ $(CC) $(LDFLAGS) -o $@ $^ #-lkeccak
size: $(BEARS_O) $(BEARS_R) build/melas_fec.o build/shake.o
size $^
@@ -75,4 +75,4 @@ test: build/test_fec
build/test_fec
clean:
- rm -fr build/
\ No newline at end of file
+ rm -fr build/
Thanks for the report, should be fixed in 0cbf5e.