Apache HTTPD
Macros | Functions | Variables
apr_md5.c File Reference
#include "apr_strings.h"
#include "apr_md5.h"
#include "apr_lib.h"
#include "apu_config.h"

Go to the source code of this file.

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 DO_XLATE   0
 
#define SKIP_XLATE   1
 
#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)
 

Functions

static void MD5Transform (apr_uint32_t state[4], const unsigned char block[64])
 
static void Encode (unsigned char *output, const apr_uint32_t *input, unsigned int len)
 
static void Decode (apr_uint32_t *output, const unsigned char *input, unsigned int len)
 
 APU_DECLARE (apr_status_t)
 
static apr_status_t md5_update_buffer (apr_md5_ctx_t *context, const void *vinput, apr_size_t inputLen, int xlate_buffer)
 
static void to64 (char *s, unsigned long v, int n)
 

Variables

static const unsigned char PADDING [64]
 
static const char *const apr1_id = "$apr1$"
 

Macro Definition Documentation

◆ DO_XLATE

#define DO_XLATE   0

Definition at line 105 of file apr_md5.c.

◆ F

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

Definition at line 110 of file apr_md5.c.

◆ FF

#define FF (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{ \
(a) += F ((b), (c), (d)) + (x) + (apr_uint32_t)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define ROTATE_LEFT(x, n)
Definition apr_md5.c:117
#define F(x, y, z)
Definition apr_md5.c:110
apr_size_t const unsigned char unsigned int unsigned int d
Definition apr_siphash.h:72
apr_bucket apr_bucket_brigade * a
apr_size_t size
apr_vformatter_buff_t * c
Definition apr_lib.h:175
apr_pool_t * b
Definition apr_pools.h:529
const char * s
Definition apr_strings.h:95

Definition at line 122 of file apr_md5.c.

◆ G

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

Definition at line 111 of file apr_md5.c.

◆ GG

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

Definition at line 127 of file apr_md5.c.

◆ H

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

Definition at line 112 of file apr_md5.c.

◆ HH

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

Definition at line 132 of file apr_md5.c.

◆ I

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

Definition at line 113 of file apr_md5.c.

◆ II

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

Definition at line 137 of file apr_md5.c.

◆ ROTATE_LEFT

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

Definition at line 117 of file apr_md5.c.

◆ S11

#define S11   7

Definition at line 72 of file apr_md5.c.

◆ S12

#define S12   12

Definition at line 73 of file apr_md5.c.

◆ S13

#define S13   17

Definition at line 74 of file apr_md5.c.

◆ S14

#define S14   22

Definition at line 75 of file apr_md5.c.

◆ S21

#define S21   5

Definition at line 76 of file apr_md5.c.

◆ S22

#define S22   9

Definition at line 77 of file apr_md5.c.

◆ S23

#define S23   14

Definition at line 78 of file apr_md5.c.

◆ S24

#define S24   20

Definition at line 79 of file apr_md5.c.

◆ S31

#define S31   4

Definition at line 80 of file apr_md5.c.

◆ S32

#define S32   11

Definition at line 81 of file apr_md5.c.

◆ S33

#define S33   16

Definition at line 82 of file apr_md5.c.

◆ S34

#define S34   23

Definition at line 83 of file apr_md5.c.

◆ S41

#define S41   6

Definition at line 84 of file apr_md5.c.

◆ S42

#define S42   10

Definition at line 85 of file apr_md5.c.

◆ S43

#define S43   15

Definition at line 86 of file apr_md5.c.

◆ S44

#define S44   21

Definition at line 87 of file apr_md5.c.

◆ SKIP_XLATE

#define SKIP_XLATE   1

Definition at line 106 of file apr_md5.c.

Function Documentation

◆ APU_DECLARE()

APU_DECLARE ( int  )

Most DBM libraries take a POSIX mode for creating files. Don't trust the mode_t type, some platforms may not support it, int is safe.

< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.

Definition at line 145 of file apr_md5.c.

◆ Decode()

static void Decode ( apr_uint32_t output,
const unsigned char input,
unsigned int  len 
)
static

Definition at line 461 of file apr_md5.c.

◆ Encode()

static void Encode ( unsigned char output,
const apr_uint32_t input,
unsigned int  len 
)
static

Definition at line 443 of file apr_md5.c.

◆ md5_update_buffer()

static apr_status_t md5_update_buffer ( apr_md5_ctx_t context,
const void *  vinput,
apr_size_t  inputLen,
int  xlate_buffer 
)
static

Definition at line 190 of file apr_md5.c.

◆ MD5Transform()

static void MD5Transform ( apr_uint32_t  state[4],
const unsigned char  block[64] 
)
static

Definition at line 338 of file apr_md5.c.

◆ to64()

static void to64 ( char s,
unsigned long  v,
int  n 
)
static

Definition at line 493 of file apr_md5.c.

Variable Documentation

◆ apr1_id

const char* const apr1_id = "$apr1$"
static

Definition at line 485 of file apr_md5.c.

◆ PADDING

const unsigned char PADDING[64]
static
Initial value:
=
{
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}

Definition at line 95 of file apr_md5.c.