1891 DWORD KeyShuffled[0x10];
1892 DWORD KeyMirror[0x10];
1893 DWORD RoundCount = 0x14;
1899 KeyMirror[0x05] = (
DWORD)(ChunkOffset >> 32);
1900 KeyMirror[0x08] = (
DWORD)(ChunkOffset);
1905 KeyShuffled[0x0E] = KeyMirror[0x00];
1906 KeyShuffled[0x0C] = KeyMirror[0x01];
1907 KeyShuffled[0x05] = KeyMirror[0x02];
1908 KeyShuffled[0x0F] = KeyMirror[0x03];
1909 KeyShuffled[0x0A] = KeyMirror[0x04];
1910 KeyShuffled[0x07] = KeyMirror[0x05];
1911 KeyShuffled[0x0B] = KeyMirror[0x06];
1912 KeyShuffled[0x09] = KeyMirror[0x07];
1913 KeyShuffled[0x03] = KeyMirror[0x08];
1914 KeyShuffled[0x06] = KeyMirror[0x09];
1915 KeyShuffled[0x08] = KeyMirror[0x0A];
1916 KeyShuffled[0x0D] = KeyMirror[0x0B];
1917 KeyShuffled[0x02] = KeyMirror[0x0C];
1918 KeyShuffled[0x04] = KeyMirror[0x0D];
1919 KeyShuffled[0x01] = KeyMirror[0x0E];
1920 KeyShuffled[0x00] = KeyMirror[0x0F];
1923 for(
DWORD i = 0; i < RoundCount; i += 2)
1925 KeyShuffled[0x0A] = KeyShuffled[0x0A] ^
Rol32((KeyShuffled[0x0E] + KeyShuffled[0x02]), 0x07);
1926 KeyShuffled[0x03] = KeyShuffled[0x03] ^
Rol32((KeyShuffled[0x0A] + KeyShuffled[0x0E]), 0x09);
1927 KeyShuffled[0x02] = KeyShuffled[0x02] ^
Rol32((KeyShuffled[0x03] + KeyShuffled[0x0A]), 0x0D);
1928 KeyShuffled[0x0E] = KeyShuffled[0x0E] ^
Rol32((KeyShuffled[0x02] + KeyShuffled[0x03]), 0x12);
1930 KeyShuffled[0x07] = KeyShuffled[0x07] ^
Rol32((KeyShuffled[0x0C] + KeyShuffled[0x04]), 0x07);
1931 KeyShuffled[0x06] = KeyShuffled[0x06] ^
Rol32((KeyShuffled[0x07] + KeyShuffled[0x0C]), 0x09);
1932 KeyShuffled[0x04] = KeyShuffled[0x04] ^
Rol32((KeyShuffled[0x06] + KeyShuffled[0x07]), 0x0D);
1933 KeyShuffled[0x0C] = KeyShuffled[0x0C] ^
Rol32((KeyShuffled[0x04] + KeyShuffled[0x06]), 0x12);
1935 KeyShuffled[0x0B] = KeyShuffled[0x0B] ^
Rol32((KeyShuffled[0x05] + KeyShuffled[0x01]), 0x07);
1936 KeyShuffled[0x08] = KeyShuffled[0x08] ^
Rol32((KeyShuffled[0x0B] + KeyShuffled[0x05]), 0x09);
1937 KeyShuffled[0x01] = KeyShuffled[0x01] ^
Rol32((KeyShuffled[0x08] + KeyShuffled[0x0B]), 0x0D);
1938 KeyShuffled[0x05] = KeyShuffled[0x05] ^
Rol32((KeyShuffled[0x01] + KeyShuffled[0x08]), 0x12);
1940 KeyShuffled[0x09] = KeyShuffled[0x09] ^
Rol32((KeyShuffled[0x0F] + KeyShuffled[0x00]), 0x07);
1941 KeyShuffled[0x0D] = KeyShuffled[0x0D] ^
Rol32((KeyShuffled[0x09] + KeyShuffled[0x0F]), 0x09);
1942 KeyShuffled[0x00] = KeyShuffled[0x00] ^
Rol32((KeyShuffled[0x0D] + KeyShuffled[0x09]), 0x0D);
1943 KeyShuffled[0x0F] = KeyShuffled[0x0F] ^
Rol32((KeyShuffled[0x00] + KeyShuffled[0x0D]), 0x12);
1945 KeyShuffled[0x04] = KeyShuffled[0x04] ^
Rol32((KeyShuffled[0x0E] + KeyShuffled[0x09]), 0x07);
1946 KeyShuffled[0x08] = KeyShuffled[0x08] ^
Rol32((KeyShuffled[0x04] + KeyShuffled[0x0E]), 0x09);
1947 KeyShuffled[0x09] = KeyShuffled[0x09] ^
Rol32((KeyShuffled[0x08] + KeyShuffled[0x04]), 0x0D);
1948 KeyShuffled[0x0E] = KeyShuffled[0x0E] ^
Rol32((KeyShuffled[0x09] + KeyShuffled[0x08]), 0x12);
1950 KeyShuffled[0x01] = KeyShuffled[0x01] ^
Rol32((KeyShuffled[0x0C] + KeyShuffled[0x0A]), 0x07);
1951 KeyShuffled[0x0D] = KeyShuffled[0x0D] ^
Rol32((KeyShuffled[0x01] + KeyShuffled[0x0C]), 0x09);
1952 KeyShuffled[0x0A] = KeyShuffled[0x0A] ^
Rol32((KeyShuffled[0x0D] + KeyShuffled[0x01]), 0x0D);
1953 KeyShuffled[0x0C] = KeyShuffled[0x0C] ^
Rol32((KeyShuffled[0x0A] + KeyShuffled[0x0D]), 0x12);
1955 KeyShuffled[0x00] = KeyShuffled[0x00] ^
Rol32((KeyShuffled[0x05] + KeyShuffled[0x07]), 0x07);
1956 KeyShuffled[0x03] = KeyShuffled[0x03] ^
Rol32((KeyShuffled[0x00] + KeyShuffled[0x05]), 0x09);
1957 KeyShuffled[0x07] = KeyShuffled[0x07] ^
Rol32((KeyShuffled[0x03] + KeyShuffled[0x00]), 0x0D);
1958 KeyShuffled[0x05] = KeyShuffled[0x05] ^
Rol32((KeyShuffled[0x07] + KeyShuffled[0x03]), 0x12);
1960 KeyShuffled[0x02] = KeyShuffled[0x02] ^
Rol32((KeyShuffled[0x0F] + KeyShuffled[0x0B]), 0x07);
1961 KeyShuffled[0x06] = KeyShuffled[0x06] ^
Rol32((KeyShuffled[0x02] + KeyShuffled[0x0F]), 0x09);
1962 KeyShuffled[0x0B] = KeyShuffled[0x0B] ^
Rol32((KeyShuffled[0x06] + KeyShuffled[0x02]), 0x0D);
1963 KeyShuffled[0x0F] = KeyShuffled[0x0F] ^
Rol32((KeyShuffled[0x0B] + KeyShuffled[0x06]), 0x12);
1968 ChunkData[0x00] = ChunkData[0x00] ^ (KeyShuffled[0x0E] + KeyMirror[0x00]);
1969 ChunkData[0x01] = ChunkData[0x01] ^ (KeyShuffled[0x04] + KeyMirror[0x0D]);
1970 ChunkData[0x02] = ChunkData[0x02] ^ (KeyShuffled[0x08] + KeyMirror[0x0A]);
1971 ChunkData[0x03] = ChunkData[0x03] ^ (KeyShuffled[0x09] + KeyMirror[0x07]);
1972 ChunkData[0x04] = ChunkData[0x04] ^ (KeyShuffled[0x0A] + KeyMirror[0x04]);
1973 ChunkData[0x05] = ChunkData[0x05] ^ (KeyShuffled[0x0C] + KeyMirror[0x01]);
1974 ChunkData[0x06] = ChunkData[0x06] ^ (KeyShuffled[0x01] + KeyMirror[0x0E]);
1975 ChunkData[0x07] = ChunkData[0x07] ^ (KeyShuffled[0x0D] + KeyMirror[0x0B]);
1976 ChunkData[0x08] = ChunkData[0x08] ^ (KeyShuffled[0x03] + KeyMirror[0x08]);
1977 ChunkData[0x09] = ChunkData[0x09] ^ (KeyShuffled[0x07] + KeyMirror[0x05]);
1978 ChunkData[0x0A] = ChunkData[0x0A] ^ (KeyShuffled[0x05] + KeyMirror[0x02]);
1979 ChunkData[0x0B] = ChunkData[0x0B] ^ (KeyShuffled[0x00] + KeyMirror[0x0F]);
1980 ChunkData[0x0C] = ChunkData[0x0C] ^ (KeyShuffled[0x02] + KeyMirror[0x0C]);
1981 ChunkData[0x0D] = ChunkData[0x0D] ^ (KeyShuffled[0x06] + KeyMirror[0x09]);
1982 ChunkData[0x0E] = ChunkData[0x0E] ^ (KeyShuffled[0x0B] + KeyMirror[0x06]);
1983 ChunkData[0x0F] = ChunkData[0x0F] ^ (KeyShuffled[0x0F] + KeyMirror[0x03]);
1988 if(KeyMirror[0x08] == 0)
unsigned long long ULONGLONG
Definition: CascPort.h:144
static DWORD Rol32(DWORD dwValue, DWORD dwRolCount)
Definition: FileStream.cpp:1858
unsigned int DWORD
Definition: CascPort.h:139
#define BSWAP_ARRAY32_UNSIGNED(a, b)
Definition: CascPort.h:232
#define ENCRYPTED_CHUNK_SIZE
Definition: FileStream.h:210