Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code doesn't compile #4

Open
withinboredom opened this issue May 24, 2022 · 2 comments
Open

Code doesn't compile #4

withinboredom opened this issue May 24, 2022 · 2 comments

Comments

@withinboredom
Copy link

It isn't clear what version of what dependencies are required to build this. It doesn't compile on my machine, first, I had to disable warnings in libaesrand:

withinboredom@Legion:~/code/witness-encryption-demos$ ./build.sh

builddir = /home/withinboredom/code/witness-encryption-demos/build

building libaesrand
~/code/witness-encryption-demos/libaesrand ~/code/witness-encryption-demos
From https://github.com/5GenCrypto/libaesrand
 * branch            master     -> FETCH_HEAD
Already up to date.
~/code/witness-encryption-demos
~/code/witness-encryption-demos/libaesrand ~/code/witness-encryption-demos
-- Build type: Release
-- Configuring done
-- Generating done
-- Build files have been written to: /home/withinboredom/code/witness-encryption-demos/libaesrand
[ 12%] Building C object CMakeFiles/aesrand.dir/aesrand/aesrand_buf.c.o
[ 25%] Building C object CMakeFiles/aesrand.dir/aesrand/aesrand_gmp.c.o
[ 37%] Building C object CMakeFiles/aesrand.dir/aesrand/aesrand_init.c.o
/home/withinboredom/code/witness-encryption-demos/libaesrand/aesrand/aesrand_init.c: In function ‘aes_randinit_seedn’:
/home/withinboredom/code/witness-encryption-demos/libaesrand/aesrand/aesrand_init.c:43:5: error: ‘SHA256_Init’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
   43 |     SHA256_Init(&sha256);
      |     ^~~~~~~~~~~
In file included from /home/withinboredom/code/witness-encryption-demos/libaesrand/aesrand/aesrand_init.c:7:
/usr/include/openssl/sha.h:73:27: note: declared here
   73 | OSSL_DEPRECATEDIN_3_0 int SHA256_Init(SHA256_CTX *c);
      |                           ^~~~~~~~~~~
/home/withinboredom/code/witness-encryption-demos/libaesrand/aesrand/aesrand_init.c:44:5: error: ‘SHA256_Update’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
   44 |     SHA256_Update(&sha256, seed, seed_len);
      |     ^~~~~~~~~~~~~
