INNER CODE UNIT · Python
layers
KnifeXRage/Godot-Secure · Godot Secure Scripts/universal/Godot Secure AES-256 Universal v6.py:84
layers = secrets.randbelow(5) + 2
a = secrets.choice(operands)
b = operands[1] if a == operands[0] else operands[0]
shift, rshift = rotation()
expression = secrets.choice(base_ops).format(a=a,b=b,shift=shift,rshift=rshift,const=rand_const())
for _ in range(layers - 1):
shift, rshift = rotation()
value = secrets.choice(operands)
# never allow identical cancellation
if value == expression:
value = secrets.choice(operands)
expression = secrets.choice(chain_ops).format(expr=expression,value=value,shift=shift,rshift=rshift,const=rand_const())