Botan  2.6.0
Crypto and TLS for C++11
aead_filt.h
Go to the documentation of this file.
1 /*
2 * Filter interface for AEAD Modes
3 * (C) 2013 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_AEAD_FILTER_H_
9 #define BOTAN_AEAD_FILTER_H_
10 
11 #include <botan/cipher_filter.h>
12 #include <botan/aead.h>
13 
14 namespace Botan {
15 
16 /**
17 * Filter interface for AEAD Modes
18 */
19 class AEAD_Filter final : public Cipher_Mode_Filter
20  {
21  public:
23 
24  /**
25  * Set associated data that is not included in the ciphertext but
26  * that should be authenticated. Must be called after set_key
27  * and before end_msg.
28  *
29  * @param ad the associated data
30  * @param ad_len length of add in bytes
31  */
32  void set_associated_data(const uint8_t ad[], size_t ad_len)
33  {
34  dynamic_cast<AEAD_Mode&>(get_transform()).set_associated_data(ad, ad_len);
35  }
36  };
37 
38 }
39 
40 #endif
AEAD_Filter(AEAD_Mode *aead)
Definition: aead_filt.h:22
void set_associated_data(const uint8_t ad[], size_t ad_len)
Definition: aead_filt.h:32
Definition: alg_id.cpp:13