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/include/mbedtls/poly1305.h b/include/mbedtls/poly1305.h
index 6657aa2..fe7fe9e 100644
--- a/include/mbedtls/poly1305.h
+++ b/include/mbedtls/poly1305.h
@@ -39,7 +39,7 @@
#include <stddef.h>
/** Invalid input parameter(s). */
-#define MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA -0x0057
+#define MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA -0x0057
#ifdef __cplusplus
extern "C" {
@@ -47,18 +47,20 @@
#if !defined(MBEDTLS_POLY1305_ALT)
-typedef struct mbedtls_poly1305_context
-{
- uint32_t MBEDTLS_PRIVATE(r)[4]; /** The value for 'r' (low 128 bits of the key). */
- uint32_t MBEDTLS_PRIVATE(s)[4]; /** The value for 's' (high 128 bits of the key). */
- uint32_t MBEDTLS_PRIVATE(acc)[5]; /** The accumulator number. */
- uint8_t MBEDTLS_PRIVATE(queue)[16]; /** The current partial block of data. */
- size_t MBEDTLS_PRIVATE(queue_len); /** The number of bytes stored in 'queue'. */
-}
-mbedtls_poly1305_context;
+typedef struct mbedtls_poly1305_context {
+ uint32_t MBEDTLS_PRIVATE(r)[4]; /** The value for 'r' (low 128 bits of the
+ key). */
+ uint32_t MBEDTLS_PRIVATE(s)[4]; /** The value for 's' (high 128 bits of the
+ key). */
+ uint32_t MBEDTLS_PRIVATE(acc)[5]; /** The accumulator number. */
+ uint8_t MBEDTLS_PRIVATE(queue)[16]; /** The current partial block of data.
+ */
+ size_t MBEDTLS_PRIVATE(queue_len); /** The number of bytes stored in
+ 'queue'. */
+} mbedtls_poly1305_context;
-#else /* MBEDTLS_POLY1305_ALT */
-#include "poly1305_alt.h"
+#else /* MBEDTLS_POLY1305_ALT */
+# include "poly1305_alt.h"
#endif /* MBEDTLS_POLY1305_ALT */
/**
@@ -76,7 +78,7 @@
* \param ctx The Poly1305 context to initialize. This must
* not be \c NULL.
*/
-void mbedtls_poly1305_init( mbedtls_poly1305_context *ctx );
+void mbedtls_poly1305_init(mbedtls_poly1305_context *ctx);
/**
* \brief This function releases and clears the specified
@@ -86,7 +88,7 @@
* case this function is a no-op. If it is not \c NULL, it must
* point to an initialized Poly1305 context.
*/
-void mbedtls_poly1305_free( mbedtls_poly1305_context *ctx );
+void mbedtls_poly1305_free(mbedtls_poly1305_context *ctx);
/**
* \brief This function sets the one-time authentication key.
@@ -101,8 +103,8 @@
* \return \c 0 on success.
* \return A negative error code on failure.
*/
-int mbedtls_poly1305_starts( mbedtls_poly1305_context *ctx,
- const unsigned char key[32] );
+int mbedtls_poly1305_starts(mbedtls_poly1305_context *ctx,
+ const unsigned char key[32]);
/**
* \brief This functions feeds an input buffer into an ongoing
@@ -122,9 +124,9 @@
* \return \c 0 on success.
* \return A negative error code on failure.
*/
-int mbedtls_poly1305_update( mbedtls_poly1305_context *ctx,
- const unsigned char *input,
- size_t ilen );
+int mbedtls_poly1305_update(mbedtls_poly1305_context *ctx,
+ const unsigned char *input,
+ size_t ilen);
/**
* \brief This function generates the Poly1305 Message
@@ -138,8 +140,8 @@
* \return \c 0 on success.
* \return A negative error code on failure.
*/
-int mbedtls_poly1305_finish( mbedtls_poly1305_context *ctx,
- unsigned char mac[16] );
+int mbedtls_poly1305_finish(mbedtls_poly1305_context *ctx,
+ unsigned char mac[16]);
/**
* \brief This function calculates the Poly1305 MAC of the input
@@ -159,10 +161,10 @@
* \return \c 0 on success.
* \return A negative error code on failure.
*/
-int mbedtls_poly1305_mac( const unsigned char key[32],
- const unsigned char *input,
- size_t ilen,
- unsigned char mac[16] );
+int mbedtls_poly1305_mac(const unsigned char key[32],
+ const unsigned char *input,
+ size_t ilen,
+ unsigned char mac[16]);
#if defined(MBEDTLS_SELF_TEST)
/**
@@ -171,7 +173,7 @@
* \return \c 0 on success.
* \return \c 1 on failure.
*/
-int mbedtls_poly1305_self_test( int verbose );
+int mbedtls_poly1305_self_test(int verbose);
#endif /* MBEDTLS_SELF_TEST */
#ifdef __cplusplus