1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

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

@ -98,7 +98,7 @@ void mbedtls_md4_clone( mbedtls_md4_context *dst,
/*
* MD4 context setup
*/
int mbedtls_md4_starts_ext( mbedtls_md4_context *ctx )
int mbedtls_md4_starts_ret( mbedtls_md4_context *ctx )
{
ctx->total[0] = 0;
ctx->total[1] = 0;
@ -222,7 +222,7 @@ int mbedtls_internal_md4_process( mbedtls_md4_context *ctx,
/*
* MD4 process buffer
*/
int mbedtls_md4_update_ext( mbedtls_md4_context *ctx,
int mbedtls_md4_update_ret( mbedtls_md4_context *ctx,
const unsigned char *input,
size_t ilen )
{
@ -284,7 +284,7 @@ static const unsigned char md4_padding[64] =
/*
* MD4 final digest
*/
int mbedtls_md4_finish_ext( mbedtls_md4_context *ctx,
int mbedtls_md4_finish_ret( mbedtls_md4_context *ctx,
unsigned char output[16] )
{
int ret;
@ -302,11 +302,11 @@ int mbedtls_md4_finish_ext( mbedtls_md4_context *ctx,
last = ctx->total[0] & 0x3F;
padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
ret = mbedtls_md4_update_ext( ctx, (unsigned char *)md4_padding, padn );
ret = mbedtls_md4_update_ret( ctx, (unsigned char *)md4_padding, padn );
if( ret != 0 )
return( ret );
if( ( ret = mbedtls_md4_update_ext( ctx, msglen, 8 ) ) != 0 )
if( ( ret = mbedtls_md4_update_ret( ctx, msglen, 8 ) ) != 0 )
return( ret );
@ -323,7 +323,7 @@ int mbedtls_md4_finish_ext( mbedtls_md4_context *ctx,
/*
* output = MD4( input buffer )
*/
int mbedtls_md4_ext( const unsigned char *input,
int mbedtls_md4_ret( const unsigned char *input,
size_t ilen,
unsigned char output[16] )
{
@ -332,13 +332,13 @@ int mbedtls_md4_ext( const unsigned char *input,
mbedtls_md4_init( &ctx );
if( ( ret = mbedtls_md4_starts_ext( &ctx ) ) != 0 )
if( ( ret = mbedtls_md4_starts_ret( &ctx ) ) != 0 )
goto exit;
if( ( ret = mbedtls_md4_update_ext( &ctx, input, ilen ) ) != 0 )
if( ( ret = mbedtls_md4_update_ret( &ctx, input, ilen ) ) != 0 )
goto exit;
if( ( ret = mbedtls_md4_finish_ext( &ctx, output ) ) != 0 )
if( ( ret = mbedtls_md4_finish_ret( &ctx, output ) ) != 0 )
goto exit;
exit:
@ -400,7 +400,7 @@ int mbedtls_md4_self_test( int verbose )
if( verbose != 0 )
mbedtls_printf( " MD4 test #%d: ", i + 1 );
ret = mbedtls_md4_ext( md4_test_str[i], md4_test_strlen[i], md4sum );
ret = mbedtls_md4_ret( md4_test_str[i], md4_test_strlen[i], md4sum );
if( ret != 0 )
goto fail;