MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / Encrypt

Function Encrypt

Source/encrypt.cpp:77–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void Encrypt(uint32_t *castBlock, uint32_t size, uint32_t key)
78{
79 uint32_t seed = 0xEEEEEEEE;
80 for (unsigned i = 0; i < (size >> 2); i++) {
81 uint32_t ch = *castBlock;
82 uint32_t t = ch;
83 seed += hashtable[4][(key & 0xFF)];
84 t ^= seed + key;
85 *castBlock = SDL_SwapLE32(t);
86 castBlock++;
87 seed += ch + (seed << 5) + 3;
88 key = (((key << 0x15) ^ 0xFFE00000) + 0x11111111) | (key >> 0x0B);
89 }
90}
91
92uint32_t Hash(const char *s, int type)
93{

Callers 2

WriteBlockTableMethod · 0.85
WriteHashTableMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected