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

mpc4j-s2pc-pir 输入数据elementBitLength问题 #42

Open
Eileen2014 opened this issue Jul 9, 2024 · 3 comments
Open

mpc4j-s2pc-pir 输入数据elementBitLength问题 #42

Eileen2014 opened this issue Jul 9, 2024 · 3 comments

Comments

@Eileen2014
Copy link

在实验数据中,生成的每行数据长度是固定的,因此在开始server端初始化的时候是知道elementBitLength长度的,如果每行实验数据的长度是未知的,elementBitLength在输入的时候不能确定初始化的时候要怎么办?初始化第三步进行多项式计算的时候涉及
int labelPartitionCount = CommonUtils.getUnitNum((labelByteLength + ivByteLength) * Byte.SIZE,
(PirUtils.getBitLength(params.getPlainModulus()) - 1) * itemEncodedSlotSize);
还有就是服务端和客户端的数据 Key和Label的大小是不是都要小于128bit

@liuweiran900217
Copy link
Collaborator

PIR默认要求输入的数据必须是等长的,否则会出现有的(密文)查询结果长,有的查询结果短的情况,导致信息泄漏。因此我们的实现默认要求用户自己padding好数据。

我们测试用例覆盖了key和value很大的情况,测试结果没发现什么问题,如果你发现某个长度的key或value下有bug,欢迎提issue。

@Eileen2014
Copy link
Author

我看到你们测试案例中long label byte长度是40byte,这个是最大的 label byte长度吗

@liuweiran900217
Copy link
Collaborator

我们实现应该可以支持更长的label,但实际中如果label太长,同态运算次数就会变多,导致测试用例跑起来过于痛苦。如果感兴趣,你可以测试一下,如果发现有bug,欢迎report。

我们现在对PIR的理解更近了一步,我们将会在新版本中调整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

2 participants