Switch to the new code style
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/library/constant_time_internal.h b/library/constant_time_internal.h
index 1e4a3ab..c4a32c7 100644
--- a/library/constant_time_internal.h
+++ b/library/constant_time_internal.h
@@ -44,7 +44,7 @@
*
* \return Zero if \p value is zero, otherwise all-bits-one.
*/
-unsigned mbedtls_ct_uint_mask( unsigned value );
+unsigned mbedtls_ct_uint_mask(unsigned value);
#if defined(MBEDTLS_SSL_SOME_SUITES_USE_MAC)
@@ -59,7 +59,7 @@
*
* \return Zero if \p value is zero, otherwise all-bits-one.
*/
-size_t mbedtls_ct_size_mask( size_t value );
+size_t mbedtls_ct_size_mask(size_t value);
#endif /* MBEDTLS_SSL_SOME_SUITES_USE_MAC */
@@ -76,7 +76,7 @@
*
* \return Zero if \p value is zero, otherwise all-bits-one.
*/
-mbedtls_mpi_uint mbedtls_ct_mpi_uint_mask( mbedtls_mpi_uint value );
+mbedtls_mpi_uint mbedtls_ct_mpi_uint_mask(mbedtls_mpi_uint value);
#endif /* MBEDTLS_BIGNUM_C */
@@ -95,8 +95,8 @@
* \return All-bits-one if \p x is greater or equal than \p y,
* otherwise zero.
*/
-size_t mbedtls_ct_size_mask_ge( size_t x,
- size_t y );
+size_t mbedtls_ct_size_mask_ge(size_t x,
+ size_t y);
#endif /* MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC */
@@ -111,8 +111,8 @@
*
* \return 1 if \p x equals to \p y, otherwise 0.
*/
-unsigned mbedtls_ct_size_bool_eq( size_t x,
- size_t y );
+unsigned mbedtls_ct_size_bool_eq(size_t x,
+ size_t y);
#if defined(MBEDTLS_BIGNUM_C)
@@ -126,8 +126,8 @@
*
* \return 1 if \p x is less than \p y, otherwise 0.
*/
-unsigned mbedtls_ct_mpi_uint_lt( const mbedtls_mpi_uint x,
- const mbedtls_mpi_uint y );
+unsigned mbedtls_ct_mpi_uint_lt(const mbedtls_mpi_uint x,
+ const mbedtls_mpi_uint y);
/**
* \brief Check if one unsigned MPI is less than another in constant
@@ -144,9 +144,9 @@
* \c 1 if \p A is less than \p B.
* \c 0 if \p A is greater than or equal to \p B.
*/
-unsigned mbedtls_mpi_core_lt_ct( const mbedtls_mpi_uint *A,
- const mbedtls_mpi_uint *B,
- size_t limbs);
+unsigned mbedtls_mpi_core_lt_ct(const mbedtls_mpi_uint *A,
+ const mbedtls_mpi_uint *B,
+ size_t limbs);
#endif /* MBEDTLS_BIGNUM_C */
/** Choose between two integer values without branches.
@@ -160,9 +160,9 @@
*
* \return \c if1 if \p condition is nonzero, otherwise \c if0.
*/
-unsigned mbedtls_ct_uint_if( unsigned condition,
- unsigned if1,
- unsigned if0 );
+unsigned mbedtls_ct_uint_if(unsigned condition,
+ unsigned if1,
+ unsigned if0);
#if defined(MBEDTLS_BIGNUM_C)
@@ -178,10 +178,10 @@
* initialized MPI.
* \param condition Condition to test, must be 0 or 1.
*/
-void mbedtls_ct_mpi_uint_cond_assign( size_t n,
- mbedtls_mpi_uint *dest,
- const mbedtls_mpi_uint *src,
- unsigned char condition );
+void mbedtls_ct_mpi_uint_cond_assign(size_t n,
+ mbedtls_mpi_uint *dest,
+ const mbedtls_mpi_uint *src,
+ unsigned char condition);
#endif /* MBEDTLS_BIGNUM_C */
@@ -196,7 +196,7 @@
*
* \return A base64 digit converted from \p value.
*/
-unsigned char mbedtls_ct_base64_enc_char( unsigned char value );
+unsigned char mbedtls_ct_base64_enc_char(unsigned char value);
/** Given a Base64 digit, return its value.
*
@@ -210,7 +210,7 @@
*
* \return The value of the base64 digit \p c.
*/
-signed char mbedtls_ct_base64_dec_value( unsigned char c );
+signed char mbedtls_ct_base64_dec_value(unsigned char c);
#endif /* MBEDTLS_BASE64_C */
@@ -227,10 +227,10 @@
* \param c1 The first value to analyze in the condition.
* \param c2 The second value to analyze in the condition.
*/
-void mbedtls_ct_memcpy_if_eq( unsigned char *dest,
- const unsigned char *src,
- size_t len,
- size_t c1, size_t c2 );
+void mbedtls_ct_memcpy_if_eq(unsigned char *dest,
+ const unsigned char *src,
+ size_t len,
+ size_t c1, size_t c2);
/** Copy data from a secret position with constant flow.
*
@@ -258,12 +258,12 @@
* \param offset_max The maximal value of \p offset.
* \param len The number of bytes to copy.
*/
-void mbedtls_ct_memcpy_offset( unsigned char *dest,
- const unsigned char *src,
- size_t offset,
- size_t offset_min,
- size_t offset_max,
- size_t len );
+void mbedtls_ct_memcpy_offset(unsigned char *dest,
+ const unsigned char *src,
+ size_t offset,
+ size_t offset_min,
+ size_t offset_max,
+ size_t len);
/** Compute the HMAC of variable-length data with constant flow.
*
@@ -302,24 +302,24 @@
* The hardware accelerator failed.
*/
#if defined(MBEDTLS_USE_PSA_CRYPTO)
-int mbedtls_ct_hmac( mbedtls_svc_key_id_t key,
- psa_algorithm_t alg,
- const unsigned char *add_data,
- size_t add_data_len,
- const unsigned char *data,
- size_t data_len_secret,
- size_t min_data_len,
- size_t max_data_len,
- unsigned char *output );
+int mbedtls_ct_hmac(mbedtls_svc_key_id_t key,
+ psa_algorithm_t alg,
+ const unsigned char *add_data,
+ size_t add_data_len,
+ const unsigned char *data,
+ size_t data_len_secret,
+ size_t min_data_len,
+ size_t max_data_len,
+ unsigned char *output);
#else
-int mbedtls_ct_hmac( mbedtls_md_context_t *ctx,
- const unsigned char *add_data,
- size_t add_data_len,
- const unsigned char *data,
- size_t data_len_secret,
- size_t min_data_len,
- size_t max_data_len,
- unsigned char *output );
+int mbedtls_ct_hmac(mbedtls_md_context_t *ctx,
+ const unsigned char *add_data,
+ size_t add_data_len,
+ const unsigned char *data,
+ size_t data_len_secret,
+ size_t min_data_len,
+ size_t max_data_len,
+ unsigned char *output);
#endif /* MBEDTLS_USE_PSA_CRYPTO */
#endif /* MBEDTLS_SSL_SOME_SUITES_USE_MAC */
@@ -352,11 +352,11 @@
* \return #MBEDTLS_ERR_RSA_INVALID_PADDING
* The input doesn't contain properly formatted padding.
*/
-int mbedtls_ct_rsaes_pkcs1_v15_unpadding( unsigned char *input,
- size_t ilen,
- unsigned char *output,
- size_t output_max_len,
- size_t *olen );
+int mbedtls_ct_rsaes_pkcs1_v15_unpadding(unsigned char *input,
+ size_t ilen,
+ unsigned char *output,
+ size_t output_max_len,
+ size_t *olen);
#endif /* MBEDTLS_PKCS1_V15 && MBEDTLS_RSA_C && ! MBEDTLS_RSA_ALT */