Skip to content

Commit 9e47b62

Browse files
committed
Fix palia bitsize error
1 parent 4458adb commit 9e47b62

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

mife/multiclient/decentralized/palia.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ def encrypt_query(y: List[List[int]], pk: PaillierKey, pub: _FeDDHMultiClientDec
3434

3535
@staticmethod
3636
def generate_query_key(pub: _FeDDHMultiClientDec_PK) -> PaillierKey:
37-
return Paillier.generate(pub.F.order().bit_length() + (pub.n * pub.m).bit_length() + 1)
37+
bitsize = ((pub.F.order().bit_length() + (pub.n * pub.m).bit_length() + 127) // 128) * 128
38+
bitsize = max(512, bitsize)
39+
return Paillier.generate(bitsize)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ extragroup = [
1313

1414
[project]
1515
name = "pymife"
16-
version = "0.0.12"
16+
version = "0.0.13"
1717
authors = [
1818
{ name="mechfrog88", email="kelzzin2@gmail.com" },
1919
]

0 commit comments

Comments
 (0)