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

dsMD5.h

Go to the documentation of this file.
00001 
00023 #ifndef dsMD5_h
00024 #define dsMD5_h
00025 
00026 #include <dsCypher.h>
00027 
00028                      
00029 class dsMD5 : public dsCryptoHash
00030 {
00031     /* Precompiled constants */
00032 
00033     static const dsCypher_word32_t T[64] dsCypher_SECTION;
00034     static const dsCypher_byte_t PADDING[64] dsCypher_SECTION;
00035 
00036     dsCypher_word32_t _state[4];
00037     dsCypher_word32_t _count[2];
00038     dsCypher_byte_t  _buffer[64];                        
00039     
00040     void transform(dsCypher_word32_t state[4], const dsCypher_word32_t x[16]) dsCypher_SECTION;
00041     void transform(dsCypher_word32_t state[4], const dsCypher_byte_t *block);
00042 
00043 protected:
00044 
00045     void update(const dsCypher_byte_t *p_src, dsCypher_word32_t p_len) dsCypher_SECTION;
00046 
00047 public:
00048 
00049     virtual void cryptoHash(dsCypher_byte_t *p_digest, const dsCypher_byte_t *p_src, dsCypher_word32_t p_srcLen)  dsCypher_SECTION;
00050     virtual const dsCypher_word32_t digestSize() dsCypher_SECTION;
00051 
00052 #ifdef WITH_TEST_VECTORS
00053     virtual const char *testAlgName();
00054     virtual const dsCypher_byte_t *testExpectedResult();
00055 #endif
00056 
00057 };
00058 
00059 inline void dsMD5::transform(dsCypher_word32_t state[4], const dsCypher_byte_t *block) 
00060 {
00061     dsCypher_word32_t x[16];
00062     n_n2le(x, block, 64);
00063     transform(state,x);
00064 }
00065 
00066 
00067 #endif

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