20 #define HASH_STATE_SIZE sizeof( RIPEMD160_CTX )
28 #ifndef CONFIG_NO_SELFTEST
39 { 0x9C, 0x11, 0x85, 0xA5, 0xC5, 0xE9, 0xFC, 0x54,
40 0x61, 0x28, 0x08, 0x97, 0x7E, 0xE8, 0xF5, 0x48,
41 0xB2, 0x25, 0x8D, 0x31 } },
43 { 0x0B, 0xDC, 0x9D, 0x2D, 0x25, 0x6B, 0x3E, 0xE9,
44 0xDA, 0xAE, 0x34, 0x7B, 0xE6, 0xF4, 0xDC, 0x83,
45 0x5A, 0x46, 0x7F, 0xFE } },
47 { 0x8E, 0xB2, 0x08, 0xF7, 0xE0, 0x5D, 0x98, 0x7A,
48 0x9B, 0x04, 0x4A, 0x8E, 0x98, 0xC6, 0xB0, 0x87,
49 0xF1, 0x5A, 0x0B, 0xFC } },
50 {
"message digest", 14,
51 { 0x5D, 0x06, 0x89, 0xEF, 0x49, 0xD2, 0xFA, 0xE5,
52 0x72, 0xB8, 0x81, 0xB1, 0x23, 0xA8, 0x5F, 0xFA,
53 0x21, 0x59, 0x5F, 0x36 } },
54 {
"abcdefghijklmnopqrstuvwxyz", 26,
55 { 0xF7, 0x1C, 0x27, 0x10, 0x9C, 0x69, 0x2C, 0x1B,
56 0x56, 0xBB, 0xDC, 0xEB, 0x5B, 0x9D, 0x28, 0x65,
57 0xB3, 0x70, 0x8D, 0xBC } },
58 {
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 56,
59 { 0x12, 0xA0, 0x53, 0x38, 0x4A, 0x9C, 0x0C, 0x88,
60 0xE4, 0x05, 0xA0, 0x6C, 0x27, 0xDC, 0xF4, 0x9A,
61 0xDA, 0x62, 0xEB, 0x2B } },
62 {
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", 62,
63 { 0xB0, 0xE2, 0x0B, 0x6E, 0x31, 0x16, 0x64, 0x02,
64 0x86, 0xED, 0x3A, 0x87, 0xA5, 0x71, 0x30, 0x79,
65 0xB2, 0x1F, 0x51, 0x89 } },
66 {
"12345678901234567890123456789012345678901234567890123456789012345678901234567890", 80,
67 { 0x9B, 0x75, 0x2E, 0x45, 0x57, 0x3D, 0x4B, 0x39,
68 0xF4, 0xDB, 0xD3, 0x32, 0x3C, 0xAB, 0x82, 0xBF,
69 0x63, 0x32, 0x6B, 0xFB } },
73 static int selfTest(
void )
80 for( i = 0; digestValues[ i ].data != NULL; i++ )
82 status = testHash( capabilityInfo, hashState, digestValues[ i ].
data,
108 assert( contextInfoPtr == NULL || \
110 assert( ( length == 0 &&
isWritePtr( data,
sizeof(
int ) ) ) || \
111 ( length > 0 &&
isWritePtr( data, length ) ) );
124 return( getDefaultInfo( type, contextInfoPtr, data, length ) );
163 outBuffer == NULL && outBufMaxLength == 0 ) || \
166 outBufMaxLength >= 20 ) );
167 assert( inBuffer == NULL ||
isReadPtr( inBuffer, inLength ) );
184 if( inBuffer != NULL )
194 void ripemd160HashBufferAtomic(
BYTE *outBuffer,
const int outBufMaxLength,
195 const void *inBuffer,
const int inLength )
199 assert(
isWritePtr( outBuffer, outBufMaxLength ) && \
200 outBufMaxLength >= 20 );
201 assert(
isReadPtr( inBuffer, inLength ) );
203 if( outBufMaxLength < 20 || inLength <= 0 )
221 selfTest, getInfo, NULL, NULL, NULL, NULL, hash, hash
226 return( &capabilityInfo );