20 #define HASH_STATE_SIZE sizeof( MD5_CTX )
28 #ifndef CONFIG_NO_SELFTEST
38 { 0xD4, 0x1D, 0x8C, 0xD9, 0x8F, 0x00, 0xB2, 0x04,
39 0xE9, 0x80, 0x09, 0x98, 0xEC, 0xF8, 0x42, 0x7E } },
41 { 0x0C, 0xC1, 0x75, 0xB9, 0xC0, 0xF1, 0xB6, 0xA8,
42 0x31, 0xC3, 0x99, 0xE2, 0x69, 0x77, 0x26, 0x61 } },
44 { 0x90, 0x01, 0x50, 0x98, 0x3C, 0xD2, 0x4F, 0xB0,
45 0xD6, 0x96, 0x3F, 0x7D, 0x28, 0xE1, 0x7F, 0x72 } },
46 {
"message digest", 14,
47 { 0xF9, 0x6B, 0x69, 0x7D, 0x7C, 0xB7, 0x93, 0x8D,
48 0x52, 0x5A, 0x2F, 0x31, 0xAA, 0xF1, 0x61, 0xD0 } },
49 {
"abcdefghijklmnopqrstuvwxyz", 26,
50 { 0xC3, 0xFC, 0xD3, 0xD7, 0x61, 0x92, 0xE4, 0x00,
51 0x7D, 0xFB, 0x49, 0x6C, 0xCA, 0x67, 0xE1, 0x3B } },
52 {
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", 62,
53 { 0xD1, 0x74, 0xAB, 0x98, 0xD2, 0x77, 0xD9, 0xF5,
54 0xA5, 0x61, 0x1C, 0x2C, 0x9F, 0x41, 0x9D, 0x9F } },
55 {
"12345678901234567890123456789012345678901234567890123456789012345678901234567890", 80,
56 { 0x57, 0xED, 0xF4, 0xA2, 0x2B, 0xE3, 0xC9, 0x55,
57 0xAC, 0x49, 0xDA, 0x2E, 0x21, 0x07, 0xB6, 0x7A } },
61 static int selfTest(
void )
68 for( i = 0; digestValues[ i ].data != NULL; i++ )
70 status = testHash( capabilityInfo, hashState, digestValues[ i ].
data,
96 assert( contextInfoPtr == NULL || \
98 assert( ( length == 0 &&
isWritePtr( data,
sizeof(
int ) ) ) || \
99 ( length > 0 &&
isWritePtr( data, length ) ) );
112 return( getDefaultInfo( type, contextInfoPtr, data, length ) );
138 MD5_Final( contextInfoPtr->ctxHash->hash, md5Info );
155 outBuffer == NULL && outBufMaxLength == 0 ) || \
158 outBufMaxLength >= 16 ) );
159 assert( inBuffer == NULL ||
isReadPtr( inBuffer, inLength ) );
176 if( inBuffer != NULL )
186 void md5HashBufferAtomic(
BYTE *outBuffer,
const int outBufMaxLength,
187 const void *inBuffer,
const int inLength )
191 assert(
isWritePtr( outBuffer, outBufMaxLength ) && \
192 outBufMaxLength >= 16 );
193 assert(
isReadPtr( inBuffer, inLength ) );
195 if( outBufMaxLength < 16 || inLength <= 0 )
213 selfTest, getInfo, NULL, NULL, NULL, NULL, hash, hash
218 return( &capabilityInfo );