In file included from /home/withinboredom/code/witness-encryption-demos/libaesrand/aesrand/aesrand_init.c:7:
/usr/include/openssl/sha.h:74:27: note: declared here
   74 | OSSL_DEPRECATEDIN_3_0 int SHA256_Update(SHA256_CTX *c,
      |                           ^~~~~~~~~~~~~
/home/withinboredom/code/witness-encryption-demos/libaesrand/aesrand/aesrand_init.c:46:9: error: ‘SHA256_Update’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
   46 |         SHA256_Update(&sha256, additional, additional_len);
      |         ^~~~~~~~~~~~~
In file included from /home/withinboredom/code/witness-encryption-demos/libaesrand/aesrand/aesrand_init.c:7:
/usr/include/openssl/sha.h:74:27: note: declared here
   74 | OSSL_DEPRECATEDIN_3_0 int SHA256_Update(SHA256_CTX *c,
      |                           ^~~~~~~~~~~~~
/home/withinboredom/code/witness-encryption-demos/libaesrand/aesrand/aesrand_init.c:47:5: error: ‘SHA256_Final’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
   47 |     SHA256_Final(key, &sha256);
      |     ^~~~~~~~~~~~
In file included from /home/withinboredom/code/witness-encryption-demos/libaesrand/aesrand/aesrand_init.c:7:
/usr/include/openssl/sha.h:76:27: note: declared here
   76 | OSSL_DEPRECATEDIN_3_0 int SHA256_Final(unsigned char *md, SHA256_CTX *c);
      |                           ^~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/aesrand.dir/build.make:104: CMakeFiles/aesrand.dir/aesrand/aesrand_init.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/aesrand.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

Then I got this:

withinboredom@Legion:~/code/witness-encryption-demos$ ./build.sh

builddir = /home/withinboredom/code/witness-encryption-demos/build

building libaesrand
~/code/witness-encryption-demos/libaesrand ~/code/witness-encryption-demos
From https://github.com/5GenCrypto/libaesrand
 * branch            master     -> FETCH_HEAD
Already up to date.
~/code/witness-encryption-demos
~/code/witness-encryption-demos/libaesrand ~/code/witness-encryption-demos
-- Build type: Release
-- Configuring done
-- Generating done
-- Build files have been written to: /home/withinboredom/code/witness-encryption-demos/libaesrand
Consolidate compiler generated dependencies of target aesrand
[ 12%] Building C object CMakeFiles/aesrand.dir/aesrand/aesrand_buf.c.o
[ 25%] Building C object CMakeFiles/aesrand.dir/aesrand/aesrand_gmp.c.o
[ 37%] Building C object CMakeFiles/aesrand.dir/aesrand/aesrand_init.c.o
[ 50%] Building C object CMakeFiles/aesrand.dir/aesrand/aesrand_flint.c.o
/home/withinboredom/code/witness-encryption-demos/libaesrand/aesrand/aesrand_flint.c: In function ‘fmpz_mod_poly_randtest_aes’:
/home/withinboredom/code/witness-encryption-demos/libaesrand/aesrand/aesrand_flint.c:6:5: error: too few arguments to function ‘fmpz_mod_poly_fit_length’
    6 |     fmpz_mod_poly_fit_length(f, len);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/withinboredom/code/witness-encryption-demos/libaesrand/aesrand/aesrand.h:51,
                 from /home/withinboredom/code/witness-encryption-demos/libaesrand/aesrand/aesrand_flint.c:1:
/usr/include/flint/fmpz_mod_poly.h:127:6: note: declared here
  127 | void fmpz_mod_poly_fit_length(fmpz_mod_poly_t poly, slong len,
      |      ^~~~~~~~~~~~~~~~~~~~~~~~
/home/withinboredom/code/witness-encryption-demos/libaesrand/aesrand/aesrand_flint.c:9:53: error: ‘fmpz_mod_poly_struct’ has no member named ‘p’
    9 |         if (fmpz_randm_aes(f->coeffs + i, state, &(f->p)) == AESRAND_ERR)
      |                                                     ^~
make[2]: *** [CMakeFiles/aesrand.dir/build.make:118: CMakeFiles/aesrand.dir/aesrand/aesrand_flint.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/aesrand.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

Perhaps it is worth including a Dockerfile to have something that is reproducible? As it is now, it is susceptible to bitrot and, in fact, has already rotted away to useless text files.

@saholmes
Copy link

I am having similar issues with compiling. However, it appears to be dependency on FLINT library.

using
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

./build.sh
builddir = /home/ubuntu/witness-encryption-demos/build

building libaesrand
~/witness-encryption-demos/libaesrand ~/witness-encryption-demos
From https://github.com/5GenCrypto/libaesrand

  • branch master -> FETCH_HEAD
    Already up to date.
    ~/witness-encryption-demos
    ~/witness-encryption-demos/libaesrand ~/witness-encryption-demos
    -- Build type: Release
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/ubuntu/witness-encryption-demos/libaesrand
    [ 75%] Built target aesrand
    [100%] Built target test_aesrand
    [ 75%] Built target aesrand
    [100%] Built target test_aesrand
    Install the project...
    -- Install configuration: "Release"
    -- Up-to-date: /home/ubuntu/witness-encryption-demos/build/lib/libaesrand.so
    -- Up-to-date: /home/ubuntu/witness-encryption-demos/build/include/aesrand.h
    ~/witness-encryption-demos

-- Build type: Debug -w
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/witness-encryption-demos
[ 42%] Built target clt13
[ 50%] Building C object CMakeFiles/test_clt_witness_scheme.dir/test/test_clt_witness_scheme.c.o
In file included from /home/ubuntu/witness-encryption-demos/flint/nmod_vec.h:29,
from /home/ubuntu/witness-encryption-demos/flint/fmpz.h:31,
from /home/ubuntu/witness-encryption-demos/flint/fmpz_poly.h:3,
from /home/ubuntu/witness-encryption-demos/build/include/aesrand.h:50,
from /home/ubuntu/witness-encryption-demos/src/clt13.h:11,
from /home/ubuntu/witness-encryption-demos/test/test_clt_witness_scheme.c:1:
/home/ubuntu/witness-encryption-demos/flint/ulong_extras.h: In function ‘n_mulmod_shoup’:
/home/ubuntu/witness-encryption-demos/flint/ulong_extras.h:537:26: error: variable ‘p_lo’ set but not used [-Werror=unused-but-set-variable]
537 | mp_limb_t q, r, p_hi, p_lo;
| ^~~~
In file included from /home/ubuntu/witness-encryption-demos/build/include/aesrand.h:51,
from /home/ubuntu/witness-encryption-demos/src/clt13.h:11,
from /home/ubuntu/witness-encryption-demos/test/test_clt_witness_scheme.c:1:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_init’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:108:68: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
108 | void fmpz_mod_poly_init(fmpz_mod_poly_t poly, const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_fit_length’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:128:76: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
128 | const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~

/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_truncate’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:160:83: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
160 | uncate(fmpz_mod_poly_t poly, slong len, const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~

/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_degree’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:218:77: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
218 | poly_degree(const fmpz_mod_poly_t poly, const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~

/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_length’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:224:77: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
224 | poly_length(const fmpz_mod_poly_t poly, const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~

/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_lead’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:230:76: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
230 | d_poly_lead(const fmpz_mod_poly_t poly, const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~

/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_is_monic’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:239:74: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
239 | int fmpz_mod_poly_is_monic(const fmpz_mod_poly_t f, const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_is_one’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:245:75: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
245 | int fmpz_mod_poly_is_one(const fmpz_mod_poly_t poly, const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_is_gen’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:251:73: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
251 | int fmpz_mod_poly_is_gen(const fmpz_mod_poly_t op, const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_swap’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:266:76: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
266 | fmpz_mod_poly_t poly2, const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~

/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_zero’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:280:68: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
280 | void fmpz_mod_poly_zero(fmpz_mod_poly_t poly, const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_equal’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:336:75: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
336 | const fmpz_mod_poly_t poly2, const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_equal_trunc’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:344:76: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
344 | const fmpz_mod_poly_t poly2, slong n, const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~

/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_is_zero’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:351:76: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
351 | oly_is_zero(const fmpz_mod_poly_t poly, const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~

/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_get_coeff_fmpz’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:369:76: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
369 | slong n, const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~

/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h: In function ‘fmpz_mod_poly_fprint_pretty’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:1294:76: error: unused parameter ‘ctx’ [-Werror=unused-parameter]
1294 | const char * x, const fmpz_mod_ctx_t ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~

In file included from /home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly.h:1422,
from /home/ubuntu/witness-encryption-demos/build/include/aesrand.h:51,
from /home/ubuntu/witness-encryption-demos/src/clt13.h:11,
from /home/ubuntu/witness-encryption-demos/test/test_clt_witness_scheme.c:1:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly_factor.h: In function ‘fmpz_mod_poly_factor_swap’:
/home/ubuntu/witness-encryption-demos/flint/fmpz_mod_poly_factor.h:79:76: error: unused parameter ‘_ctx’ [-Werror=unused-parameter]
79 | fmpz_mod_poly_factor_t b, const fmpz_mod_ctx_t _ctx)
| ~~~~~~~~~~~~~~~~~~~~~^~~~

cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/test_clt_witness_scheme.dir/build.make:63: CMakeFiles/test_clt_witness_scheme.dir/test/test_clt_witness_scheme.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/test_clt_witness_scheme.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

@wxb1104
Copy link

wxb1104 commented Sep 7, 2022

The version using flint is incorrect, flint-2.6.3 should be used
Official website link:
http://flintlib.org/downloads.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants