FireBirdLib - Topfield TMS PVR TAP Programming Library
Md5.c File Reference
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <time.h>
#include <string.h>
#include "libFireBird.h"

Go to the source code of this file.

Data Structures

struct  MD5_CTX
 

Macros

#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)
 
#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
 

Typedefs

typedef unsigned long int UINT4
 

Functions

void MD5Init (MD5_CTX *)
 
void MD5Update (MD5_CTX *, unsigned char *, unsigned int)
 
void MD5Final (MD5_CTX *)
 
bool MD5String (char *inString, byte *Digest)
 
bool MD5File (char *FileName, byte *Digest)
 

Macro Definition Documentation

◆ F

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

Definition at line 115 of file Md5.c.

◆ FF

#define FF (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT((a), (s)); \
(a) += (b); \
}
#define ROTATE_LEFT(x, n)
Definition: Md5.c:121
#define F(x, y, z)
Definition: Md5.c:115
unsigned long int UINT4
Definition: Md5.c:44

Definition at line 125 of file Md5.c.

◆ G

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

Definition at line 116 of file Md5.c.

◆ GG

#define GG (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{(a) += G((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT((a), (s)); \
(a) += (b); \
}
#define G(x, y, z)
Definition: Md5.c:116

Definition at line 130 of file Md5.c.

◆ H

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

Definition at line 117 of file Md5.c.

◆ HH

#define HH (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{(a) += H((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT((a), (s)); \
(a) += (b); \
}
#define H(x, y, z)
Definition: Md5.c:117

Definition at line 135 of file Md5.c.

◆ I

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

Definition at line 118 of file Md5.c.

◆ II

#define II (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{(a) += I((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT((a), (s)); \
(a) += (b); \
}
#define I(x, y, z)
Definition: Md5.c:118

Definition at line 140 of file Md5.c.

◆ ROTATE_LEFT

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

Definition at line 121 of file Md5.c.

◆ S11

#define S11   7

◆ S12

#define S12   12

◆ S13

#define S13   17

◆ S14

#define S14   22

◆ S21

#define S21   5

◆ S22

#define S22   9

◆ S23

#define S23   14

◆ S24

#define S24   20

◆ S31

#define S31   4

◆ S32

#define S32   11

◆ S33

#define S33   16

◆ S34

#define S34   23

◆ S41

#define S41   6

◆ S42

#define S42   10

◆ S43

#define S43   15

◆ S44

#define S44   21

Typedef Documentation

◆ UINT4

typedef unsigned long int UINT4

Definition at line 44 of file Md5.c.

Function Documentation

◆ MD5File()

bool MD5File ( char *  FileName,
byte *  Digest 
)

◆ MD5Final()

void MD5Final ( MD5_CTX mdContext)

Definition at line 190 of file Md5.c.

References MD5_CTX::i, and MD5Update().

Referenced by MD5File(), and MD5String().

◆ MD5Init()

void MD5Init ( MD5_CTX mdContext)

Definition at line 146 of file Md5.c.

References MD5_CTX::buf, and MD5_CTX::i.

Referenced by MD5File(), and MD5String().

◆ MD5String()

bool MD5String ( char *  inString,
byte *  Digest 
)

Definition at line 368 of file Md5.c.

References MD5_CTX::digest, MD5Final(), MD5Init(), MD5Update(), TRACEENTER, and TRACEEXIT.

◆ MD5Update()

void MD5Update ( MD5_CTX mdContext,
unsigned char *  inBuf,
unsigned int  inLen 
)

Definition at line 158 of file Md5.c.

References MD5_CTX::i, and MD5_CTX::in.

Referenced by MD5File(), MD5Final(), and MD5String().