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 randomnessr
explicitly. For some ZKPs based on the Paillier scheme, it's required to use the samer
for encryption and construction of ZKP. It wasn't possible previously, becauser
was generated internally and never returned.I did not want to modify
Encrypt
to returnr
because it would break existing code using this API, as well as, I wanted to make sure person using the specificr
and using it somewhere else really knows what he's doing.