Closed yongboy closed 3 months ago
The reason is that the enum value numbers of phe.SchemaType.xxxx are misaligned, causing the algorithm to not be invoked correctly at the lower level.
I think your environment might involve one machine being x86 and the other being ARM, and the number of schemas supported by x86 and ARM are different, leading to the sequence numbers of this SchemaType enum being different. If both sides are either ARM or x86, there should be no issue.
We will fix this problem shortly.
Please recompile and reinstall the code from the main branch on both sides.
Thank you very much, it’s working perfectly!
I compiled the latest main branch code of this project on servers with different CPU architectures into the following files and updated them on several service instances one by one.
The installation command is as follows:
pip install sf_heu-0.6.0.dev0-cp310-cp310-manylinux_2_28_aarch64.whl --force-reinstall
Then:
PS:
Code for generating the public and private keys:
from heu import phe
ckit = phe.setup(phe.SchemaType.ZPaillier, 2048)
with open('./public.key', 'wb') as f:
f.write(ckit.public_key().serialize())
with open('./secret.key', 'wb') as f:
f.write(ckit.secret_key().serialize())
print("Done!")
Aha! Great! I'm glad to hear this news.
Issue Type
Usability
HEU Version
sf-heu 0.5.1b0
OS Platform and Distribution
Arm Ubuntu 20.04
Python Version
3.9
Compiler Version
No response
Current Behavior?
I generated the public/private key pair on an x86 Ubuntu 20.04 server and used the public key on an aarch64 (Arm Cortex-A55) Ubuntu 20.04 server.
The code below works well on the x86 Ubuntu server but fails on the ARM server.
The traceback:
The code: