Apply clang formatting.
Executed with:
`find . -regextype posix-egrep -regex ".*\.([hc]|fmt|function)" | xargs -L1 clang-format-12 -i`
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
diff --git a/library/aesni.h b/library/aesni.h
index 3359cfe..b1c6ad3 100644
--- a/library/aesni.h
+++ b/library/aesni.h
@@ -29,20 +29,20 @@
#include "mbedtls/aes.h"
-#define MBEDTLS_AESNI_AES 0x02000000u
-#define MBEDTLS_AESNI_CLMUL 0x00000002u
+#define MBEDTLS_AESNI_AES 0x02000000u
+#define MBEDTLS_AESNI_CLMUL 0x00000002u
-#if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && \
- ( defined(__amd64__) || defined(__x86_64__) ) && \
- ! defined(MBEDTLS_HAVE_X86_64)
-#define MBEDTLS_HAVE_X86_64
+#if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && \
+ (defined(__amd64__) || defined(__x86_64__)) && \
+ !defined(MBEDTLS_HAVE_X86_64)
+# define MBEDTLS_HAVE_X86_64
#endif
#if defined(MBEDTLS_HAVE_X86_64)
-#ifdef __cplusplus
+# ifdef __cplusplus
extern "C" {
-#endif
+# endif
/**
* \brief Internal function to detect the AES-NI feature in CPUs.
@@ -55,7 +55,7 @@
*
* \return 1 if CPU has support for the feature, 0 otherwise
*/
-int mbedtls_aesni_has_support( unsigned int what );
+int mbedtls_aesni_has_support(unsigned int what);
/**
* \brief Internal AES-NI AES-ECB block encryption and decryption
@@ -70,10 +70,10 @@
*
* \return 0 on success (cannot fail)
*/
-int mbedtls_aesni_crypt_ecb( mbedtls_aes_context *ctx,
- int mode,
- const unsigned char input[16],
- unsigned char output[16] );
+int mbedtls_aesni_crypt_ecb(mbedtls_aes_context *ctx,
+ int mode,
+ const unsigned char input[16],
+ unsigned char output[16]);
/**
* \brief Internal GCM multiplication: c = a * b in GF(2^128)
@@ -88,9 +88,9 @@
* \note Both operands and result are bit strings interpreted as
* elements of GF(2^128) as per the GCM spec.
*/
-void mbedtls_aesni_gcm_mult( unsigned char c[16],
- const unsigned char a[16],
- const unsigned char b[16] );
+void mbedtls_aesni_gcm_mult(unsigned char c[16],
+ const unsigned char a[16],
+ const unsigned char b[16]);
/**
* \brief Internal round key inversion. This function computes
@@ -103,9 +103,9 @@
* \param fwdkey Original round keys (for encryption)
* \param nr Number of rounds (that is, number of round keys minus one)
*/
-void mbedtls_aesni_inverse_key( unsigned char *invkey,
- const unsigned char *fwdkey,
- int nr );
+void mbedtls_aesni_inverse_key(unsigned char *invkey,
+ const unsigned char *fwdkey,
+ int nr);
/**
* \brief Internal key expansion for encryption
@@ -119,13 +119,13 @@
*
* \return 0 if successful, or MBEDTLS_ERR_AES_INVALID_KEY_LENGTH
*/
-int mbedtls_aesni_setkey_enc( unsigned char *rk,
- const unsigned char *key,
- size_t bits );
+int mbedtls_aesni_setkey_enc(unsigned char *rk,
+ const unsigned char *key,
+ size_t bits);
-#ifdef __cplusplus
+# ifdef __cplusplus
}
-#endif
+# endif
#endif /* MBEDTLS_HAVE_X86_64 */