@@ -182,8 +182,8 @@ int mbedtls_aesce_has_support_impl(void)
182182
183183
184184static inline uint8x16_t aesce_encrypt_block_inline (uint8x16_t block ,
185- const uint8x16_t * vkeys ,
186- int nr )
185+ const uint8x16_t * vkeys ,
186+ int nr )
187187{
188188 /* 10, 12 or 14 rounds. Unroll loop. */
189189#if defined(MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH )
@@ -210,8 +210,8 @@ static inline uint8x16_t aesce_encrypt_block_inline(uint8x16_t block,
210210}
211211
212212static NO_INLINE uint8x16_t aesce_encrypt_block (uint8x16_t block ,
213- const uint8x16_t * vkeys ,
214- const int nr )
213+ const uint8x16_t * vkeys ,
214+ const int nr )
215215{
216216 return aesce_encrypt_block_inline (block , vkeys , nr );
217217}
@@ -781,16 +781,17 @@ static inline uint8x16_t poly_mult_reduce(uint8x16x4_t input)
781781}
782782
783783// Having a not-inlined copy helps code-size on non-perf-sensitive paths
784- static NO_INLINE uint8x16_t poly_mult_multiply_and_reduce (uint8x16_t a , uint8x16_t b ) {
785- return poly_mult_reduce (poly_mult_128 (a ,b ));
784+ static NO_INLINE uint8x16_t poly_mult_multiply_and_reduce (uint8x16_t a , uint8x16_t b )
785+ {
786+ return poly_mult_reduce (poly_mult_128 (a , b ));
786787}
787788
788789/*
789790 * GCM multiplication: c = a times b in GF(2^128)
790791 */
791792NO_INLINE void mbedtls_aesce_gcm_mult (unsigned char c [16 ],
792- const unsigned char a [16 ],
793- const unsigned char b [16 ])
793+ const unsigned char a [16 ],
794+ const unsigned char b [16 ])
794795{
795796 uint8x16_t va , vb , vc ;
796797 va = vrbitq_u8 (vld1q_u8 (& a [0 ]));
@@ -848,7 +849,8 @@ void mbedtls_aesce_gcm_update_block_partial(
848849 const uint8_t * input ,
849850 uint8_t * output ,
850851 unsigned offset , unsigned len , uint8_t scratch [32 ]
851- ) {
852+ )
853+ {
852854 MBEDTLS_ASSUME (len > 0 );
853855 int nr = MBEDTLS_AES_GET_NR (aes_ctx );
854856 const uint8x16_t * vkeys = aes_ctx -> vkeys ;
@@ -901,11 +903,11 @@ void mbedtls_aesce_gcm_update_block_partial(
901903
902904MBEDTLS_OPTIMIZE_FOR_PERFORMANCE
903905void mbedtls_aesce_gcm_update_blocks (
904- mbedtls_aes_context * aes_ctx ,
905- mbedtls_gcm_context * ctx ,
906- const unsigned char * input ,
907- unsigned char * output ,
908- size_t blocks )
906+ mbedtls_aes_context * aes_ctx ,
907+ mbedtls_gcm_context * ctx ,
908+ const unsigned char * input ,
909+ unsigned char * output ,
910+ size_t blocks )
909911{
910912 const uint8x16_t * vkeys = aes_ctx -> vkeys ;
911913
@@ -927,7 +929,9 @@ void mbedtls_aesce_gcm_update_blocks(
927929 MBEDTLS_MAYBE_UNUSED const uint8x16x4_t vh = ctx -> vghash_4 ;
928930
929931 // compute keystream in ve
930- for (size_t b = 0 ; b < (blocks - (blocks % MBEDTLS_AESCE_GCM_MULTIBLOCK )); b += MBEDTLS_AESCE_GCM_MULTIBLOCK ) {
932+ for (size_t b = 0 ;
933+ b < (blocks - (blocks % MBEDTLS_AESCE_GCM_MULTIBLOCK ));
934+ b += MBEDTLS_AESCE_GCM_MULTIBLOCK ) {
931935 // manually unrolling and ordering instructions makes a big difference
932936 // to performance (esp. GCC), and also a small size benefit.
933937
@@ -1026,7 +1030,7 @@ void mbedtls_aesce_gcm_update_blocks(
10261030 vtag = poly_mult_reduce (tag_x4 );
10271031 }
10281032 #else
1029- uint8x16_t ct0 ,ct1 ,ct2 ,ct3 ;
1033+ uint8x16_t ct0 , ct1 , ct2 , ct3 ;
10301034 if (mode == MBEDTLS_AES_ENCRYPT ) {
10311035 ct0 = vout [0 ];
10321036 ct1 = vout [1 ];
@@ -1076,7 +1080,7 @@ void mbedtls_aesce_gcm_update_blocks(
10761080 0 ,
10771081 16 ,
10781082 scratch
1079- );
1083+ );
10801084 input += 16 ;
10811085 output += 16 ;
10821086 }
0 commit comments