Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::MD2Hasher_t Struct Reference

Multi-pass MD2 hash generator. More...

Collaboration diagram for Burger::MD2Hasher_t:

Public Member Functions

void init (void) noexcept
 Initialize the MD2 hasher.
 
void process (const uint8_t pBlock[16]) noexcept
 Process a single 16 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

MD2_t m_Hash
 Calculated hash.
 
uint8_t m_Checksum [16]
 Running checksum.
 
uint8_t m_CacheBuffer [16]
 Cached input data for multi-pass hashing.
 
uintptr_t m_uCount
 Number of bytes in the cache (0-15)
 

Detailed Description

Multi-pass MD2 hash generator.


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

// Initialize
Context.init();
// Process data in passes
Context.process(Buffer1,sizeof(Buffer1));
Context.process(Buffer2,sizeof(Buffer2));
Context.process(Buffer3,sizeof(Buffer3));
// Wrap up the processing
Context.finalize();
// Return the resulting hash
MemoryCopy(pOutput,&Context.m_Hash,16);
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 MD2 hash generator.
Definition burger.h:7204
void finalize(void) noexcept
Finalize the hashing.
Definition brmd2.cpp:258
void process(const uint8_t pBlock[16]) noexcept
Process a single 16 byte block of data.
Definition brmd2.cpp:109
void init(void) noexcept
Initialize the MD2 hasher.
Definition brmd2.cpp:90
MD2_t m_Hash
Calculated hash.
Definition burger.h:7207
See also
MD2_t or hash(MD2_t *,const void *,uintptr_t)

Member Function Documentation

◆ finalize()

void BURGER_API Burger::MD2Hasher_t::finalize ( void )
noexcept

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::MD2Hasher_t::init ( void )
noexcept

Initialize the MD2 hasher.


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

◆ process() [1/2]

void BURGER_API Burger::MD2Hasher_t::process ( const uint8_t pBlock[16])
noexcept

Process a single 16 byte block of data.


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

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

◆ process() [2/2]

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

Process an arbitrary number of input bytes.


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

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

Member Data Documentation

◆ m_CacheBuffer

uint8_t Burger::MD2Hasher_t::m_CacheBuffer[16]

Cached input data for multi-pass hashing.

◆ m_Checksum

uint8_t Burger::MD2Hasher_t::m_Checksum[16]

Running checksum.

◆ m_Hash

MD2_t Burger::MD2Hasher_t::m_Hash

Calculated hash.

◆ m_uCount

uintptr_t Burger::MD2Hasher_t::m_uCount

Number of bytes in the cache (0-15)