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
2 Commits
Author SHA1 Message Date
Jakub Nowakowski c9c5d2df02 Merge pull request #6 from keep-network/encrypt-with-randomness
Added EncryptWithR allowing to specify the randomness
2018-07-09 11:08:12 +02:00
Piotr Dyraga cfa2d72bef Added EncryptWithR allowing to specify the randomness
Function `EncryptWithR` lets to specify randomness `r` explicitely. For
some ZKPs based on the Paillier scheme, it's required to use the same
`r` for encryption and constructing 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 want to make sure person
using the specific `r` and using it somewhere else really knows what
he's doing.
2018-07-09 09:34:09 +02:00