-
Notifications
You must be signed in to change notification settings - Fork 12
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
Use common rlwe encryption script for pk-enc and sk-enc #32
Use common rlwe encryption script for pk-enc and sk-enc #32
Conversation
Thanks for the contribution. I'm happy to see that the balance of increased lines of codes has been reduced from the previous PR. But I think this can be further improved. Just by looking at the python files
Please update it first and ping me when done before moving to the rust Plus for the mathematical proof for the range check of |
My apologies, I have some doubt related to considering Modifying the existed Thanks for reviewing my code |
I understand your concern. I'm not sure what the best way is to solve the problem. The goal is remove any duplicate code. |
I felt using the same rlwe encryption function to generate the second matrix of pk_enc |
I think that there is still a lot of duplicated code in the python part. Getting that right would help shape the Rust part. I suggest to further polish that part before moving to Rust. |
Thanks @enricobottazzi for bearing with me , I created a common function |
Hi @Vishalkulkarni45. I am looking into the PR again. I think you did a good job of removing duplicates. I realized that at the very core, the operation of public key encryption is basically just a secret key encryption performed twice. I agree that approaching the problem in this way will add some inefficiency as some elements in the calculation of In that case, a nice to have would be a proof aggregator that, in the case of public key encryption, merges the two proofs into a single one. |
Thank you @enricobottazzi , It seems I have completed the Python script portion, correct? To minimize code duplication for the circuit part, I need to create a proof aggregator. This aggregator will combine the proofs for There's a common function to be built to generate the |
Thinking again about this issue, I don't think that this is relevant anymore. Greco as it is right now already have all the necessary components to extend it to public key encryption. I don't think that loading the code base with extra code (which is mostly duplicate of what's already in place for secret key encryption is) is the right approach. |
scripts/utils.py
which can be used by bothcircuit_sk.py
andcircuit_pk.py
p2i
andp1i
incircuit_pk.py
test_sk_enc_valid
ofsk_encryption_circuit
test_pk_enc_valid
to run circuit using MockProver , fixedtest_pk_enc_invalid_range
andtest_pk_enc_invalid_polys
ok pk_encryption_circuit