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

PSI协议测试报错:Exception in thread "Thread-0" java.lang.IllegalArgumentException: ecc_mul failed, invalid point. #16

Closed
aaaaaa1 opened this issue Aug 22, 2023 · 13 comments

Comments

@aaaaaa1
Copy link

aaaaaa1 commented Aug 22, 2023

1F49A65813BDF7B9E8131CDC73D7066E
image
您好,运行psi的测试方法报错,这个要怎么处理才行呢?
目前有关于psi\pir的相关资料么或者交流群呢?

@liuweiran900217
Copy link
Collaborator

Can you paste the full error information (including the line "Java HotSpot(TM) 64-Bit Server warning: You have loaded library ..."? It seems the error comes from wrongly invoking or linking C/C++ library. Can you tell us how you generate the native library and how you run it?

@liuweiran900217
Copy link
Collaborator

Previously I did not ever meet this problem. I do some searches, and find that the problem occurs because you use a .so library compiled on another system.

In general case, you cannot compile .so libararies on one system, but running test cases on the other system by simply copying the obtained .so libraries onto that system. Instead, you may need to compile and obtain .so libraries on the exact system that you run test cases.

@aaaaaa1
Copy link
Author

aaaaaa1 commented Aug 22, 2023

警告信息:
1、Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /home/mpc4j-1.0.8/mpc4j-native-tool/cmake-build-release/libmpc4j-native-tool.so which might have disabled stack guard. The VM will try to fix the stack guard now.
2、It's highly recommended that you fix the library with 'execstack -c ', or link it with '-z noexecstack'.

libmpc4j-native-tool.so这个库是我在Ubuntu23.04上编译,idea也是在Ubuntu23.04上运行

@aaaaaa1
Copy link
Author

aaaaaa1 commented Aug 22, 2023

后面我在试试重新编译mpc4j-native-tool、mpc4j-native-fhe、mpc4j-native-fourq

@liuweiran900217
Copy link
Collaborator

This is very strange. You can try first recompiling and installing mpc4j-native-fourq, and then mpc4j-native-tool, and finally mpc4j-native-fhe. As far as I understand, the problem relates to mpc4j-native-fourq. If you cannot success, you can email me about your contact information so that we can try to debug in person.

@qxzhou1010
Copy link

Please try using other elliptic curve types instead of FourQ to see if it passes the test. If not, please give feedback in time, and I will continue to analyze this problem.

@aaaaaa1
Copy link
Author

aaaaaa1 commented Aug 23, 2023

这应该是我编译mpc4j-native-fourq的时候有问题,现在碰到执行make test时ecc_tests 、fp_tests测试 执行失败,看不到其他日志,所以来询问下是什么原因呢?
image

le@le:/home/mpc/mpc4j-1.0.8/mpc4j-native-fourq/build$ ./ecc_tests --rerun-failed --output-on-failure

Testing FourQ's curve arithmetic:
Point doubling tests ... FAILED

@liuweiran900217
Copy link
Collaborator

这个问题看起来应该是微软FourQ本身的实现问题。我们只是修改了FourQ的makefile,但是并没有调整FourQ的源代码。

mpc4j可以在不使用FourQ的条件下运行协议,但需要对代码做一些修改。具体为:

  1. 找到mpc4j-common-tool模块edu.alibaba.mpc4j.common.tool.crypto.ecc包下的ByteEccFactory。
  2. 找到public static ByteFullEcc createFullInstance(EnvType envType)函数。
  3. return createFullInstance(ByteEccType.FOUR_Q);修改为return createFullInstance(ByteEccType.ED25519_SODIUM);

这样就可以不执行FourQ椭圆曲线。

至于FourQ为什么出错,不知是否可以提供Ubuntu系统的CPU型号?我们可以去询问FourQ的github。

@liuweiran900217
Copy link
Collaborator

liuweiran900217 commented Aug 23, 2023

我在FourQlib上找到了可能一样的问题,microsoft/FourQlib#9

FourQlib本身可能并不支持某些特定的CPU。考虑这一原因,我们计划在1.0.9版本里将默认的曲线修改会ED25519,并在readme里面说明。感谢反馈的问题。

@aaaaaa1
Copy link
Author

aaaaaa1 commented Aug 23, 2023

按您说的修改了,还是会报一样错误:
image
Ubuntu系统的CPU型号:
image
image

@liuweiran900217
Copy link
Collaborator

报的错误完全一样,还是invalid point吗?如果是,可能的原因是修改没有生效。尝试点击IntelliJ IDEA菜单栏的build -> Build Project,然后重新点击测试用例的左侧箭头。如果还是不行,请通过回帖或者邮件方式提供我任何一个在线会议软件的会议号,我远程了解一下问题。

@aaaaaa1
Copy link
Author

aaaaaa1 commented Aug 23, 2023

按您说的修改可以了,谢谢!
咨询下关于隐私求交、匿名查询等例子的讲解文档吗?对BatchPirTest等测试例子一知半解,不是很懂
image

@liuweiran900217
Copy link
Collaborator

PSI和PIR目前的发展速度太快,路线很多,我建议不如阅读完论文后再阅读我们的实现。目前我们也在准备一些文档,不过需要花费较长的一段时间。

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