Code: Show/Hide Uint32 SS_ENCR::getSessionKey(Uint32 clientKey) { return ((~clientKey) + 1); // Two's complement, same as arithmetic minus on unsigned data } bool SS_ENCR::validateSessionKey(Uint32 serverKey) { return ((serverKey == sentKey) || (serverKey == getSessionKey(sentKey))); } |