KiCad PCB EDA Suite
Loading...
Searching...
No Matches
MD5_HASH Class Reference

#include <md5_hash.h>

Classes

struct  MD5_CTX
 

Public Member Functions

 MD5_HASH ()
 
 MD5_HASH (const MD5_HASH &aOther)
 
 ~MD5_HASH ()
 
void Init ()
 
void Hash (uint8_t *data, uint32_t length)
 
void Hash (int value)
 
void Finalize ()
 
bool IsValid () const
 
void SetValid (bool aValid)
 
MD5_HASHoperator= (const MD5_HASH &aOther)
 
bool operator== (const MD5_HASH &aOther) const
 
bool operator!= (const MD5_HASH &aOther) const
 
std::string Format (bool aCompactForm=false)
 

Private Member Functions

void md5_transform (MD5_CTX *ctx, uint8_t data[])
 
void md5_init (MD5_CTX *ctx)
 
void md5_update (MD5_CTX *ctx, uint8_t data[], uint32_t len)
 
void md5_final (MD5_CTX *ctx, uint8_t hash[])
 

Private Attributes

bool m_valid
 
MD5_CTX m_ctx
 
uint8_t m_hash [16]
 

Detailed Description

Definition at line 11 of file md5_hash.h.

Constructor & Destructor Documentation

◆ MD5_HASH() [1/2]

MD5_HASH::MD5_HASH ( )

Definition at line 30 of file md5_hash.cpp.

References Init().

◆ MD5_HASH() [2/2]

MD5_HASH::MD5_HASH ( const MD5_HASH aOther)

Definition at line 36 of file md5_hash.cpp.

References m_ctx, m_hash, and m_valid.

◆ ~MD5_HASH()

MD5_HASH::~MD5_HASH ( )

Definition at line 44 of file md5_hash.cpp.

Member Function Documentation

◆ Finalize()

void MD5_HASH::Finalize ( )

Definition at line 78 of file md5_hash.cpp.

References m_ctx, m_hash, m_valid, and md5_final().

Referenced by SHAPE_POLY_SET::checksum().

◆ Format()

std::string MD5_HASH::Format ( bool  aCompactForm = false)
Returns
Build a hexadecimal string from the 16 bytes of MD5_HASH Mainly for debug purposes.
Parameters
aCompactForm= false to generate a string with spaces between each byte (2 chars) = true to generate a string filled with 32 hexadecimal chars

Definition at line 97 of file md5_hash.cpp.

References m_hash.

Referenced by DSN::SPECCTRA_DB::makePADSTACK().

◆ Hash() [1/2]

void MD5_HASH::Hash ( int  value)

Definition at line 72 of file md5_hash.cpp.

References m_ctx, and md5_update().

◆ Hash() [2/2]

void MD5_HASH::Hash ( uint8_t *  data,
uint32_t  length 
)

Definition at line 66 of file md5_hash.cpp.

References m_ctx, and md5_update().

Referenced by SHAPE_POLY_SET::checksum().

◆ Init()

void MD5_HASH::Init ( )

Definition at line 58 of file md5_hash.cpp.

References m_ctx, m_hash, m_valid, and md5_init().

Referenced by MD5_HASH().

◆ IsValid()

bool MD5_HASH::IsValid ( ) const
inline

◆ md5_final()

void MD5_HASH::md5_final ( MD5_CTX ctx,
uint8_t  hash[] 
)
private

◆ md5_init()

void MD5_HASH::md5_init ( MD5_CTX ctx)
private

◆ md5_transform()

void MD5_HASH::md5_transform ( MD5_CTX ctx,
uint8_t  data[] 
)
private

Definition at line 125 of file md5_hash.cpp.

References FF, GG, HH, II, and MD5_HASH::MD5_CTX::state.

Referenced by md5_final(), and md5_update().

◆ md5_update()

void MD5_HASH::md5_update ( MD5_CTX ctx,
uint8_t  data[],
uint32_t  len 
)
private

◆ operator!=()

bool MD5_HASH::operator!= ( const MD5_HASH aOther) const

Definition at line 91 of file md5_hash.cpp.

References m_hash.

◆ operator=()

MD5_HASH & MD5_HASH::operator= ( const MD5_HASH aOther)

Definition at line 48 of file md5_hash.cpp.

References m_ctx, m_hash, and m_valid.

◆ operator==()

bool MD5_HASH::operator== ( const MD5_HASH aOther) const

Definition at line 85 of file md5_hash.cpp.

References m_hash.

◆ SetValid()

void MD5_HASH::SetValid ( bool  aValid)
inline

Definition at line 26 of file md5_hash.h.

References m_valid.

Referenced by SHAPE_POLY_SET::cacheTriangulation().

Member Data Documentation

◆ m_ctx

MD5_CTX MD5_HASH::m_ctx
private

Definition at line 54 of file md5_hash.h.

Referenced by Finalize(), Hash(), Init(), MD5_HASH(), and operator=().

◆ m_hash

uint8_t MD5_HASH::m_hash[16]
private

Definition at line 55 of file md5_hash.h.

Referenced by Finalize(), Format(), Init(), MD5_HASH(), operator!=(), operator=(), and operator==().

◆ m_valid

bool MD5_HASH::m_valid
private

Definition at line 53 of file md5_hash.h.

Referenced by Finalize(), Init(), IsValid(), MD5_HASH(), operator=(), and SetValid().


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