Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
IccMD5.h File Reference

IccMD5.H - header file for IccMD5.cpp. More...

#include "IccProfLibConf.h"
+ Include dependency graph for IccMD5.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MD5_CTX
 MD5 context. More...
 

Typedefs

typedef unsigned char * POINTER
 POINTER defines a generic pointer type.
 
typedef unsigned short int UINT2
 UINT2 defines a two byte word.
 
typedef uint32_t UINT4
 UINT4 defines a four byte word.
 

Functions

void icMD5Final (unsigned char *, MD5_CTX *)
 MD5 finalization.
 
void icMD5Init (MD5_CTX *)
 MD5 initialization.
 
void icMD5Update (MD5_CTX *, unsigned char *, unsigned int)
 MD5 block update operation.
 

Detailed Description

IccMD5.H - header file for IccMD5.cpp.

Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved.

License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function.

License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work.

RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind.

These notices must be retained in any copies of any part of this documentation and/or software.

Definition in file IccMD5.h.

Typedef Documentation

◆ POINTER

typedef unsigned char* POINTER

POINTER defines a generic pointer type.

Definition at line 42 of file IccMD5.h.

◆ UINT2

typedef unsigned short int UINT2

UINT2 defines a two byte word.

Definition at line 45 of file IccMD5.h.

◆ UINT4

typedef uint32_t UINT4

UINT4 defines a four byte word.

Definition at line 48 of file IccMD5.h.

Function Documentation

◆ icMD5Final()

void icMD5Final ( unsigned char * digest,
MD5_CTX * context )

MD5 finalization.

Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context.

Definition at line 150 of file IccMD5.cpp.

151{
152 unsigned char bits[8];
153 unsigned int index, padLen;
154
155 /* Save number of bits */
156 Encode (bits, context->count, 8);
157
158 /* Pad out to 56 mod 64.
159*/
160 index = (unsigned int)((context->count[0] >> 3) & 0x3f);
161 padLen = (index < 56) ? (56 - index) : (120 - index);
162 icMD5Update (context, PADDING, padLen);
163
164 /* Append length (before padding) */
165 icMD5Update (context, bits, 8);
166
167
168 /* Store state in digest */
169 Encode (digest, context->state, 16);
170
171 /* Zeroize sensitive information.
172*/
173 memset((POINTER)context, 0, sizeof (*context));
174}
static void Encode(unsigned char *, UINT4 *, unsigned int)
Encodes input (UINT4) into output (unsigned char).
Definition IccMD5.cpp:269
static unsigned char PADDING[64]
Definition IccMD5.cpp:56
void icMD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen)
MD5 block update operation.
Definition IccMD5.cpp:114
unsigned char * POINTER
POINTER defines a generic pointer type.
Definition IccMD5.h:42
static const CFAllocatorContext context

References context, Encode(), icMD5Update(), and PADDING.

Referenced by CalcProfileID().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ icMD5Init()

void icMD5Init ( MD5_CTX * context)

MD5 initialization.

Begins an MD5 operation, writing a new context.

Definition at line 99 of file IccMD5.cpp.

100{
101 context->count[0] = context->count[1] = 0;
102 /* Load magic initialization constants.
103*/
104 context->state[0] = 0x67452301;
105 context->state[1] = 0xefcdab89;
106 context->state[2] = 0x98badcfe;
107 context->state[3] = 0x10325476;
108}

References context.

Referenced by CalcProfileID().

+ Here is the caller graph for this function:

◆ icMD5Update()

void icMD5Update ( MD5_CTX * context,
unsigned char * input,
unsigned int inputLen )

MD5 block update operation.

Continues an MD5 message-digest operation, processing another message block, and updating the context.

Definition at line 114 of file IccMD5.cpp.

115{
116 unsigned int i, index, partLen;
117
118 /* Compute number of bytes mod 64 */
119 index = (unsigned int)((context->count[0] >> 3) & 0x3F);
120
121 /* Update number of bits */
122 if ((context->count[0] += ((UINT4)inputLen << 3))
123 < ((UINT4)inputLen << 3))
124 context->count[1]++;
125 context->count[1] += ((UINT4)inputLen >> 29);
126
127 partLen = 64 - index;
128
129 /* Transform as many times as possible.
130 */
131 if (inputLen >= partLen) {
132 memcpy((POINTER)&context->buffer[index], (POINTER)input, partLen);
133 MD5Transform (context->state, context->buffer);
134
135 for (i = partLen; i + 63 < inputLen; i += 64)
136 MD5Transform (context->state, &input[i]);
137
138 index = 0;
139 }
140 else
141 i = 0;
142
143 /* Buffer remaining input */
144 memcpy((POINTER)&context->buffer[index], (POINTER)&input[i],inputLen-i);
145}
static void MD5Transform(UINT4[4], unsigned char[64])
MD5 basic transformation.
Definition IccMD5.cpp:178
uint32_t UINT4
UINT4 defines a four byte word.
Definition IccMD5.h:48

References context, and MD5Transform().

Referenced by CalcProfileID(), and icMD5Final().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: