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 SHA1.h Source File

SHA1.h

00001 #ifndef SHA1_H
00002 #define SHA1_H
00003 
00004 #include "HashAlgorithm.h"
00005 
00006 
00007 class SHA1 : public HashAlgorithm
00008 {
00009     public :
00010     
00011         SHA1();
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         static void computeBlock(uint32_t *h02, uint32_t *h12, uint32_t *h22, uint32_t *h32, uint32_t *h42, uint8_t *buffer);
00021     
00022         uint32_t h0, h1, h2, h3, h4;
00023         uint32_t totalBufferLength;
00024         uint8_t buffer[64];
00025         uint8_t bufferLength;       
00026 };
00027 
00028 #endif