A technique for integrating message authentication with encryption and
decryption is disclosed. Intermediate internal states of the decryption
operation are used to generate a validation code that can be used to
detect manipulation of the encrypted data. The technique is optimized with
respect to processing time, execution space for code and runtime data, and
buffer usage. The technique is generally applicable to a variety of block
ciphers, including TEA, Rijndael, DES, RC5, and RC6.