mv os.urandom sanity check to main __init__.py

cool check but I am going to delete rsakey.py
This commit is contained in:
SomberNight
2026-03-20 15:48:37 +00:00
parent 8f21f1d744
commit dceece1cda
2 changed files with 7 additions and 4 deletions
+7
View File
@@ -46,3 +46,10 @@ except AssertionError:
else:
raise ImportError("Running with asserts disabled. Refusing to continue. Exiting...")
# Check that os.urandom works
import zlib
length = len(zlib.compress(os.urandom(1000)))
if length <= 900:
raise ImportError("Broken PRNG. Refusing to continue. Exiting...")
-4
View File
@@ -46,10 +46,6 @@ def SHA1(x):
# PRNG Functions
# **************************************************************************
# Check that os.urandom works
import zlib
length = len(zlib.compress(os.urandom(1000)))
assert length > 900
def getRandomBytes(howMany):
b = bytearray(os.urandom(howMany))