The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
MD5 Class Reference

#include <md5.hpp>

Public Member Functions

 MD5 ()
 
void update (const uint8_t *input, const uint32_t input_length)
 
void finalize ()
 
std::array< uint8_t, 16 > raw_digest ()
 

Private Types

typedef uint32_t uint4
 
typedef uint16_t uint2
 
typedef uint8_t uint1
 

Private Member Functions

void init ()
 
void transform (const uint1 buffer[64])
 

Static Private Member Functions

static void encode (uint1 *dest, uint4 *src, uint4 length)
 
static void decode (uint4 *dest, const uint1 *src, uint4 length)
 
static uint4 rotate_left (uint4 x, uint4 n)
 
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 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

uint4 state [4]
 
uint4 count [2]
 
uint1 buffer [64]
 
uint1 digest [16]
 
uint1 finalized
 

Detailed Description

Definition at line 48 of file md5.hpp.

Member Typedef Documentation

typedef uint8_t MD5::uint1
private

Definition at line 65 of file md5.hpp.

typedef uint16_t MD5::uint2
private

Definition at line 64 of file md5.hpp.

typedef uint32_t MD5::uint4
private

Definition at line 63 of file md5.hpp.

Constructor & Destructor Documentation

MD5::MD5 ( )

Definition at line 61 of file md5.cpp.

References init().

Member Function Documentation

void MD5::decode ( uint4 dest,
const uint1 src,
uint4  length 
)
staticprivate

Definition at line 327 of file md5.cpp.

References i.

Referenced by transform().

void MD5::encode ( uint1 dest,
uint4 src,
uint4  length 
)
staticprivate

Definition at line 310 of file md5.cpp.

References i.

Referenced by finalize().

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

Definition at line 352 of file md5.cpp.

Referenced by FF().

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

Definition at line 374 of file md5.cpp.

References F(), and rotate_left().

Referenced by transform().

void MD5::finalize ( )

Definition at line 122 of file md5.cpp.

References buffer, digest, encode(), finalized, state, and update().

Referenced by util::md5().

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

Definition at line 356 of file md5.cpp.

Referenced by GG().

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

Definition at line 380 of file md5.cpp.

References G(), and rotate_left().

Referenced by transform().

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

Definition at line 360 of file md5.cpp.

Referenced by HH().

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

Definition at line 386 of file md5.cpp.

References H(), and rotate_left().

Referenced by transform().

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

Definition at line 364 of file md5.cpp.

Referenced by II().

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

Definition at line 392 of file md5.cpp.

References I(), and rotate_left().

Referenced by transform().

void MD5::init ( )
private

Definition at line 175 of file md5.cpp.

References finalized, and state.

Referenced by MD5().

std::array< uint8_t, 16 > MD5::raw_digest ( )

Definition at line 159 of file md5.cpp.

References digest, and finalized.

Referenced by util::md5().

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

Definition at line 343 of file md5.cpp.

Referenced by FF(), GG(), HH(), and II().

void MD5::transform ( const uint1  buffer[64])
private

Definition at line 216 of file md5.cpp.

References c, d, decode(), FF(), finalized, GG(), HH(), II(), S11, S12, S13, S14, S21, S22, S23, S24, S31, S32, S33, S34, S41, S42, S43, S44, and state.

Referenced by update().

void MD5::update ( const uint8_t *  input,
const uint32_t  input_length 
)

Definition at line 75 of file md5.cpp.

References buffer, finalized, and transform().

Referenced by finalize(), and util::md5().

Member Data Documentation

uint1 MD5::buffer[64]
private

Definition at line 70 of file md5.hpp.

Referenced by finalize(), and update().

uint4 MD5::count[2]
private

Definition at line 69 of file md5.hpp.

uint1 MD5::digest[16]
private

Definition at line 71 of file md5.hpp.

Referenced by finalize(), and raw_digest().

uint1 MD5::finalized
private

Definition at line 72 of file md5.hpp.

Referenced by finalize(), init(), raw_digest(), transform(), and update().

uint4 MD5::state[4]
private

Definition at line 68 of file md5.hpp.

Referenced by finalize(), init(), and transform().


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