From c22e61a081b0aa1309429cc7f73a22220f419d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 24 May 2018 13:51:05 +0200 Subject: [PATCH] Add ifdef for selftest in header file See https://github.com/ARMmbed/mbedtls/pull/975 --- include/mbedtls/chacha20.h | 2 ++ include/mbedtls/chachapoly.h | 2 ++ include/mbedtls/poly1305.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/include/mbedtls/chacha20.h b/include/mbedtls/chacha20.h index c33aef371..56ee57aa6 100644 --- a/include/mbedtls/chacha20.h +++ b/include/mbedtls/chacha20.h @@ -196,6 +196,7 @@ int mbedtls_chacha20_crypt( const unsigned char key[32], const unsigned char* input, unsigned char* output ); +#if defined(MBEDTLS_SELF_TEST) /** * \brief The ChaCha20 checkup routine. * @@ -203,6 +204,7 @@ int mbedtls_chacha20_crypt( const unsigned char key[32], * \return \c 1 on failure. */ int mbedtls_chacha20_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ #ifdef __cplusplus } diff --git a/include/mbedtls/chachapoly.h b/include/mbedtls/chachapoly.h index ae786e045..249dba185 100644 --- a/include/mbedtls/chachapoly.h +++ b/include/mbedtls/chachapoly.h @@ -311,6 +311,7 @@ int mbedtls_chachapoly_auth_decrypt( mbedtls_chachapoly_context *ctx, const unsigned char *input, unsigned char *output ); +#if defined(MBEDTLS_SELF_TEST) /** * \brief The ChaCha20-Poly1305 checkup routine. * @@ -318,6 +319,7 @@ int mbedtls_chachapoly_auth_decrypt( mbedtls_chachapoly_context *ctx, * \return \c 1 on failure. */ int mbedtls_chachapoly_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ #ifdef __cplusplus } diff --git a/include/mbedtls/poly1305.h b/include/mbedtls/poly1305.h index babbc15fa..abe369000 100644 --- a/include/mbedtls/poly1305.h +++ b/include/mbedtls/poly1305.h @@ -164,6 +164,7 @@ int mbedtls_poly1305_mac( const unsigned char key[32], size_t ilen, unsigned char mac[16] ); +#if defined(MBEDTLS_SELF_TEST) /** * \brief The Poly1305 checkup routine. * @@ -171,6 +172,7 @@ int mbedtls_poly1305_mac( const unsigned char key[32], * \return \c 1 on failure. */ int mbedtls_poly1305_self_test( int verbose ); +#endif /* MBEDTLS_SELF_TEST */ #ifdef __cplusplus }