Plaintext space check #10

Merged
pdyraga merged 3 commits from master into master 2018-08-07 20:43:36 -04:00
3 Commits
Author SHA1 Message Date
Jakub Nowakowski 3a27db63e5 Merge pull request #9 from keep-network/check-plaintext-space
Plaintext space check
2018-08-02 13:48:22 +02:00
Piotr Dyraga edb17e88e7 TestAddCypherWithSmallKeyModulus fixed - m can't be bigger than N now
For Paillier modulus N=pq, plaintext m space is [0, N). We now report an
error if m is not in the allowed range.
2018-07-31 17:06:42 +02:00
Piotr Dyraga 2a33f6e35c Plaintext space check
According to [DJN 10], the plaintext space is `Z_n`. We had this
information in the `Encrypt` and `EncryptWithR` documentation but
sometimes, when encrypting result of more complex equations, it's easy
to miss the fact the result is out of the allowed range.

Here we have just a safety check making sure that if plaintext is out of
allowed space, we report an error.
2018-07-31 16:18:19 +02:00