1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-16 18:01:40 +00:00

Passwords - password entry at main menu, stored and checked by server

This commit is contained in:
Ciaran Gultnieks 2011-05-20 20:28:03 +01:00
parent b5ceaf445a
commit d4d49ee8f4
17 changed files with 534 additions and 34 deletions

35
src/sha1.h Normal file
View file

@ -0,0 +1,35 @@
/* sha1.h
Copyright (c) 2005 Michael D. Leonhard
http://tamale.net/
This file is licensed under the terms described in the
accompanying LICENSE file.
*/
#ifndef SHA1_HEADER
typedef unsigned int Uint32;
class SHA1
{
private:
// fields
Uint32 H0, H1, H2, H3, H4;
unsigned char bytes[64];
int unprocessedBytes;
Uint32 size;
void process();
public:
SHA1();
~SHA1();
void addBytes( const char* data, int num );
unsigned char* getDigest();
// utility methods
static Uint32 lrot( Uint32 x, int bits );
static void storeBigEndianUint32( unsigned char* byte, Uint32 num );
static void hexPrinter( unsigned char* c, int l );
};
#define SHA1_HEADER
#endif