mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 03:05:44 +01:00
Rename ecp_curve_info.size to bit_size
This commit is contained in:
parent
898e0aa210
commit
797f48ace6
@ -22,7 +22,9 @@ API Changes
|
|||||||
Migration helpers scripts/rename.pl and include/mbedlts/compat-1.3.h are
|
Migration helpers scripts/rename.pl and include/mbedlts/compat-1.3.h are
|
||||||
provided. Full list of renamings in scripts/data_files/rename-1.3-2.0.txt
|
provided. Full list of renamings in scripts/data_files/rename-1.3-2.0.txt
|
||||||
* Renamings of fields inside structures, not covered by the previous list:
|
* Renamings of fields inside structures, not covered by the previous list:
|
||||||
cipher_info.key_length -> key_bitlen
|
mbedtls_cipher_info_t.key_length -> key_bitlen
|
||||||
|
mbedtls_cipher_context_t.key_length -> key_bitlen
|
||||||
|
mbedtls_ecp_curve_info.size -> bit_size
|
||||||
* Headers are now found in the 'mbedtls' directory (previously 'polarssl').
|
* Headers are now found in the 'mbedtls' directory (previously 'polarssl').
|
||||||
* The following _init() functions that could return errors have
|
* The following _init() functions that could return errors have
|
||||||
been split into an _init() that returns void and another function that
|
been split into an _init() that returns void and another function that
|
||||||
|
@ -85,7 +85,7 @@ typedef struct
|
|||||||
{
|
{
|
||||||
mbedtls_ecp_group_id grp_id; /*!< Internal identifier */
|
mbedtls_ecp_group_id grp_id; /*!< Internal identifier */
|
||||||
uint16_t tls_id; /*!< TLS NamedCurve identifier */
|
uint16_t tls_id; /*!< TLS NamedCurve identifier */
|
||||||
uint16_t size; /*!< Curve size in bits */
|
uint16_t bit_size; /*!< Curve size in bits */
|
||||||
const char *name; /*!< Human-friendly name */
|
const char *name; /*!< Human-friendly name */
|
||||||
} mbedtls_ecp_curve_info;
|
} mbedtls_ecp_curve_info;
|
||||||
|
|
||||||
|
@ -681,7 +681,7 @@ int main( int argc, char *argv[] )
|
|||||||
mbedtls_snprintf( title, sizeof( title ), "ECDSA-%s",
|
mbedtls_snprintf( title, sizeof( title ), "ECDSA-%s",
|
||||||
curve_info->name );
|
curve_info->name );
|
||||||
TIME_PUBLIC( title, "sign",
|
TIME_PUBLIC( title, "sign",
|
||||||
ret = mbedtls_ecdsa_write_signature( &ecdsa, MBEDTLS_MD_SHA256, buf, curve_info->size,
|
ret = mbedtls_ecdsa_write_signature( &ecdsa, MBEDTLS_MD_SHA256, buf, curve_info->bit_size,
|
||||||
tmp, &sig_len, myrand, NULL ) );
|
tmp, &sig_len, myrand, NULL ) );
|
||||||
|
|
||||||
mbedtls_ecdsa_free( &ecdsa );
|
mbedtls_ecdsa_free( &ecdsa );
|
||||||
@ -694,7 +694,7 @@ int main( int argc, char *argv[] )
|
|||||||
mbedtls_ecdsa_init( &ecdsa );
|
mbedtls_ecdsa_init( &ecdsa );
|
||||||
|
|
||||||
if( mbedtls_ecdsa_genkey( &ecdsa, curve_info->grp_id, myrand, NULL ) != 0 ||
|
if( mbedtls_ecdsa_genkey( &ecdsa, curve_info->grp_id, myrand, NULL ) != 0 ||
|
||||||
mbedtls_ecdsa_write_signature( &ecdsa, MBEDTLS_MD_SHA256, buf, curve_info->size,
|
mbedtls_ecdsa_write_signature( &ecdsa, MBEDTLS_MD_SHA256, buf, curve_info->bit_size,
|
||||||
tmp, &sig_len, myrand, NULL ) != 0 )
|
tmp, &sig_len, myrand, NULL ) != 0 )
|
||||||
{
|
{
|
||||||
mbedtls_exit( 1 );
|
mbedtls_exit( 1 );
|
||||||
@ -704,7 +704,7 @@ int main( int argc, char *argv[] )
|
|||||||
mbedtls_snprintf( title, sizeof( title ), "ECDSA-%s",
|
mbedtls_snprintf( title, sizeof( title ), "ECDSA-%s",
|
||||||
curve_info->name );
|
curve_info->name );
|
||||||
TIME_PUBLIC( title, "verify",
|
TIME_PUBLIC( title, "verify",
|
||||||
ret = mbedtls_ecdsa_read_signature( &ecdsa, buf, curve_info->size,
|
ret = mbedtls_ecdsa_read_signature( &ecdsa, buf, curve_info->bit_size,
|
||||||
tmp, sig_len ) );
|
tmp, sig_len ) );
|
||||||
|
|
||||||
mbedtls_ecdsa_free( &ecdsa );
|
mbedtls_ecdsa_free( &ecdsa );
|
||||||
|
@ -24,7 +24,7 @@ void mbedtls_ecp_curve_info( int id, int tls_id, int size, char *name )
|
|||||||
TEST_ASSERT( by_id == by_tls );
|
TEST_ASSERT( by_id == by_tls );
|
||||||
TEST_ASSERT( by_id == by_name );
|
TEST_ASSERT( by_id == by_name );
|
||||||
|
|
||||||
TEST_ASSERT( by_id->size == size );
|
TEST_ASSERT( by_id->bit_size == size );
|
||||||
}
|
}
|
||||||
/* END_CASE */
|
/* END_CASE */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user