Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::MD5Util Class Reference

MD5 Algorithm Class. More...

#include <MD5Util.h>

Public Types

using OutputStream = sese::io::OutputStream
 
using InputStream = sese::io::InputStream
 

Static Public Member Functions

static void encode (const InputStream::Ptr &input, const OutputStream::Ptr &output) noexcept
 Generate MD5 information.
 
static void encode (InputStream *input, OutputStream *output) noexcept
 Generate MD5 information.
 
static std::unique_ptr< char[]> encode (const InputStream::Ptr &input, bool is_cap=true) noexcept
 Generate a 32-bit uppercase MD5 string.
 
static std::unique_ptr< char[]> encode (InputStream *input, bool is_cap=true) noexcept
 Generate a 32-bit uppercase MD5 string.
 

Static Private Member Functions

static void transform (uint32_t *res, uint8_t *buffer) noexcept
 
static uint32_t F (uint32_t x, uint32_t y, uint32_t z) noexcept
 
static uint32_t G (uint32_t x, uint32_t y, uint32_t z) noexcept
 
static uint32_t H (uint32_t x, uint32_t y, uint32_t z) noexcept
 
static uint32_t I (uint32_t x, uint32_t y, uint32_t z) noexcept
 
static uint32_t FF (uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint32_t s, uint32_t t) noexcept
 
static uint32_t GG (uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint32_t s, uint32_t t) noexcept
 
static uint32_t HH (uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint32_t s, uint32_t t) noexcept
 
static uint32_t II (uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint32_t s, uint32_t t) noexcept
 

Static Private Attributes

static const uint32_t A = 0x67452301
 
static const uint32_t B = 0xefcdab89
 
static const uint32_t C = 0x98badcfe
 
static const uint32_t D = 0x10325476
 
static const uint32_t S11 = 7
 
static const uint32_t S12 = 12
 
static const uint32_t S13 = 17
 
static const uint32_t S14 = 22
 
static const uint32_t S21 = 5
 
static const uint32_t S22 = 9
 
static const uint32_t S23 = 14
 
static const uint32_t S24 = 20
 
static const uint32_t S31 = 4
 
static const uint32_t S32 = 11
 
static const uint32_t S33 = 16
 
static const uint32_t S34 = 23
 
static const uint32_t S41 = 6
 
static const uint32_t S42 = 10
 
static const uint32_t S43 = 15
 
static const uint32_t S44 = 21
 
static constexpr const unsigned char PADDING [64] = {0x80}
 

Detailed Description

MD5 Algorithm Class.

Member Typedef Documentation

◆ InputStream

◆ OutputStream

Member Function Documentation

◆ encode() [1/4]

std::unique_ptr< char[]> MD5Util::encode ( const InputStream::Ptr & input,
bool is_cap = true )
staticnoexcept

Generate a 32-bit uppercase MD5 string.

Parameters
inputSource of digest
is_capIndicates whether the string letters are uppercase
Returns
Returns the generated string, or nullptr if generation fails

References encode().

◆ encode() [2/4]

void MD5Util::encode ( const InputStream::Ptr & input,
const OutputStream::Ptr & output )
staticnoexcept

Generate MD5 information.

Parameters
inputSource of digest
outputMD5 data output

References encode().

Referenced by sese::MessageDigest::digest(), and sese::MessageDigest::digest().

◆ encode() [3/4]

std::unique_ptr< char[]> MD5Util::encode ( InputStream * input,
bool is_cap = true )
staticnoexcept

Generate a 32-bit uppercase MD5 string.

Parameters
inputSource of digest
is_capIndicates whether the string letters are uppercase
Returns
Returns the generated string, or nullptr if generation fails

References encode(), sese::io::AbstractByteBuffer::read(), and sese::MemoryViewer::toChar().

◆ encode() [4/4]

void MD5Util::encode ( InputStream * input,
OutputStream * output )
staticnoexcept

Generate MD5 information.

