Closed 121TheShuDynasty closed 4 months ago
I have installed the GMP library on Ubuntu 18.04 and then installed the relic library following the steps below.
cd relic-main
mkdir relic-target
cd relic-target
cmake ..
make
make install
I encountered the following issue while using relic.
my program calling the relic library is as follows.
Can you help me solve this problem?
Hi,
Support to the SM2-P256 curve is not complete and may be buggy. I suggest picking another curve for your implementation and experiments.
However, I encountered the same issue when I chose other curves. Could you please tell me if I missed any steps during the installation process? When using ep_param_set_any(), the displayed curve is NIST-P256, but no other curves can be used.
I believe the latest commit on HEAD
solves the issue for curve SM2_P256
. Can you please try to update, build the library+binaries and reopen the issue if it still persists?
I want to use the curves in 'relic_ep.h', I modified my program, but it still has errors.
How do I use these curves? Do I need to add../presets/.sh ../
during the installation process?"
You cannot pass NIST-P192 because the library by default is built for 256-bit fields. You need to reconfigure+recompile for that.
Yes, the presets configure the library correctly for many parameter sets.
I will continue looking into the other error.
I understand that I cannot use NIST-P192, but I still don't know how to use SM2-P256. I'm new to this area, so please forgive my ignorance. And by default, can 256-bit fields only use NIST-P256?
I just tried the code below with the latest version and I saw no errors:
#include "relic.h"
int main() {
ep_t p;
core_init();
ep_param_set(NIST_P256);
ep_param_print();
ep_rand(p);
ep_print(p);
ep_param_set(SM2_P256);
ep_param_print();
ep_rand(p);
ep_print(p);
core_clean();
return 0;
}
I downloaded the project again for configuration, ran your program, and encountered this error. Is it possibly due to the system?
I'm sorry, I had pushed the fix to another branch. Not it's back on main
.
Can you please try again?
Thank you very much, the SM2_P256 curve is usable. I also want to ask another question, when I call the BSI_P256 curve in the same way, an error occurs. The other P256 curves do not have an error and can be called normally.
#include "relic.h"
int main() {
ep_t p;
core_init();
ep_param_set(BSI_P256);
ep_param_print();
ep_rand(p);
ep_print(p);
core_clean();
return 0;
}
BSI_P256 should be fixed now as well.
I installed the library by running 'cmake ..; make;', but when using 'ep_param_set(SM2_P256)', I encountered an ERROR in ep_curve_set_map() at /home/yang/relic/relic-main/src/ep/relic_ep_curve.c, line 180: invalid value passed as input. CAUGHT in ep_curve_set_map() at /home/yang/relic/relic-main/src/ep/relic_ep_curve.c, line 185. CAUGHT in ep_param_set() at /home/yang/relic/relic-main/src/ep/relic_ep_param.c, line 1372.