This commit is contained in:
2025-03-24 22:08:34 +01:00
parent 04a5de372e
commit f8f73b47ef
14 changed files with 52 additions and 12 deletions

View File

@@ -6,10 +6,17 @@ import sys
def ROL(X, N):
return ((((X) << (N)) | ((X) >> (64 - (N)))) % (2 ** 64))
if isinstance(X, z3.BitVecRef):
return z3.RotateLeft(X,N)
else:
return ((((X) << (N)) | ((X) >> (64 - (N)))) % (2 ** 64))
def ROR(X, N):
return ((((X) >> (N)) | ((X) << (64 - (N)))) % (2 ** 64))
if isinstance(X, z3.BitVecRef):
return z3.RotateRight(X,N)
else:
return ((((X) >> (N)) | ((X) << (64 - (N)))) % (2 ** 64))
def custom_random(state):
NEW_STATE = ROL(state,30) ^ ROR(state,12) ^ ROL(state,42) ^ ROL(state,4) ^ ROR(state,5);