Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

dsBlowfish.h

Go to the documentation of this file.
00001 
00023 #ifndef dsBlowfish_h
00024 #define dsBlowfish_h
00025 
00026 #include <dsCypher.h>
00027 
00028 class  dsBlowfish : public dsBlockCypher
00029 {
00030     /* Precompiled constants */
00031     static const dsCypher_word32_t ORIG_P[16 + 2] dsCypher_SECTION;
00032     static const dsCypher_word32_t ORIG_S[4][256] dsCypher_SECTION; 
00033 
00034     dsCypher_word32_t _KEY_P[16 + 2];
00035     dsCypher_word32_t _KEY_S[4][256];
00036 
00037     dsCypher_word32_t F(dsCypher_word32_t x); 
00038 
00039 public:
00040     
00041     /* dsCypher interfaces */
00042 
00047     virtual void setKey(const dsCypher_byte_t *p_key, dsCypher_word32_t p_keyLen, keyMode km = dsCypher::kmBOTH) dsCypher_SECTION;
00048 
00052     virtual void encryptBlock(const dsCypher_word32_t *inBlock, dsCypher_word32_t *outBlock)  dsCypher_SECTION;
00053     virtual void decryptBlock(const dsCypher_word32_t *inBlock, dsCypher_word32_t *outBlock)  dsCypher_SECTION;
00054 
00055     dsBlowfish(const dsCypher_byte_t *p_key, dsCypher_word32_t p_keyLen);
00056     dsBlowfish();
00057 
00058 #ifdef WITH_TEST_VECTORS
00059     virtual const dsCypher_byte_t * testExpectedResult( cmMODES p_mode );
00060     virtual const dsCypher_word32_t testExpectedResultLen( cmMODES p_mode );
00061     virtual const char *testAlgName();
00062 #endif
00063 };
00064 
00065 
00066 #endif
00067 

Generated on Mon May 16 18:26:57 2005 for libdms4 by doxygen1.3-rc2