Added EncryptWithR allowing to specify the randomness #7

Merged
pdyraga merged 2 commits from master into master 2018-07-10 07:18:45 -04:00
pdyraga commented 2018-07-09 05:10:33 -04:00 (Migrated from github.com)

Function EncryptWithR lets to specify randomness r explicitly. For
some ZKPs based on the Paillier scheme, it's required to use the same
r for encryption and construction of ZKP. It wasn't possible previously,
because r was generated internally and never returned.

I did not want to modify Encrypt to return r because it would break
existing code using this API, as well as, I wanted to make sure person
using the specific r and using it somewhere else really knows what
he's doing.

Function `EncryptWithR` lets to specify randomness `r` explicitly. For some ZKPs based on the Paillier scheme, it's required to use the same `r` for encryption and construction of ZKP. It wasn't possible previously, because `r` was generated internally and never returned. I did not want to modify `Encrypt` to return `r` because it would break existing code using this API, as well as, I wanted to make sure person using the specific `r` and using it somewhere else really knows what he's doing.
didiercrunch commented 2018-07-10 07:18:40 -04:00 (Migrated from github.com)

Fantastic. As always, outstanding code.

As a side note, can you point me to the ZNP that you talk about. I would like to know how they use r in them.

many thanks,

didier

Fantastic. As always, outstanding code. As a side note, can you point me to the ZNP that you talk about. I would like to know how they use `r` in them. many thanks, didier
pdyraga commented 2018-07-13 10:39:52 -04:00 (Migrated from github.com)

Sure! For example, Gennaro's ZKP allowing to construct range commitment for key pair (η, y=g^x) with encrypted w = E(η):

image

Sure! For example, Gennaro's ZKP allowing to construct range commitment for key pair (η, y=g^x) with encrypted w = E(η): ![image](https://user-images.githubusercontent.com/4712360/42697364-327888b4-86bb-11e8-9c3a-b80869b5b88f.png)
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: didier/paillier#7