Parameters
inputSource of digest
outputMD5 data output

The unit is bits

The execution will not be performed after the current execution is completed

The unit is bits

The unit is bits

References ToLittleEndian64(), and transform().

◆ F()

uint32_t MD5Util::F ( uint32_t x,
uint32_t y,
uint32_t z )
inlinestaticprivatenoexcept

◆ FF()

uint32_t MD5Util::FF ( uint32_t a,
uint32_t b,
uint32_t c,
uint32_t d,
uint32_t x,
uint32_t s,
uint32_t t )
inlinestaticprivatenoexcept

References a, b, c, d, and LeftRotate.

◆ G()

uint32_t MD5Util::G ( uint32_t x,
uint32_t y,
uint32_t z )
inlinestaticprivatenoexcept

◆ GG()

uint32_t MD5Util::GG ( uint32_t a,
uint32_t b,
uint32_t c,
uint32_t d,
uint32_t x,
uint32_t s,
uint32_t t )
inlinestaticprivatenoexcept

References a, b, c, d, and LeftRotate.

◆ H()

uint32_t MD5Util::H ( uint32_t x,
uint32_t y,
uint32_t z )
inlinestaticprivatenoexcept

◆ HH()

uint32_t MD5Util::HH ( uint32_t a,
uint32_t b,
uint32_t c,
uint32_t d,
uint32_t x,
uint32_t s,
uint32_t t )
inlinestaticprivatenoexcept

References a, b, c, d, and LeftRotate.

◆ I()

uint32_t MD5Util::I ( uint32_t x,
uint32_t y,
uint32_t z )
inlinestaticprivatenoexcept

◆ II()

uint32_t MD5Util::II ( uint32_t a,
uint32_t b,
uint32_t c,
uint32_t d,
uint32_t x,
uint32_t s,
uint32_t t )
inlinestaticprivatenoexcept

References a, b, c, d, and LeftRotate.

◆ transform()

void MD5Util::transform ( uint32_t * res,
uint8_t * buffer )
staticprivatenoexcept

References a, b, c, and d.

Referenced by encode().

Member Data Documentation

◆ A

const uint32_t sese::MD5Util::A = 0x67452301
staticprivate

◆ B

const uint32_t sese::MD5Util::B = 0xefcdab89
staticprivate

◆ C

const uint32_t sese::MD5Util::C = 0x98badcfe
staticprivate

◆ D

const uint32_t sese::MD5Util::D = 0x10325476
staticprivate

◆ PADDING

const unsigned char sese::MD5Util::PADDING[64] = {0x80}
staticconstexprprivate

◆ S11

const uint32_t sese::MD5Util::S11 = 7
staticprivate

◆ S12

const uint32_t sese::MD5Util::S12 = 12
staticprivate

◆ S13

const uint32_t sese::MD5Util::S13 = 17
staticprivate

◆ S14

const uint32_t sese::MD5Util::S14 = 22
staticprivate

◆ S21

const uint32_t sese::MD5Util::S21 = 5
staticprivate

◆ S22

const uint32_t sese::MD5Util::S22 = 9
staticprivate

◆ S23

const uint32_t sese::MD5Util::S23 = 14
staticprivate

◆ S24

const uint32_t sese::MD5Util::S24 = 20
staticprivate

◆ S31

const uint32_t sese::MD5Util::S31 = 4
staticprivate

◆ S32

const uint32_t sese::MD5Util::S32 = 11
staticprivate

◆ S33

const uint32_t sese::MD5Util::S33 = 16
staticprivate

◆ S34

const uint32_t sese::MD5Util::S34 = 23
staticprivate

◆ S41

const uint32_t sese::MD5Util::S41 = 6
staticprivate

◆ S42

const uint32_t sese::MD5Util::S42 = 10
staticprivate

◆ S43

const uint32_t sese::MD5Util::S43 = 15
staticprivate

◆ S44

const uint32_t sese::MD5Util::S44 = 21
staticprivate

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