Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
No Matches
Public Member Functions | Public Attributes | List of all members
Burger::SHA1Hasher_t Struct Reference

Multi-pass SHA1 hash generator. More...

Collaboration diagram for Burger::SHA1Hasher_t:
Collaboration graph

Public Member Functions

void init (void) noexcept
 Initialize the SHA-1 hasher.
void process (const uint8_t pBlock[64]) noexcept
 Process a single 64 byte block of data.
void process (const void *pInput, uintptr_t uLength) noexcept
 Process an arbitrary number of input bytes.
void finalize (void) noexcept
 Finalize the hashing.

Public Attributes

uint64_t m_uByteCount
 Number of bytes processed (64 bit value)
SHA1_t m_Hash
 Current 160 bit value.
uint8_t m_CacheBuffer [64]
 Input buffer for processing.

Detailed Description

Multi-pass SHA1 hash generator.

This structure is needed to perform a multi-pass SHA-1 hash and contains cached data and a running checksum.

// Initialize
// Process data in passes
// Wrap up the processing
// Return the resulting hash
void MemoryCopy(void *pOutput, const void *pInput, uintptr_t uCount) noexcept
Copy raw memory from one buffer to another.
Definition brmemoryfunctions.cpp:186
Multi-pass SHA1 hash generator.
Definition burger.h:7312
Select a type based if the conditional is true or false.
Definition burger.h:3178
See also
SHA1_t or hash(SHA1_t *,const void *,uintptr_t)

Member Function Documentation

◆ finalize()

void BURGER_API Burger::SHA1Hasher_t::finalize ( void )

Finalize the hashing.

When multi-pass hashing is performed, this call is necessary to finalize the hash so that the generated checksum can be applied into the hash

See also
init(void), process(const void *,uintptr_t)

◆ init()

void BURGER_API Burger::SHA1Hasher_t::init ( void )

Initialize the SHA-1 hasher.

Call this function before any hashing is performed

See also
process(const void *,uintptr_t) or finalize(void)

◆ process() [1/2]

void BURGER_API Burger::SHA1Hasher_t::process ( const uint8_t pBlock[64])

Process a single 64 byte block of data.

SHA1 data is processed in 64 byte chunks. This function will process 64 bytes on input and update the hash and checksum

pBlockPointer to a buffer of 64 bytes of data to hash
See also
process(const void *,uintptr_t), finalize(void) or init(void)

◆ process() [2/2]

void BURGER_API Burger::SHA1Hasher_t::process ( const void * pInput,
uintptr_t uLength )

Process an arbitrary number of input bytes.

Process input data into the hash. If data chunks are not a multiple of 64 bytes, the excess will be cached and a future call will continue the hashing where it left off.

pInputPointer to a buffer of data to hash
uLengthNumber of bytes to hash
See also
process(const uint8_t[64]), finalize(void)

Member Data Documentation

◆ m_CacheBuffer

uint8_t Burger::SHA1Hasher_t::m_CacheBuffer[64]

Input buffer for processing.

◆ m_Hash

SHA1_t Burger::SHA1Hasher_t::m_Hash

Current 160 bit value.

◆ m_uByteCount

uint64_t Burger::SHA1Hasher_t::m_uByteCount

Number of bytes processed (64 bit value)