ph4r05 / Whitebox-crypto-AES

Whitebox AES implementation in C++. Chow, Karroumi.
https://is.muni.cz/th/325219/fi_m/
337 stars 112 forks source link

Problem at building phase #12

Closed vakexuta closed 5 years ago

vakexuta commented 8 years ago

When trying to build this project (version 0.4, also with latest sources), remained stuck at some point.

I attach the generated output:

./build-debug.sh HOME: /home/user NTL_INCLUDE_PATH: /usr/local/include NTL_LIB: /usr/local/lib/libntl.a -- Boost version: 1.55.0 -- Found the following Boost libraries: -- program_options -- serialization -- iostreams -- random -- Configuring done -- Generating done -- Build files have been written to: /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/build-debug Linking CXX executable main /usr/local/lib/libntl.a(lip.o): In function redc': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:3509: undefined reference togmpn_addmul_1' /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:3521: undefined reference to `gmpn_sub_n' /usr/local/lib/libntl.a(lip.o): In function_ntl_rem_struct_basic::eval(long_, void_, _ntl_tmp_vec_)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:5729: undefined reference togmpn_mod_1' /usr/local/lib/libntl.a(lip.o): In function`_ntl_reduce_struct_montgomery::eval(void, void)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:3594: undefined reference to `gmpn_addmul_1' /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:3606: undefined reference to__gmpn_sub_n' /usr/local/lib/libntl.a(lip.o): In function_ntl_crt_struct_basic::eval(void, long const_, _ntl_tmpvec)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:4703: undefined reference to __gmpn_addmul_1' /usr/local/lib/libntl.a(lip.o): In functiongmod_simple': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:2067: undefined reference to `gmpn_tdiv_qr' /usr/local/lib/libntl.a(lip.o): In function_ntl_rem_struct_fast::eval(long_, void_, _ntl_tmp_vec_)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:5769: undefined reference togmpn_mod_1' /usr/local/lib/libntl.a(lip.o): In function_ntl_rem_struct_medium::eval(long_, void_, _ntl_tmp_vec_)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:5813: undefined reference togmpn_mod_1' /usr/local/lib/libntl.a(lip.o): In function_ntl_grshift(void_, long, void**)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:1420: undefined reference togmpn_rshift' /usr/local/lib/libntl.a(lip.o): In function_ntl_glshift(void*, long, void**)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:1355: undefined reference to__gmpn_lshift' /usr/local/lib/libntl.a(lip.o): In function`gmpn_sub': /usr/include/x86_64-linux-gnu/gmp.h:2168: undefined reference to __gmpn_sub_n' /usr/local/lib/libntl.a(lip.o): In functiongmpn_add': /usr/include/x86_64-linux-gnu/gmp.h:2129: undefined reference to `gmpn_add_n' /usr/local/lib/libntl.a(lip.o): In function__gmpn_sub': /usr/include/x86_64-linux-gnu/gmp.h:2168: undefined reference togmpn_sub_n' /usr/local/lib/libntl.a(lip.o): In function`gmpn_add': /usr/include/x86_64-linux-gnu/gmp.h:2129: undefined reference to __gmpn_add_n' /usr/local/lib/libntl.a(lip.o): In functiongmpn_sub': /usr/include/x86_64-linux-gnu/gmp.h:2168: undefined reference to `gmpn_sub_n' /usr/include/x86_64-linux-gnu/gmp.h:2168: undefined reference to__gmpn_sub_n' /usr/include/x86_64-linux-gnu/gmp.h:2168: undefined reference togmpn_sub_n' /usr/local/lib/libntl.a(lip.o): In function_ntl_gmul(void_, void_, void**)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:1725: undefined reference togmpn_mul' /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:1727: undefined reference to__gmpn_mul' /usr/local/lib/libntl.a(lip.o): In function_ntl_gsmul(void*, long, void)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:1792: undefined reference to __gmpn_mul_1' /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:1790: undefined reference togmpn_lshift' /usr/local/lib/libntl.a(lip.o): In function _ntl_gsdiv(void*, long, void**)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:1850: undefined reference togmpn_divrem_1' /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:1848: undefined reference to `gmpn_rshift' /usr/local/lib/libntl.a(lip.o): In function_ntl_gsmod(void_, long)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:1915: undefined reference togmpn_mod_1' /usr/local/lib/libntl.a(lip.o): In function`_ntlgdiv(void, void_, void, void)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:1989: undefined reference to `gmpn_tdiv_qr' /usr/local/lib/libntl.a(lip.o): In functiongadd_mul_many': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:4662: undefined reference to__gmpn_addmul_1' /usr/local/lib/libntl.a(lip.o): In function_ntl_gsqrt(void_, void**)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:2105: undefined reference togmpn_sqrtrem' /usr/local/lib/libntl.a(lip.o): In function_ntl_gsqrts(long)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:2131: undefined reference togmpn_sqrtrem' /usr/local/lib/libntl.a(lip.o): In function_ntl_ggcd(void_, void_, void**)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:2187: undefined reference to__gmpn_gcd' /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:2185: undefined reference to`gmpn_gcd' /usr/local/lib/libntl.a(lip.o): In function `_ntl_gexteucl(void*, void, void, void, void)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:2536: undefined reference to__gmpn_gcdext' /usr/local/lib/libntl.a(lip.o): In function_ntl_ginv(void, void*, void)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:2652: undefined reference to__gmpn_gcdext' /usr/local/lib/libntl.a(lip.o): In function_ntl_gaorsmul_1(void, long, long, void)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:5983: undefined reference to__gmpn_addmul_1' /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:5992: undefined reference togmpn_mul_1' /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:6009: undefined reference to`gmpn_submul_1' /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:6044: undefined reference to __gmpn_mul_1' /usr/local/lib/libntl.a(lip.o): In function_ntl_general_rem_one_structapply(void, long, _ntl_general_rem_onestruct)': /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:6209: undefined reference to __gmpn_mod_1' /home/user/tools/git/white-box-crypto/ph4r05/Whitebox-crypto-AES-0.4/ntl-9.9.1/src/g_lip_impl.h:6209: undefined reference to__gmpn_mod_1' collect2: error: ld returned 1 exit status CMakeFiles/main.dir/build.make:365: recipe for target 'main' failed make[2]: \ [main] Error 1 CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/main.dir/all' failed make[1]: * [CMakeFiles/main.dir/all] Error 2 Makefile:76: recipe for target 'all' failed make: *\ [all] Error 2

Any ideas or help of this issue? Thanks in advance.

ksdg-x commented 8 years ago

you should use NTL6.0.0

ph4r05 commented 6 years ago

any progress on this?

ph4r05 commented 6 years ago

pls check if you have all dependencies installed. You can also check the dependencies in travis - the build works fine there. There may be something missing.

In your case it seems like GMP library.

Maybe try: https://unix.stackexchange.com/questions/265239/how-to-install-a-custom-gmp-lib-for-just-one-user

ph4r05 commented 5 years ago

Cannot replicate, no updates on this, I am closing the issue