Add HMAC support to RIPEMD-160
diff --git a/tests/suites/test_suite_mdx.function b/tests/suites/test_suite_mdx.function
index 5c01056..6f43aac 100644
--- a/tests/suites/test_suite_mdx.function
+++ b/tests/suites/test_suite_mdx.function
@@ -160,6 +160,31 @@
}
/* END_CASE */
+/* BEGIN_CASE depends_on:POLARSSL_RMD160_C */
+void rmd160_hmac( int trunc_size, char *hex_key_string, char *hex_src_string,
+ char *hex_hash_string )
+{
+ unsigned char src_str[200];
+ unsigned char key_str[200];
+ unsigned char hash_str[41];
+ unsigned char output[20];
+ int key_len, src_len;
+
+ memset( src_str, 0x00, sizeof src_str );
+ memset( key_str, 0x00, sizeof key_str );
+ memset( hash_str, 0x00, sizeof hash_str );
+ memset( output, 0x00, sizeof output );
+
+ key_len = unhexify( key_str, hex_key_string );
+ src_len = unhexify( src_str, hex_src_string );
+
+ rmd160_hmac( key_str, key_len, src_str, src_len, output );
+ hexify( hash_str, output, sizeof output );
+
+ TEST_ASSERT( strncmp( (char *) hash_str, hex_hash_string, trunc_size * 2 ) == 0 );
+}
+/* END_CASE */
+
/* BEGIN_CASE depends_on:POLARSSL_MD2_C:POLARSSL_FS_IO */
void md2_file( char *filename, char *hex_hash_string )
{