Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
Sha1.h
Go to the documentation of this file.
1 
12 #ifndef __KOME_CORE_SHA1_H__
13 #define __KOME_CORE_SHA1_H__
14 
15 
16 namespace kome {
17  namespace core {
22  class CORE_TOOLKITS_CLASS Sha1 {
23  protected:
33  static unsigned long f( const long t, const unsigned long b, const unsigned long c, const unsigned long d );
34 
41  static unsigned long K( const long t );
42 
43  public:
51  static std::string transformData( void* src, const unsigned int length );
52 
59  static std::string transformFile( const char* path );
60 
61  protected:
66  class Sha1Context {
67  public:
72  Sha1Context();
73 
78  virtual ~Sha1Context();
79 
86  void appendMessage( unsigned char* msg, const unsigned long length );
87 
92  void finish();
93 
94  protected:
99  void updateHash();
100 
105  void padBlock();
106 
107  public:
109  unsigned long m_h[ 5 ];
110 
112  unsigned char m_block[ 64 ];
113 
115  unsigned long m_length;
116 
118  unsigned long m_pos;
119 
120  public:
125  void reset();
126  };
127  };
128  }
129 }
130 
131 
132 #endif // __KOME_CORE_SHA1_H__
unsigned long m_pos
Definition: Sha1.h:118
unsigned long m_length
Definition: Sha1.h:115
the class computing SHA1 hash
Definition: Sha1.h:22
SHA1 context.
Definition: Sha1.h:66