Changed decryption, moved MAC checking to a new method.