Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ThreeFry,
Xoshiro256,
Xoshiro512,
)
class ChaCha8(ChaCha):
canonical_repr = "ChaCha(rounds=8)"
def __init__(self, *args, **kwargs):
if "rounds" in kwargs:
del kwargs["rounds"]
super().__init__(*args, rounds=8, **kwargs)
class JSF32(JSF):
def __init__(self, *args, **kwargs):
if "size" in kwargs:
del kwargs["size"]
super().__init__(*args, size=32, **kwargs)
class Philox4x32(Philox):
canonical_repr = "Philox(n=4, w=32)"
def __init__(self, *args, **kwargs):
if "width" in kwargs:
del kwargs["width"]
super().__init__(*args, width=32, **kwargs)
class Philox2x64(Philox):
Philox2x64,
DSFMT,
MT64,
MT19937,
PCG64,
PCG64DXSM128,
PCG64DXSM,
LXM,
SFMT,
AESCounter,
ChaCha,
Philox,
ThreeFry,
Xoshiro256,
Xoshiro512,
JSF,
Romu,
RomuTrio,
HC128,
SPECK128,
SFC64,
EFIIX64,
]
if HAS_RDRND:
PRNGS.append(RDRAND)
funcs = OrderedDict()
funcs["Uint32"] = f'integers(2**32, dtype="uint32", size={SIZE})'
funcs["Uint64"] = f'integers(2**64, dtype="uint64", size={SIZE})'
funcs["Uniform"] = f"random(size={SIZE})"
ChaCha,
LCG128Mix,
Philox,
Romu,
ThreeFry,
Xoshiro256,
Xoshiro512,
)
ALL_BIT_GENS = [
AESCounter,
ChaCha,
DSFMT,
EFIIX64,
HC128,
JSF,
LXM,
PCG64,
LCG128Mix,
MT19937,
Philox,
SFC64,
SFMT,
SPECK128,
ThreeFry,
Xoshiro256,
Xoshiro512,
Romu,
]
JUMPABLE = [bg for bg in ALL_BIT_GENS if hasattr(bg, "jumped")]
SPECIALS = {