This library implements some hash and cryptographic algorithms.

Dependents:   mBuinoBlinky PB_Emma_Ethernet SLOTrashHTTP Garagem ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MD5.h Source File

MD5.h

00001 #ifndef MD5_H
00002 #define MD5_H
00003 
00004 #include "HashAlgorithm.h"
00005 
00006 
00007 class MD5 : public HashAlgorithm
00008 {
00009     public :
00010     
00011         MD5();
00012         
00013         virtual uint8_t outputSize() const;
00014         virtual void update(uint8_t *data, uint32_t length);
00015         virtual void finalize(uint8_t *hash);
00016         
00017         static void computeHash(uint8_t *hash, uint8_t *data, uint32_t length);
00018         
00019     private :
00020     
00021         static void computeRounds(uint32_t *a2, uint32_t *b2, uint32_t *c2, uint32_t *d2, uint8_t *buffer);
00022         
00023         uint32_t a,b,c,d;
00024         uint32_t totalBufferLength;
00025         uint8_t buffer[64];
00026         uint8_t bufferLength;
00027 };
00028 
00029 #endif