Botan  1.11.15
src/lib/modes/cipher_mode.h
Go to the documentation of this file.
00001 /*
00002 * Cipher Modes
00003 * (C) 2013 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_CIPHER_MODE_H__
00009 #define BOTAN_CIPHER_MODE_H__
00010 
00011 #include <botan/transform.h>
00012 #include <botan/stream_cipher.h>
00013 
00014 namespace Botan {
00015 
00016 /**
00017 * Interface for cipher modes
00018 */
00019 class BOTAN_DLL Cipher_Mode : public Keyed_Transform
00020    {
00021    public:
00022       /**
00023       * Returns true iff this mode provides authentication as well as
00024       * confidentiality.
00025       */
00026       virtual bool authenticated() const { return false; }
00027 
00028       /**
00029       * Return the size of the authentication tag used (in bytes)
00030       */
00031       virtual size_t tag_size() const { return 0; }
00032    };
00033 
00034 /**
00035 * The two possible directions for cipher filters, determining whether they
00036 * actually perform encryption or decryption.
00037 */
00038 enum Cipher_Dir { ENCRYPTION, DECRYPTION };
00039 
00040 BOTAN_DLL Cipher_Mode* get_cipher_mode(const std::string& algo_spec, Cipher_Dir direction);
00041 
00042 }
00043 
00044 #endif