mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-08-09 12:31:16 +00:00
Rename cipher_init_ctx() to cipher_setup()
This commit is contained in:
parent
51f14be888
commit
3f06d377d6
|
@ -320,7 +320,7 @@ void mbedtls_cipher_free( mbedtls_cipher_context_t *ctx );
|
|||
* MBEDTLS_ERR_CIPHER_ALLOC_FAILED if allocation of the
|
||||
* cipher-specific context failed.
|
||||
*/
|
||||
int mbedtls_cipher_init_ctx( mbedtls_cipher_context_t *ctx, const mbedtls_cipher_info_t *cipher_info );
|
||||
int mbedtls_cipher_setup( mbedtls_cipher_context_t *ctx, const mbedtls_cipher_info_t *cipher_info );
|
||||
|
||||
/**
|
||||
* \brief Returns the block size of the given cipher.
|
||||
|
|
|
@ -1871,7 +1871,7 @@
|
|||
#define cipher_info_from_values mbedtls_cipher_info_from_values
|
||||
#define cipher_info_t mbedtls_cipher_info_t
|
||||
#define cipher_init mbedtls_cipher_init
|
||||
#define cipher_init_ctx mbedtls_cipher_init_ctx
|
||||
#define cipher_init_ctx mbedtls_cipher_setup
|
||||
#define cipher_list mbedtls_cipher_list
|
||||
#define cipher_mode_t mbedtls_cipher_mode_t
|
||||
#define cipher_padding_t mbedtls_cipher_padding_t
|
||||
|
|
|
@ -81,7 +81,7 @@ int mbedtls_ccm_setkey( mbedtls_ccm_context *ctx,
|
|||
if( cipher_info->block_size != 16 )
|
||||
return( MBEDTLS_ERR_CCM_BAD_INPUT );
|
||||
|
||||
if( ( ret = mbedtls_cipher_init_ctx( &ctx->cipher_ctx, cipher_info ) ) != 0 )
|
||||
if( ( ret = mbedtls_cipher_setup( &ctx->cipher_ctx, cipher_info ) ) != 0 )
|
||||
return( ret );
|
||||
|
||||
if( ( ret = mbedtls_cipher_setkey( &ctx->cipher_ctx, key, keysize,
|
||||
|
|
|
@ -139,7 +139,7 @@ void mbedtls_cipher_free( mbedtls_cipher_context_t *ctx )
|
|||
mbedtls_zeroize( ctx, sizeof(mbedtls_cipher_context_t) );
|
||||
}
|
||||
|
||||
int mbedtls_cipher_init_ctx( mbedtls_cipher_context_t *ctx, const mbedtls_cipher_info_t *cipher_info )
|
||||
int mbedtls_cipher_setup( mbedtls_cipher_context_t *ctx, const mbedtls_cipher_info_t *cipher_info )
|
||||
{
|
||||
if( NULL == cipher_info || NULL == ctx )
|
||||
return( MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA );
|
||||
|
|
|
@ -174,7 +174,7 @@ int mbedtls_gcm_setkey( mbedtls_gcm_context *ctx,
|
|||
if( cipher_info->block_size != 16 )
|
||||
return( MBEDTLS_ERR_GCM_BAD_INPUT );
|
||||
|
||||
if( ( ret = mbedtls_cipher_init_ctx( &ctx->cipher_ctx, cipher_info ) ) != 0 )
|
||||
if( ( ret = mbedtls_cipher_setup( &ctx->cipher_ctx, cipher_info ) ) != 0 )
|
||||
return( ret );
|
||||
|
||||
if( ( ret = mbedtls_cipher_setkey( &ctx->cipher_ctx, key, keysize,
|
||||
|
|
|
@ -195,7 +195,7 @@ int mbedtls_pkcs12_pbe( mbedtls_asn1_buf *pbe_params, int mode,
|
|||
|
||||
mbedtls_cipher_init( &cipher_ctx );
|
||||
|
||||
if( ( ret = mbedtls_cipher_init_ctx( &cipher_ctx, cipher_info ) ) != 0 )
|
||||
if( ( ret = mbedtls_cipher_setup( &cipher_ctx, cipher_info ) ) != 0 )
|
||||
goto exit;
|
||||
|
||||
if( ( ret = mbedtls_cipher_setkey( &cipher_ctx, key, 8 * keylen, (mbedtls_operation_t) mode ) ) != 0 )
|
||||
|
|
|
@ -198,7 +198,7 @@ int mbedtls_pkcs5_pbes2( const mbedtls_asn1_buf *pbe_params, int mode,
|
|||
goto exit;
|
||||
}
|
||||
|
||||
if( ( ret = mbedtls_cipher_init_ctx( &cipher_ctx, cipher_info ) ) != 0 )
|
||||
if( ( ret = mbedtls_cipher_setup( &cipher_ctx, cipher_info ) ) != 0 )
|
||||
goto exit;
|
||||
|
||||
if( ( ret = mbedtls_cipher_setkey( &cipher_ctx, key, 8 * keylen, (mbedtls_operation_t) mode ) ) != 0 )
|
||||
|
|
|
@ -867,17 +867,17 @@ int mbedtls_ssl_derive_keys( mbedtls_ssl_context *ssl )
|
|||
}
|
||||
#endif /* MBEDTLS_SSL_HW_RECORD_ACCEL */
|
||||
|
||||
if( ( ret = mbedtls_cipher_init_ctx( &transform->cipher_ctx_enc,
|
||||
if( ( ret = mbedtls_cipher_setup( &transform->cipher_ctx_enc,
|
||||
cipher_info ) ) != 0 )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_cipher_init_ctx", ret );
|
||||
MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_cipher_setup", ret );
|
||||
return( ret );
|
||||
}
|
||||
|
||||
if( ( ret = mbedtls_cipher_init_ctx( &transform->cipher_ctx_dec,
|
||||
if( ( ret = mbedtls_cipher_setup( &transform->cipher_ctx_dec,
|
||||
cipher_info ) ) != 0 )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_cipher_init_ctx", ret );
|
||||
MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_cipher_setup", ret );
|
||||
return( ret );
|
||||
}
|
||||
|
||||
|
|
|
@ -173,9 +173,9 @@ int main( int argc, char *argv[] )
|
|||
mbedtls_fprintf( stderr, "Cipher '%s' not found\n", argv[4] );
|
||||
goto exit;
|
||||
}
|
||||
if( ( ret = mbedtls_cipher_init_ctx( &cipher_ctx, cipher_info) ) != 0 )
|
||||
if( ( ret = mbedtls_cipher_setup( &cipher_ctx, cipher_info) ) != 0 )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "mbedtls_cipher_init_ctx failed\n" );
|
||||
mbedtls_fprintf( stderr, "mbedtls_cipher_setup failed\n" );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -1400,7 +1400,7 @@ cipher_info_from_type mbedtls_cipher_info_from_type
|
|||
cipher_info_from_values mbedtls_cipher_info_from_values
|
||||
cipher_info_t mbedtls_cipher_info_t
|
||||
cipher_init mbedtls_cipher_init
|
||||
cipher_init_ctx mbedtls_cipher_init_ctx
|
||||
cipher_init_ctx mbedtls_cipher_setup
|
||||
cipher_list mbedtls_cipher_list
|
||||
cipher_mode_t mbedtls_cipher_mode_t
|
||||
cipher_padding_t mbedtls_cipher_padding_t
|
||||
|
|
Loading…
Reference in a new issue