added support for authenticated encryption.