From 7e86025f32da040df148e4ad19dae49f97b95da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Sun, 10 Feb 2013 10:58:48 +0100 Subject: [PATCH] Rename ecp_*_binary to ecp_point_*_binary --- include/polarssl/ecp.h | 9 +++++---- library/ecp.c | 13 +++++++------ tests/suites/test_suite_ecp.function | 4 ++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/include/polarssl/ecp.h b/include/polarssl/ecp.h index 7973901841..a810a62dc0 100644 --- a/include/polarssl/ecp.h +++ b/include/polarssl/ecp.h @@ -248,8 +248,9 @@ int ecp_group_read_string( ecp_group *grp, int radix, * or POLARSSL_ERR_ECP_BAD_INPUT_DATA * or POLARSSL_ERR_ECP_BUFFER_TOO_SMALL */ -int ecp_write_binary( const ecp_group *grp, const ecp_point *P, int format, - uint8_t *olen, unsigned char *buf, size_t buflen ); +int ecp_point_write_binary( const ecp_group *grp, const ecp_point *P, + int format, uint8_t *olen, + unsigned char *buf, size_t buflen ); /** * \brief Import a point from unsigned binary data @@ -267,8 +268,8 @@ int ecp_write_binary( const ecp_group *grp, const ecp_point *P, int format, * belongs to the given group, see ecp_check_pubkey() for * that. */ -int ecp_read_binary( const ecp_group *grp, ecp_point *P, - const unsigned char *buf, size_t ilen ); +int ecp_point_read_binary( const ecp_group *grp, ecp_point *P, + const unsigned char *buf, size_t ilen ); /** * \brief Set a group using well-known domain parameters diff --git a/library/ecp.c b/library/ecp.c index ee0d3fa0be..5520d7393b 100644 --- a/library/ecp.c +++ b/library/ecp.c @@ -185,8 +185,9 @@ cleanup: /* * Export a point into unsigned binary data (SEC1 2.3.3) */ -int ecp_write_binary( const ecp_group *grp, const ecp_point *P, int format, - uint8_t *olen, unsigned char *buf, size_t buflen ) +int ecp_point_write_binary( const ecp_group *grp, const ecp_point *P, + int format, uint8_t *olen, + unsigned char *buf, size_t buflen ) { int ret; size_t plen; @@ -240,8 +241,8 @@ cleanup: /* * Import a point from unsigned binary data (SEC1 2.3.4) */ -int ecp_read_binary( const ecp_group *grp, ecp_point *pt, - const unsigned char *buf, size_t ilen ) { +int ecp_point_read_binary( const ecp_group *grp, ecp_point *pt, + const unsigned char *buf, size_t ilen ) { int ret; size_t plen; @@ -282,7 +283,7 @@ int ecp_tls_read_point( const ecp_group *grp, ecp_point *pt, if( data_len < 1 || data_len > buf_len - 1 ) return( POLARSSL_ERR_ECP_BAD_INPUT_DATA ); - return ecp_read_binary( grp, pt, buf, data_len ); + return ecp_point_read_binary( grp, pt, buf, data_len ); } /* @@ -300,7 +301,7 @@ int ecp_tls_write_point( const ecp_group *grp, const ecp_point *pt, if( buf_len < 1 ) return( POLARSSL_ERR_ECP_BAD_INPUT_DATA ); - return ecp_write_binary( grp, pt, format, buf, buf + 1, buf_len - 1); + return ecp_point_write_binary( grp, pt, format, buf, buf + 1, buf_len - 1); } /* diff --git a/tests/suites/test_suite_ecp.function b/tests/suites/test_suite_ecp.function index a6694f6912..55354ad8bf 100644 --- a/tests/suites/test_suite_ecp.function +++ b/tests/suites/test_suite_ecp.function @@ -244,7 +244,7 @@ ecp_write_binary:id:x:y:z:format:out:blen:ret TEST_ASSERT( mpi_read_string( &P.Z, 16, {z} ) == 0 ); #define POLARSSL_ECP_PF_UNKNOWN -1 - TEST_ASSERT( ecp_write_binary( &grp, &P, POLARSSL_ECP_PF_{format}, + TEST_ASSERT( ecp_point_write_binary( &grp, &P, POLARSSL_ECP_PF_{format}, &olen, buf, {blen} ) == {ret} ); if( {ret} == 0 ) @@ -279,7 +279,7 @@ ecp_read_binary:id:input:x:y:z:ret ilen = unhexify( buf, {input} ); - TEST_ASSERT( ecp_read_binary( &grp, &P, buf, ilen ) == {ret} ); + TEST_ASSERT( ecp_point_read_binary( &grp, &P, buf, ilen ) == {ret} ); if( {ret} == 0 ) {