nucypher / nufhe

NuCypher fully homomorphic encryption (NuFHE) library implemented in Python
https://nufhe.readthedocs.io/en/latest/
GNU General Public License v3.0
441 stars 53 forks source link

random_numbers: use numpy.fromstring() to generate random numbers from the raw urandom() output #10

Closed fjarri closed 5 years ago

fjarri commented 5 years ago

This variant works much faster. The random_bool() and random_torus32() should be fine from the security standpoint, but I have some concerns about the generation of Gaussian numbers:

That said, the SystemRandom.normalvariate() implementation uses rejection sampling, so it's vulnerable to side-channel attacks.