]> git.lizzy.rs Git - dragonfireclient.git/blob - src/sha1.h
Passwords - password entry at main menu, stored and checked by server
[dragonfireclient.git] / src / sha1.h
1 /* sha1.h
2
3 Copyright (c) 2005 Michael D. Leonhard
4
5 http://tamale.net/
6
7 This file is licensed under the terms described in the
8 accompanying LICENSE file.
9 */
10
11 #ifndef SHA1_HEADER
12 typedef unsigned int Uint32;
13
14 class SHA1
15 {
16         private:
17                 // fields
18                 Uint32 H0, H1, H2, H3, H4;
19                 unsigned char bytes[64];
20                 int unprocessedBytes;
21                 Uint32 size;
22                 void process();
23         public:
24                 SHA1();
25                 ~SHA1();
26                 void addBytes( const char* data, int num );
27                 unsigned char* getDigest();
28                 // utility methods
29                 static Uint32 lrot( Uint32 x, int bits );
30                 static void storeBigEndianUint32( unsigned char* byte, Uint32 num );
31                 static void hexPrinter( unsigned char* c, int l );
32 };
33
34 #define SHA1_HEADER
35 #endif