1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +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

@ -96,7 +96,7 @@ void mbedtls_ripemd160_clone( mbedtls_ripemd160_context *dst,
/*
* RIPEMD-160 context setup
*/
int mbedtls_ripemd160_starts_ext( mbedtls_ripemd160_context *ctx )
int mbedtls_ripemd160_starts_ret( mbedtls_ripemd160_context *ctx )
{
ctx->total[0] = 0;
ctx->total[1] = 0;
@ -298,7 +298,7 @@ int mbedtls_internal_ripemd160_process( mbedtls_ripemd160_context *ctx,
/*
* RIPEMD-160 process buffer
*/
int mbedtls_ripemd160_update_ext( mbedtls_ripemd160_context *ctx,
int mbedtls_ripemd160_update_ret( mbedtls_ripemd160_context *ctx,
const unsigned char *input,
size_t ilen )
{
@ -358,7 +358,7 @@ static const unsigned char ripemd160_padding[64] =
/*
* RIPEMD-160 final digest
*/
int mbedtls_ripemd160_finish_ext( mbedtls_ripemd160_context *ctx,
int mbedtls_ripemd160_finish_ret( mbedtls_ripemd160_context *ctx,
unsigned char output[20] )
{
int ret;
@ -376,11 +376,11 @@ int mbedtls_ripemd160_finish_ext( mbedtls_ripemd160_context *ctx,
last = ctx->total[0] & 0x3F;
padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
ret = mbedtls_ripemd160_update_ext( ctx, ripemd160_padding, padn );
ret = mbedtls_ripemd160_update_ret( ctx, ripemd160_padding, padn );
if( ret != 0 )
return( ret );
ret = mbedtls_ripemd160_update_ext( ctx, msglen, 8 );
ret = mbedtls_ripemd160_update_ret( ctx, msglen, 8 );
if( ret != 0 )
return( ret );
@ -396,7 +396,7 @@ int mbedtls_ripemd160_finish_ext( mbedtls_ripemd160_context *ctx,
/*
* output = RIPEMD-160( input buffer )
*/
int mbedtls_ripemd160_ext( const unsigned char *input,
int mbedtls_ripemd160_ret( const unsigned char *input,
size_t ilen,
unsigned char output[20] )
{
@ -405,13 +405,13 @@ int mbedtls_ripemd160_ext( const unsigned char *input,
mbedtls_ripemd160_init( &ctx );
if( ( ret = mbedtls_ripemd160_starts_ext( &ctx ) ) != 0 )
if( ( ret = mbedtls_ripemd160_starts_ret( &ctx ) ) != 0 )
goto exit;
if( ( ret = mbedtls_ripemd160_update_ext( &ctx, input, ilen ) ) != 0 )
if( ( ret = mbedtls_ripemd160_update_ret( &ctx, input, ilen ) ) != 0 )
goto exit;
if( ( ret = mbedtls_ripemd160_finish_ext( &ctx, output ) ) != 0 )
if( ( ret = mbedtls_ripemd160_finish_ret( &ctx, output ) ) != 0 )
goto exit;
exit:
@ -479,7 +479,7 @@ int mbedtls_ripemd160_self_test( int verbose )
if( verbose != 0 )
mbedtls_printf( " RIPEMD-160 test #%d: ", i + 1 );
ret = mbedtls_ripemd160_ext( ripemd160_test_str[i],
ret = mbedtls_ripemd160_ret( ripemd160_test_str[i],
ripemd160_test_strlen[i], output );
if( ret != 0 )
goto fail;