1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

Make ecp_get_type public

The ecp_get_type function comes handy in higher level modules and tests
as well. It is not inline anymore, to enable alternative implementations
to implement it for themselves.
This commit is contained in:
Janos Follath
2019-02-26 12:36:52 +00:00
parent 4ffdbe0979
commit df9295b7ec
3 changed files with 35 additions and 35 deletions

View File

@ -760,12 +760,7 @@ void ecp_read_binary( int id, data_t * buf, char * x, char * y, char * z,
if( ret == 0 )
{
TEST_ASSERT( mbedtls_mpi_cmp_mpi( &P.X, &X ) == 0 );
/*
* At the time of writing, the following condition is equivalent with
* if( ecp_get_type( grp ) == ECP_TYPE_MONTGOMERY )
* but has the advantage of not using internal symbols.
*/
if( grp.G.Y.p == NULL )
if( mbedtls_ecp_get_type( &grp ) == MBEDTLS_ECP_TYPE_MONTGOMERY )
{
TEST_ASSERT( mbedtls_mpi_cmp_int( &Y, 0 ) == 0 );
TEST_ASSERT( P.Y.p == NULL );