New MD API: rename functions from _ext to _ret

The _ext suffix suggests "new arguments", but the new functions have
the same arguments. Use _ret instead, to convey that the difference is
that the new functions return a value.
This commit is contained in:
Gilles Peskine 2018-01-22 11:48:08 +01:00
parent 15932e0cbf
commit 9e4f77c606
27 changed files with 326 additions and 326 deletions

View file

@ -19,7 +19,7 @@ void md2_text( char *text_src_string, char *hex_hash_string )
strncpy( (char *) src_str, text_src_string, sizeof(src_str) - 1 );
ret = mbedtls_md2_ext( src_str, strlen( (char *) src_str ), output );
ret = mbedtls_md2_ret( src_str, strlen( (char *) src_str ), output );
TEST_ASSERT( ret == 0 ) ;
hexify( hash_str, output, sizeof output );
@ -41,7 +41,7 @@ void md4_text( char *text_src_string, char *hex_hash_string )
strncpy( (char *) src_str, text_src_string, sizeof(src_str) - 1 );
ret = mbedtls_md4_ext( src_str, strlen( (char *) src_str ), output );
ret = mbedtls_md4_ret( src_str, strlen( (char *) src_str ), output );
TEST_ASSERT( ret == 0 );
hexify( hash_str, output, sizeof output );
@ -63,7 +63,7 @@ void md5_text( char *text_src_string, char *hex_hash_string )
strncpy( (char *) src_str, text_src_string, sizeof(src_str) - 1 );
ret = mbedtls_md5_ext( src_str, strlen( (char *) src_str ), output );
ret = mbedtls_md5_ret( src_str, strlen( (char *) src_str ), output );
TEST_ASSERT( ret == 0 );
hexify( hash_str, output, sizeof output );
@ -85,7 +85,7 @@ void ripemd160_text( char *text_src_string, char *hex_hash_string )
strncpy( (char *) src_str, text_src_string, sizeof(src_str) - 1 );
ret = mbedtls_ripemd160_ext( src_str, strlen( (char *) src_str ), output );
ret = mbedtls_ripemd160_ret( src_str, strlen( (char *) src_str ), output );
TEST_ASSERT( ret == 0 );
hexify( hash_str, output, sizeof output );

View file

@ -18,7 +18,7 @@ void mbedtls_sha1( char *hex_src_string, char *hex_hash_string )
src_len = unhexify( src_str, hex_src_string );
TEST_ASSERT( mbedtls_sha1_ext( src_str, src_len, output ) == 0 );
TEST_ASSERT( mbedtls_sha1_ret( src_str, src_len, output ) == 0 );
hexify( hash_str, output, 20 );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
@ -39,7 +39,7 @@ void sha224(char *hex_src_string, char *hex_hash_string )
src_len = unhexify( src_str, hex_src_string );
TEST_ASSERT( mbedtls_sha256_ext( src_str, src_len, output, 1 ) == 0 );
TEST_ASSERT( mbedtls_sha256_ret( src_str, src_len, output, 1 ) == 0 );
hexify( hash_str, output, 28 );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
@ -60,7 +60,7 @@ void mbedtls_sha256(char *hex_src_string, char *hex_hash_string )
src_len = unhexify( src_str, hex_src_string );
TEST_ASSERT( mbedtls_sha256_ext( src_str, src_len, output, 0 ) == 0 );
TEST_ASSERT( mbedtls_sha256_ret( src_str, src_len, output, 0 ) == 0 );
hexify( hash_str, output, 32 );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
@ -81,7 +81,7 @@ void sha384(char *hex_src_string, char *hex_hash_string )
src_len = unhexify( src_str, hex_src_string );
TEST_ASSERT( mbedtls_sha512_ext( src_str, src_len, output, 1 ) == 0 );
TEST_ASSERT( mbedtls_sha512_ret( src_str, src_len, output, 1 ) == 0 );
hexify( hash_str, output, 48 );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
@ -102,7 +102,7 @@ void mbedtls_sha512(char *hex_src_string, char *hex_hash_string )
src_len = unhexify( src_str, hex_src_string );
TEST_ASSERT( mbedtls_sha512_ext( src_str, src_len, output, 0 ) == 0 );
TEST_ASSERT( mbedtls_sha512_ret( src_str, src_len, output, 0 ) == 0 );
hexify( hash_str, output, 64 );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );