blocxx
Namespaces | Macros | Typedefs | Functions | Variables
MD5.cpp File Reference
#include "blocxx/BLOCXX_config.h"
#include "blocxx/MD5.hpp"
#include "blocxx/String.hpp"
#include "blocxx/ExceptionIds.hpp"
#include <string.h>

Go to the source code of this file.

Namespaces

 BLOCXX_NAMESPACE
 Taken from RFC 1321.
 

Macros

#define S11   7
 
#define S12   12
 
#define S13   17
 
#define S14   22
 
#define S21   5
 
#define S22   9
 
#define S23   14
 
#define S24   20
 
#define S31   4
 
#define S32   11
 
#define S33   16
 
#define S34   23
 
#define S41   6
 
#define S42   10
 
#define S43   15
 
#define S44   21
 
#define F(x, y, z)   (((x) & (y)) | ((~x) & (z)))
 
#define G(x, y, z)   (((x) & (z)) | ((y) & (~z)))
 
#define H(x, y, z)   ((x) ^ (y) ^ (z))
 
#define I(x, y, z)   ((y) ^ ((x) | (~z)))
 
#define ROTATE_LEFT(x, n)   (((x) << (n)) | ((x) >> (32-(n))))
 
#define FF(a, b, c, d, x, s, ac)
 
#define GG(a, b, c, d, x, s, ac)
 
#define HH(a, b, c, d, x, s, ac)
 
#define II(a, b, c, d, x, s, ac)
 

Typedefs

typedef unsigned char * BLOCXX_NAMESPACE::POINTER
 

Functions

static void BLOCXX_NAMESPACE::MD5Transform (UInt32 *, const unsigned char *)
 
static void BLOCXX_NAMESPACE::Encode (unsigned char *, UInt32 *, UInt32)
 
static void BLOCXX_NAMESPACE::Decode (UInt32 *, const unsigned char *, UInt32)
 

Variables

const int BLOCXX_NAMESPACE::MD5HASHHEXLEN = 32
 
static unsigned char BLOCXX_NAMESPACE::PADDING [64]
 

Macro Definition Documentation

◆ F

#define F (   x,
  y,
 
)    (((x) & (y)) | ((~x) & (z)))

Definition at line 240 of file MD5.cpp.

◆ FF

#define FF (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{ \
(a) += F ((b), (c), (d)) + (x) + static_cast<UInt32>(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}

Definition at line 250 of file MD5.cpp.

◆ G

#define G (   x,
  y,
 
)    (((x) & (z)) | ((y) & (~z)))

Definition at line 241 of file MD5.cpp.

◆ GG

#define GG (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{ \
(a) += G ((b), (c), (d)) + (x) + static_cast<UInt32>(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}

Definition at line 255 of file MD5.cpp.

◆ H

#define H (   x,
  y,
 
)    ((x) ^ (y) ^ (z))

Definition at line 242 of file MD5.cpp.

◆ HH

#define HH (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{ \
(a) += H ((b), (c), (d)) + (x) + static_cast<UInt32>(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}

Definition at line 260 of file MD5.cpp.

◆ I

#define I (   x,
  y,
 
)    ((y) ^ ((x) | (~z)))

Definition at line 243 of file MD5.cpp.

◆ II

#define II (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{ \
(a) += I ((b), (c), (d)) + (x) + static_cast<UInt32>(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}

Definition at line 265 of file MD5.cpp.

◆ ROTATE_LEFT

#define ROTATE_LEFT (   x,
 
)    (((x) << (n)) | ((x) >> (32-(n))))

Definition at line 246 of file MD5.cpp.

◆ S11

#define S11   7

Definition at line 212 of file MD5.cpp.

◆ S12

#define S12   12

Definition at line 213 of file MD5.cpp.

◆ S13

#define S13   17

Definition at line 214 of file MD5.cpp.

◆ S14

#define S14   22

Definition at line 215 of file MD5.cpp.

◆ S21

#define S21   5

Definition at line 216 of file MD5.cpp.

◆ S22

#define S22   9

Definition at line 217 of file MD5.cpp.

◆ S23

#define S23   14

Definition at line 218 of file MD5.cpp.

◆ S24

#define S24   20

Definition at line 219 of file MD5.cpp.

◆ S31

#define S31   4

Definition at line 220 of file MD5.cpp.

◆ S32

#define S32   11

Definition at line 221 of file MD5.cpp.

◆ S33

#define S33   16

Definition at line 222 of file MD5.cpp.

◆ S34

#define S34   23

Definition at line 223 of file MD5.cpp.

◆ S41

#define S41   6

Definition at line 224 of file MD5.cpp.

◆ S42

#define S42   10

Definition at line 225 of file MD5.cpp.

◆ S43

#define S43   15

Definition at line 226 of file MD5.cpp.

◆ S44

#define S44   21

Definition at line 227 of file MD5.cpp.

G
#define G(x, y, z)
Definition: MD5.cpp:240
ROTATE_LEFT
#define ROTATE_LEFT(x, n)
Definition: MD5.cpp:245
I
#define I(x, y, z)
Definition: MD5.cpp:242
F
#define F(x, y, z)
Definition: MD5.cpp:239
H
#define H(x, y, z)
Definition: MD5.cpp:241