SHA1Digest.h++
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __ccxx_SHA1Digest_hxx
00024 #define __ccxx_SHA1Digest_hxx
00025
00026 #include <commonc++/Digest.h++>
00027
00028 namespace ccxx {
00029
00035 class COMMONCPP_API SHA1Digest : public Digest
00036 {
00037 public:
00038
00040 SHA1Digest() throw();
00041
00043 virtual ~SHA1Digest() throw();
00044
00045 inline virtual size_t size() const throw()
00046 { return(20); }
00047
00048 virtual void update(const byte_t *buf, size_t len) throw(IOException);
00049
00050 virtual void finish(byte_t *digest) throw();
00051
00052 virtual void reset() throw();
00053
00054 private:
00055
00056 void processBlock();
00057 void padBlock();
00058 inline uint32_t rotateLeft(uint32_t word, int bits);
00059
00060 uint32_t _h[5];
00061 uint64_t _length;
00062 byte_t _block[64];
00063 int _offset;
00064
00065 CCXX_COPY_DECLS(SHA1Digest);
00066 };
00067
00068 };
00069
00070 #endif // __ccxx_SHA1Digest_hxx
00071
00072