From 4291445377a7b6fccfaa3b964c72f18d69bb25d9 Mon Sep 17 00:00:00 2001 From: Rich Evans Date: Mon, 2 Feb 2015 12:09:25 +0000 Subject: [PATCH] fix style issues with tests/suites/helpers.function --- tests/suites/helpers.function | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/suites/helpers.function b/tests/suites/helpers.function index f5dff8e79..73d6767f9 100644 --- a/tests/suites/helpers.function +++ b/tests/suites/helpers.function @@ -73,14 +73,14 @@ static int unhexify(unsigned char *obuf, const char *ibuf) return len; } -static void hexify(unsigned char *obuf, const unsigned char *ibuf, int len) +static void hexify( unsigned char *obuf, const unsigned char *ibuf, int len ) { unsigned char l, h; - while (len != 0) + while( len != 0 ) { - h = (*ibuf) / 16; - l = (*ibuf) % 16; + h = *ibuf / 16; + l = *ibuf % 16; if( h < 10 ) *obuf++ = '0' + h; @@ -107,7 +107,7 @@ static void hexify(unsigned char *obuf, const unsigned char *ibuf, int len) static unsigned char *zero_alloc( size_t len ) { void *p; - size_t actual_len = len != 0 ? len : 1; + size_t actual_len = ( len != 0 ) ? len : 1; p = polarssl_malloc( actual_len ); assert( p != NULL ); @@ -131,7 +131,7 @@ static unsigned char *unhexify_alloc( const char *ibuf, size_t *olen ) { unsigned char *obuf; - *olen = strlen(ibuf) / 2; + *olen = strlen( ibuf ) / 2; if( *olen == 0 ) return( zero_alloc( *olen ) ); @@ -269,9 +269,11 @@ static int rnd_pseudo_rand( void *rng_state, unsigned char *output, size_t len ) for( i = 0; i < 32; i++ ) { - info->v0 += (((info->v1 << 4) ^ (info->v1 >> 5)) + info->v1) ^ (sum + k[sum & 3]); + info->v0 += ( ( ( info->v1 << 4 ) ^ ( info->v1 >> 5 ) ) + + info->v1 ) ^ ( sum + k[sum & 3] ); sum += delta; - info->v1 += (((info->v0 << 4) ^ (info->v0 >> 5)) + info->v0) ^ (sum + k[(sum>>11) & 3]); + info->v1 += ( ( ( info->v0 << 4 ) ^ ( info->v0 >> 5 ) ) + + info->v0 ) ^ ( sum + k[( sum>>11 ) & 3] ); } PUT_UINT32_BE( info->v0, result, 0 );