18 #define HASH_STATE_SIZE sizeof( SHA_CTX )
26 #ifndef CONFIG_NO_SELFTEST
38 { 0xA9, 0x99, 0x3E, 0x36, 0x47, 0x06, 0x81, 0x6A,
39 0xBA, 0x3E, 0x25, 0x71, 0x78, 0x50, 0xC2, 0x6C,
40 0x9C, 0xD0, 0xD8, 0x9D } },
41 {
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", 56,
42 { 0x84, 0x98, 0x3E, 0x44, 0x1C, 0x3B, 0xD2, 0x6E,
43 0xBA, 0xAE, 0x4A, 0xA1, 0xF9, 0x51, 0x29, 0xE5,
44 0xE5, 0x46, 0x70, 0xF1 } },
52 static int selfTest(
void )
59 for( i = 0; digestValues[ i ].data != NULL; i++ )
61 status = testHash( capabilityInfo, hashState, digestValues[ i ].
data,
87 assert( contextInfoPtr == NULL || \
89 assert( ( length == 0 &&
isWritePtr( data,
sizeof(
int ) ) ) || \
90 ( length > 0 &&
isWritePtr( data, length ) ) );
103 return( getDefaultInfo( type, contextInfoPtr, data, length ) );
128 SHA1_Final( contextInfoPtr->ctxHash->hash, shaInfo );
144 outBuffer == NULL && outBufMaxLength == 0 ) || \
147 outBufMaxLength >= 20 ) );
148 assert( inBuffer == NULL ||
isReadPtr( inBuffer, inLength ) );
165 if( inBuffer != NULL )
176 const void *inBuffer,
const int inLength )
180 assert(
isWritePtr( outBuffer, outBufMaxLength ) && \
181 outBufMaxLength >= 20 );
182 assert(
isReadPtr( inBuffer, inLength ) );
184 if( outBufMaxLength < 20 || inLength <= 0 )
202 selfTest, getInfo, NULL, NULL, NULL, NULL, hash, hash
207 return( &capabilityInfo );