// CAST static dword func8(dword aKey) { static cast_key CASTKey; static bool CASTInited = false; byte Key[16] = { 0x40, 0xF2, 0x41, 0xB2, 0x69, 0xF6, 0xF1, 0xAF, 0x63, 0xF4, 0x5E, 0xFF, 0x0E, 0x1C, 0x11, 0x9B }; if(!CASTInited) { cast_setkey(&CASTKey, Key, 16); CASTInited = true; } byte inBlock[8] = {0, 0, 0, 0, 0, 0, 0, 0}; byte outBlock[8] = {0, 0, 0, 0, 0, 0, 0, 0}; *(dword*)(inBlock) = aKey; cast_decrypt(&CASTKey, inBlock, outBlock); return *(dword*)(outBlock); }
static void cast5_decrypt(caddr_t key, u_int8_t *blk) { cast_decrypt((cast_key *) key, blk, blk); }