Botan  1.11.15
src/lib/block/idea/idea.h
Go to the documentation of this file.
00001 /*
00002 * IDEA
00003 * (C) 1999-2007 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_IDEA_H__
00009 #define BOTAN_IDEA_H__
00010 
00011 #include <botan/block_cipher.h>
00012 
00013 namespace Botan {
00014 
00015 /**
00016 * IDEA
00017 */
00018 class BOTAN_DLL IDEA : public Block_Cipher_Fixed_Params<8, 16>
00019    {
00020    public:
00021       void encrypt_n(const byte in[], byte out[], size_t blocks) const;
00022       void decrypt_n(const byte in[], byte out[], size_t blocks) const;
00023 
00024       void clear();
00025       std::string name() const { return "IDEA"; }
00026       BlockCipher* clone() const { return new IDEA; }
00027    protected:
00028       /**
00029       * @return const reference to encryption subkeys
00030       */
00031       const secure_vector<u16bit>& get_EK() const { return EK; }
00032 
00033       /**
00034       * @return const reference to decryption subkeys
00035       */
00036       const secure_vector<u16bit>& get_DK() const { return DK; }
00037 
00038    private:
00039       void key_schedule(const byte[], size_t);
00040 
00041       secure_vector<u16bit> EK, DK;
00042    };
00043 
00044 }
00045 
00046 #endif