Botan
1.11.15
|
00001 /* 00002 * Filter interface for AEAD Modes 00003 * (C) 2013 Jack Lloyd 00004 * 00005 * Botan is released under the Simplified BSD License (see license.txt) 00006 */ 00007 00008 #ifndef BOTAN_AEAD_FILTER_H__ 00009 #define BOTAN_AEAD_FILTER_H__ 00010 00011 #include <botan/transform_filter.h> 00012 #include <botan/aead.h> 00013 00014 namespace Botan { 00015 00016 /** 00017 * Filter interface for AEAD Modes 00018 */ 00019 class BOTAN_DLL AEAD_Filter : public Transform_Filter 00020 { 00021 public: 00022 AEAD_Filter(AEAD_Mode* aead) : Transform_Filter(aead) {} 00023 00024 /** 00025 * Set associated data that is not included in the ciphertext but 00026 * that should be authenticated. Must be called after set_key 00027 * and before end_msg. 00028 * 00029 * @param ad the associated data 00030 * @param ad_len length of add in bytes 00031 */ 00032 void set_associated_data(const byte ad[], size_t ad_len) 00033 { 00034 dynamic_cast<AEAD_Mode&>(get_transform()).set_associated_data(ad, ad_len); 00035 } 00036 }; 00037 00038 } 00039 00040 #endif