diff options
author | Janos Follath <janos.follath@arm.com> | 2021-03-05 08:51:13 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-05 08:51:13 +0000 |
commit | 477a4636845a3ebc7510325b37359493518d04b4 (patch) | |
tree | a0ee2dab2223324dcf45bb6516c6073b522d3e01 | |
parent | d0b0ba8179580c38940b8472bbedfd29657baf68 (diff) | |
parent | e538896ad8bf1a3f0ebb7890abc6008c97c19449 (diff) | |
download | mbedtls-archive/origin/remove_deprecated_functions.zip mbedtls-archive/origin/remove_deprecated_functions.tar.gz mbedtls-archive/origin/remove_deprecated_functions.tar.bz2 |
Merge pull request #4168 from stevew817/fix/unreferenced_function_in_ecp_carchive/origin/remove_deprecated_functions
Remove unreferenced static functions when ECP_NO_FALLBACK is used
-rw-r--r-- | library/ecp.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/library/ecp.c b/library/ecp.c index 3b68e8e..6a005d5 100644 --- a/library/ecp.c +++ b/library/ecp.c @@ -1243,6 +1243,13 @@ cleanup: while( (N).s < 0 && mbedtls_mpi_cmp_int( &(N), 0 ) != 0 ) \ MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &(N), &(N), &grp->P ) ) +#if ( defined(MBEDTLS_ECP_SHORT_WEIERSTRASS_ENABLED) && \ + !( defined(MBEDTLS_ECP_NO_FALLBACK) && \ + defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) && \ + defined(MBEDTLS_ECP_ADD_MIXED_ALT) ) ) || \ + ( defined(MBEDTLS_ECP_MONTGOMERY_ENABLED) && \ + !( defined(MBEDTLS_ECP_NO_FALLBACK) && \ + defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) ) ) static inline int mbedtls_mpi_sub_mod( const mbedtls_ecp_group *grp, mbedtls_mpi *X, const mbedtls_mpi *A, @@ -1254,6 +1261,7 @@ static inline int mbedtls_mpi_sub_mod( const mbedtls_ecp_group *grp, cleanup: return( ret ); } +#endif /* All functions referencing mbedtls_mpi_sub_mod() are alt-implemented without fallback */ /* * Reduce a mbedtls_mpi mod p in-place, to use after mbedtls_mpi_add_mpi and mbedtls_mpi_mul_int. @@ -1276,6 +1284,10 @@ cleanup: return( ret ); } +#if defined(MBEDTLS_ECP_SHORT_WEIERSTRASS_ENABLED) && \ + !( defined(MBEDTLS_ECP_NO_FALLBACK) && \ + defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) && \ + defined(MBEDTLS_ECP_ADD_MIXED_ALT) ) static inline int mbedtls_mpi_shift_l_mod( const mbedtls_ecp_group *grp, mbedtls_mpi *X, size_t count ) @@ -1286,6 +1298,7 @@ static inline int mbedtls_mpi_shift_l_mod( const mbedtls_ecp_group *grp, cleanup: return( ret ); } +#endif /* All functions referencing mbedtls_mpi_shift_l_mod() are alt-implemented without fallback */ #if defined(MBEDTLS_ECP_SHORT_WEIERSTRASS_ENABLED) /* |