1. Downloading and building GF2X
download gf2x-master.tar.gz: https://gitlab.inria.fr/gf2x/gf2x#the-gf2x-software-library
installation instruction:https://libntl.org/doc/tour-gf2x.html
% gunzip gf2x-master.tar.gz
% tar xf gf2x-master.tar
% cd gf2x-master
% ./configure --prefix=$HOME/sw
% make
% make check
% make install
Problem 1:
bash: ./configure: No such file or directory
Solution:
% sudo apt install autoconf
% sudo apt install make
% sudo apt install make-guile
% autoreconf --install
Problem 2:
% ./configure
config.status: error: cannot find input file: `Makefile.in'
Solution:
https://blog.csdn.net/LEE_FIGHTING_JINGYU/article/details/105754580
% aclocal
% libtoolize --force
% automake --add-missing
% autoconf
2. Downloading and building GMP
download gmp-6.2.0.tar.lz:https://gmplib.org/list-archives/gmp-announce/2020-January/000048.html
installation instruction:https://libntl.org/doc/tour-gmp.html
% lzip -d gmp-6.2.0.tar.lz
% sudo apt-get install lzip
% lzip -d gmp-6.2.0.tar.lz
% tar xf gmp-6.2.0.tar
% cd gmp-6.2.0
% ./configure --prefix=$HOME/sw
% make
% make check
% make install
3. Downloading and building NTL
download ntl-11.4.3.tar.gz: https://libntl.org/download.html
installation instruction: https://libntl.org/doc/tour-unix.html
% gunzip ntl-11.4.3.tar.gz
% tar xf ntl-11.4.3.tar
% cd ntl-11.4.3/src
% ./configure DEF_PREFIX=$HOME/sw
% make
% make check
% sudo make install
Problem 1:
*** CompilerOutput.log ****** building GenConfigInfosh: 1: make: not found
Solution:
https://askubuntu.com/questions/1158572/compilation-failure-in-installing-ntl-library
sudo apt-get install build-essential
Problem 2:
make[1]: Entering directory '/home/lijingyu/Downloads/wbaes-attack/ntl-11.3.2/src'
g++ -I../include -I. -g -O2 -pthread -march=native -I/home/lijingyu/sw/include -o gen_gmp_aux gen_gmp_aux.cpp -L/home/lijingyu/sw/lib -lgmp -lm
./gen_gmp_aux > ../include/NTL/gmp_aux.h
NTL_GMP_LIP flag set
GMP version check (6.1.0/6.2.0)
*** version number mismatch: inconsistency between gmp.h and libgmp
Aborted (core dumped)
make[1]: *** [makefile:354: setup3] Error 134
make[1]: Leaving directory '/home/lijingyu/Downloads/wbaes-attack/ntl-11.3.2/src'
make: *** [makefile:320: setup-phase] Error 2
make[1]: Leaving directory '/home/lijingyu/Downloads/wbaes-attack/ntl-11.4.3/src'
make setup3
make[1]: Entering directory '/home/lijingyu/Downloads/wbaes-attack/ntl-11.4.3/src'
g++ -I../include -I. -g -O2 -pthread -march=native -I/home/lijingyu/sw/include -o gen_gmp_aux gen_gmp_aux.cpp -L/home/lijingyu/sw/lib -lgmp -lm
./gen_gmp_aux > ../include/NTL/gmp_aux.h
NTL_GMP_LIP flag set
GMP version check (6.1.0/6.2.0)
*** version number mismatch: inconsistency between gmp.h and libgmp
Aborted (core dumped)
make[1]: *** [makefile:360: setup3] Error 134
make[1]: Leaving directory '/home/lijingyu/Downloads/wbaes-attack/ntl-11.4.3/src'
make: *** [makefile:326: setup-phase] Error 2
The Key:
GMP version check (6.1.0/6.2.0)
*** version number mismatch: inconsistency between gmp.h and libgmp
Aborted (core dumped)
make[1]: *** [makefile:354: setup3] Error 134
Solution:
Select the GMP latter version (6.2.0) to install
entered gmp-6.2.1 directory, using command:
sudo make uninstall
then downloaded gmp-6.2.0 and the problem was solved
So gmp-6.2.0 match ntl-11.4.3