Commits

Snake Doctor committed 93be756

Reverted ROL64 function to previous version, which weren't broken.

Comments (0)

Files changed (1)

     end;
 end;
 
-function ROL64(a: UInt64; offset: Byte): UInt64; //inline;
-type
-   TDynUInt64 = record
-   		case Byte of
-        	0: (Val: UInt64);
-            1: (Arr: array[0..1] of UInt32);
-   end;
-var
-	inA, outA: TDynUInt64;
+function ROL64(a: UInt64; offset: Byte): UInt64; inline;
 begin
-	inA.Val := a;
-    outA.Val := 0;
-
-    outA.Arr[0] := inA.Arr[0] SHL offset;
-    outA.Arr[1] := inA.Arr[1] SHL offset;
-    outA.Arr[0] := outA.Arr[0] XOR (inA.Arr[1] SHR (32-offset));
-    outA.Arr[1] := outA.Arr[1] XOR (inA.Arr[0] SHR (32-offset));
-
-    Result := outA.Val;
+	Result := a;
+	if offset <> 0 then
+    begin
+		Result := (a SHL offset) XOR (a SHR (64-offset));
+    end;
 end;