mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
39 lines
862 B
C++
39 lines
862 B
C++
/*
|
|
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
|
|
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
|
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
|
*/
|
|
|
|
#ifndef _AUTH_SHA1_H
|
|
#define _AUTH_SHA1_H
|
|
|
|
#include "Define.h"
|
|
#include <string>
|
|
#include <openssl/sha.h>
|
|
|
|
class BigNumber;
|
|
|
|
class SHA1Hash
|
|
{
|
|
public:
|
|
SHA1Hash();
|
|
~SHA1Hash();
|
|
|
|
void UpdateBigNumbers(BigNumber* bn0, ...);
|
|
|
|
void UpdateData(const uint8* dta, int len);
|
|
void UpdateData(const std::string& str);
|
|
|
|
void Initialize();
|
|
void Finalize();
|
|
|
|
uint8* GetDigest(void) { return mDigest; };
|
|
int GetLength(void) const { return SHA_DIGEST_LENGTH; };
|
|
|
|
private:
|
|
SHA_CTX mC;
|
|
uint8 mDigest[SHA_DIGEST_LENGTH];
|
|
};
|
|
#endif
|
|
|