relic-toolkit / relic

Code
Other
452 stars 179 forks source link

Compile Failue with x64-ecc-128 preset #279

Closed MSF-Akatsuki closed 7 months ago

MSF-Akatsuki commented 9 months ago

When building with preset x64-ecc-128, I encounter a compile error as below.

[ 25%] Building C object src/CMakeFiles/relic.dir/bn/relic_bn_smb.c.o
/home/makari/tmp/relic/src/fp/relic_fp_inv.c: In function ‘fp_inv_jmpds’:
/home/makari/tmp/relic/src/fp/relic_fp_inv.c:627:40: error: ‘ctx_t’ {aka ‘struct _ctx_t’} has no member named ‘conv’
  627 |                 fp_copy(pre, core_get()->conv.dp);
      |                                        ^~
In file included from /home/makari/tmp/relic/include/relic_fpx.h:39,
                 from /home/makari/tmp/relic/include/relic_epx.h:44,
                 from /home/makari/tmp/relic/include/relic_core.h:51,
                 from /home/makari/tmp/relic/src/fp/relic_fp_inv.c:32:
/home/makari/tmp/relic/src/fp/relic_fp_inv.c:628:44: error: ‘ctx_t’ {aka ‘struct _ctx_t’} has no member named ‘conv’
  628 |                 fp_mul(pre, pre, core_get()->conv.dp);
      |                                            ^~
/home/makari/tmp/relic/include/relic_fp.h:326:52: note: in definition of macro ‘fp_mul’
  326 | #define fp_mul(C, A, B)         fp_mul_integ(C, A, B)
      |                                                    ^
/home/makari/tmp/relic/src/fp/relic_fp_inv.c:629:44: error: ‘ctx_t’ {aka ‘struct _ctx_t’} has no member named ‘inv’
  629 |                 fp_mul(pre, pre, core_get()->inv.dp);
      |                                            ^~
/home/makari/tmp/relic/include/relic_fp.h:326:52: note: in definition of macro ‘fp_mul’
  326 | #define fp_mul(C, A, B)         fp_mul_integ(C, A, B)
      |                                                    ^
/home/makari/tmp/relic/src/fp/relic_fp_inv.c:752:57: error: ‘ctx_t’ {aka ‘struct _ctx_t’} has no member named ‘conv’
  752 |                         fp_mulm_low(pre, pre, core_get()->conv.dp);
      |                                                         ^~
make[2]: *** [src/CMakeFiles/relic_s.dir/build.make:566: src/CMakeFiles/relic_s.dir/fp/relic_fp_inv.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....

It seems that changing

-DFP_METHD="INTEG;INTEG;INTEG;QUICK;JMPDS;JMPDS;SLIDE"

back to

-DFP_METHD="INTEG;INTEG;INTEG;QUICK;LOWER;LOWER;SLIDE"

in the file x64-ecc-128.sh, which is reverting its latest change, can solve the problem and pass all tests after compilation, but not sure if reverting this is expected.

I further tested on a few x64-pbc-bls presets but such error doesn't seem to appear on those.

dfaranha commented 9 months ago

Hi,

Thanks for notifying, reverting will at worst impact performance. The latest main should build again, but inversion is broken and I'm currently looking at it.

dfaranha commented 7 months ago

I pushed a number of fixes to HEAD that should close the issue. Can you please try again?

dfaranha commented 7 months ago

Looks like this was fixed, as reported in #285. Sorry for the breakage, and thanks again for notifying it!