statlab / cryptorandom

Pseudorandom number generators based on cryptographic hash functions
https://statlab.github.io/cryptorandom/
BSD 2-Clause "Simplified" License
3 stars 10 forks source link

AttributeErrors in SHA256 class functions when seed=None #55

Open ackaplan11 opened 3 years ago

ackaplan11 commented 3 years ago

When you create a new SHA256 object using the constructor without parameters sha256 = SHA256(),

the following functions will return AttributeErrors sha256.jumpahead() --> AttributeError: 'NoneType' object has no attribute 'update' sha256.next() --> 'AttributeError: NoneType' object has no attribute 'update' sha256.random() --> AttributeError: 'NoneType' object has no attribute 'digest' sha256.randint_trunc() --> AttributeError: 'NoneType' object has no attribute 'digest' -- (Depricated) sha256.getrandbits() --> AttributeError: 'NoneType' object has no attribute 'digest' sha256.randbelow_from_randbits() --> AttributeError: 'NoneType' object has no attribute 'digest' sha256.randint() --> AttributeError: 'NoneType' object has no attribute 'digest'