MRPT  2.0.4
List of all members | Public Types | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
MD5 Class Reference

Detailed Description

Definition at line 67 of file md5.cpp.

Public Types

using size_type = uint32_t
 

Public Member Functions

 MD5 ()=default
 
 MD5 (const std::string &text)
 
void update (const unsigned char *buf, size_type length)
 
void update (const char *buf, size_type length)
 
MD5finalize ()
 
std::string hexdigest () const
 

Private Types

enum  { blocksize = 64 }
 
using uint1 = unsigned char
 
using uint4 = unsigned int
 

Private Member Functions

void init ()
 
void transform (const uint1 block[blocksize])
 

Static Private Member Functions

static void decode (uint4 output[], const uint1 input[], size_type len)
 
static void encode (uint1 output[], const uint4 input[], size_type len)
 
static uint4 F (uint4 x, uint4 y, uint4 z)
 
static uint4 G (uint4 x, uint4 y, uint4 z)
 
static uint4 H (uint4 x, uint4 y, uint4 z)
 
static uint4 I (uint4 x, uint4 y, uint4 z)
 
static uint4 rotate_left (uint4 x, int n)
 
static void FF (uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac)
 
static void GG (uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac)
 
static void HH (uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac)
 
static void II (uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac)
 

Private Attributes

bool finalized {false}
 
uint1 buffer [blocksize]
 
uint4 count [2] = {0, 0}
 
uint4 state [4] = {0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476}
 
uint1 digest [16] {}
 

Friends

std::ostream & operator<< (std::ostream &, MD5 md5)
 

Member Typedef Documentation

◆ size_type

using MD5::size_type = uint32_t

Definition at line 70 of file md5.cpp.

◆ uint1

using MD5::uint1 = unsigned char
private

Definition at line 82 of file md5.cpp.

◆ uint4

using MD5::uint4 = unsigned int
private

Definition at line 83 of file md5.cpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
blocksize 

Definition at line 84 of file md5.cpp.

Constructor & Destructor Documentation

◆ MD5() [1/2]

MD5::MD5 ( )
default

◆ MD5() [2/2]

MD5::MD5 ( const std::string &  text)

Definition at line 185 of file md5.cpp.

Member Function Documentation

◆ decode()

void MD5::decode ( uint4  output[],
const uint1  input[],
size_type  len 
)
staticprivate

Definition at line 200 of file md5.cpp.

◆ encode()

void MD5::encode ( uint1  output[],
const uint4  input[],
size_type  len 
)
staticprivate

Definition at line 212 of file md5.cpp.

◆ F()

MD5::uint4 MD5::F ( uint4  x,
uint4  y,
uint4  z 
)
inlinestaticprivate

Definition at line 138 of file md5.cpp.

◆ FF()

void MD5::FF ( uint4 a,
uint4  b,
uint4  c,
uint4  d,
uint4  x,
uint4  s,
uint4  ac 
)
inlinestaticprivate

Definition at line 158 of file md5.cpp.

◆ finalize()

MD5 & MD5::finalize ( )

Definition at line 362 of file md5.cpp.

◆ G()

MD5::uint4 MD5::G ( uint4  x,
uint4  y,
uint4  z 
)
inlinestaticprivate

Definition at line 143 of file md5.cpp.

◆ GG()

void MD5::GG ( uint4 a,
uint4  b,
uint4  c,
uint4  d,
uint4  x,
uint4  s,
uint4  ac 
)
inlinestaticprivate

Definition at line 164 of file md5.cpp.

References G.

◆ H()

MD5::uint4 MD5::H ( uint4  x,
uint4  y,
uint4  z 
)
inlinestaticprivate

Definition at line 148 of file md5.cpp.

◆ hexdigest()

std::string MD5::hexdigest ( ) const

Definition at line 399 of file md5.cpp.

References mrpt::system::os::sprintf().

Here is the call graph for this function:

◆ HH()

void MD5::HH ( uint4 a,
uint4  b,
uint4  c,
uint4  d,
uint4  x,
uint4  s,
uint4  ac 
)
inlinestaticprivate

Definition at line 170 of file md5.cpp.

◆ I()

MD5::uint4 MD5::I ( uint4  x,
uint4  y,
uint4  z 
)
inlinestaticprivate

Definition at line 149 of file md5.cpp.

◆ II()

void MD5::II ( uint4 a,
uint4  b,
uint4  c,
uint4  d,
uint4  x,
uint4  s,
uint4  ac 
)
inlinestaticprivate

Definition at line 176 of file md5.cpp.

◆ init()

void MD5::init ( )
private

Definition at line 194 of file md5.cpp.

◆ rotate_left()

MD5::uint4 MD5::rotate_left ( uint4  x,
int  n 
)
inlinestaticprivate

Definition at line 151 of file md5.cpp.

◆ transform()

void MD5::transform ( const uint1  block[blocksize])
private

Definition at line 226 of file md5.cpp.

References S11, S12, S13, S14, S21, S22, S23, S24, S31, S32, S33, S34, S41, S42, S43, and S44.

◆ update() [1/2]

void MD5::update ( const unsigned char *  buf,
size_type  length 
)

◆ update() [2/2]

void MD5::update ( const char *  buf,
size_type  length 
)

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
MD5  md5 
)
friend

Definition at line 412 of file md5.cpp.

Member Data Documentation

◆ buffer

uint1 MD5::buffer[blocksize]
private

Definition at line 95 of file md5.cpp.

◆ count

uint4 MD5::count[2] = {0, 0}
private

Definition at line 96 of file md5.cpp.

◆ digest

uint1 MD5::digest[16] {}
private

Definition at line 99 of file md5.cpp.

◆ finalized

bool MD5::finalized {false}
private

Definition at line 93 of file md5.cpp.

◆ state

uint4 MD5::state[4] = {0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476}
private

Definition at line 98 of file md5.cpp.




Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020