Botan  1.11.15
src/lib/block/seed/seed.h
Go to the documentation of this file.
00001 /*
00002 * SEED
00003 * (C) 1999-2007 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_SEED_H__
00009 #define BOTAN_SEED_H__
00010 
00011 #include <botan/block_cipher.h>
00012 
00013 namespace Botan {
00014 
00015 /**
00016 * SEED, a Korean block cipher
00017 */
00018 class BOTAN_DLL SEED : public Block_Cipher_Fixed_Params<16, 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 "SEED"; }
00026       BlockCipher* clone() const { return new SEED; }
00027    private:
00028       void key_schedule(const byte[], size_t);
00029 
00030       class G_FUNC
00031          {
00032          public:
00033             u32bit operator()(u32bit) const;
00034          private:
00035             static const u32bit S0[256], S1[256], S2[256], S3[256];
00036          };
00037 
00038       secure_vector<u32bit> K;
00039    };
00040 
00041 }
00042 
00043 #endif