Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
SHA1 Class Reference

#include <sha1.h>

Public Member Functions

 SHA1 ()
 
 ~SHA1 ()
 
void addBytes (const char *data, Uint32 num)
 
void addBytes (std::string_view data)
 
void getDigest (unsigned char *to)
 
std::string getDigest ()
 

Static Public Member Functions

static Uint32 lrot (Uint32 x, int bits)
 
static void storeBigEndianUint32 (unsigned char *byte, Uint32 num)
 
static void hexPrinter (unsigned char *c, int l)
 

Private Member Functions

void process ()
 

Private Attributes

Uint32 H0 = 0x67452301
 
Uint32 H1 = 0xefcdab89
 
Uint32 H2 = 0x98badcfe
 
Uint32 H3 = 0x10325476
 
Uint32 H4 = 0xc3d2e1f0
 
unsigned char bytes [64]
 
Uint32 unprocessedBytes = 0
 
Uint32 size = 0
 

Constructor & Destructor Documentation

◆ SHA1()

SHA1::SHA1 ( )

◆ ~SHA1()

SHA1::~SHA1 ( )

References bytes, H0, H1, H2, H3, H4, size, and unprocessedBytes.

Member Function Documentation

◆ addBytes() [1/2]

void SHA1::addBytes ( const char * data,
Uint32 num )

References bytes, process(), size, and unprocessedBytes.

Referenced by addBytes(), Server::addMediaFile(), IClientMediaDownloader::checkAndLoad(), getDigest(), Client::handleCommand_MediaPush(), ModApiUtil::l_sha1(), TestMapSettingsManager::testMapSettingsManager(), and translate_password().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addBytes() [2/2]

void SHA1::addBytes ( std::string_view data)
inline

References addBytes().

+ Here is the call graph for this function:

◆ getDigest() [1/2]

std::string SHA1::getDigest ( )
inline

References getDigest().

Referenced by getDigest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDigest() [2/2]

void SHA1::getDigest ( unsigned char * to)

References addBytes(), H0, H1, H2, H3, H4, size, storeBigEndianUint32(), and unprocessedBytes.

Referenced by Server::addMediaFile(), IClientMediaDownloader::checkAndLoad(), Client::handleCommand_MediaPush(), ModApiUtil::l_sha1(), TestMapSettingsManager::testMapSettingsManager(), and translate_password().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hexPrinter()

void SHA1::hexPrinter ( unsigned char * c,
int l )
static

◆ lrot()

Uint32 SHA1::lrot ( Uint32 x,
int bits )
static

Referenced by process().

+ Here is the caller graph for this function:

◆ process()

void SHA1::process ( )
private

References bytes, H0, H1, H2, H3, H4, lrot(), and unprocessedBytes.

Referenced by addBytes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storeBigEndianUint32()

void SHA1::storeBigEndianUint32 ( unsigned char * byte,
Uint32 num )
static

Referenced by getDigest().

+ Here is the caller graph for this function:

Member Data Documentation

◆ bytes

unsigned char SHA1::bytes[64]
private

Referenced by ~SHA1(), addBytes(), and process().

◆ H0

Uint32 SHA1::H0 = 0x67452301
private

Referenced by ~SHA1(), getDigest(), and process().

◆ H1

Uint32 SHA1::H1 = 0xefcdab89
private

Referenced by ~SHA1(), getDigest(), and process().

◆ H2

Uint32 SHA1::H2 = 0x98badcfe
private

Referenced by ~SHA1(), getDigest(), and process().

◆ H3

Uint32 SHA1::H3 = 0x10325476
private

Referenced by ~SHA1(), getDigest(), and process().

◆ H4

Uint32 SHA1::H4 = 0xc3d2e1f0
private

Referenced by ~SHA1(), getDigest(), and process().

◆ size

Uint32 SHA1::size = 0
private

Referenced by ~SHA1(), addBytes(), and getDigest().

◆ unprocessedBytes

Uint32 SHA1::unprocessedBytes = 0
private

Referenced by ~SHA1(), addBytes(), getDigest(), and process().


The documentation for this class was generated from the following files: