fix style issues with tests/suites/helpers.function

This commit is contained in:
Rich Evans 2015-02-02 12:09:25 +00:00
parent 1fef5ff5ec
commit 4291445377

View file

@ -73,14 +73,14 @@ static int unhexify(unsigned char *obuf, const char *ibuf)
return len; 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; unsigned char l, h;
while (len != 0) while( len != 0 )
{ {
h = (*ibuf) / 16; h = *ibuf / 16;
l = (*ibuf) % 16; l = *ibuf % 16;
if( h < 10 ) if( h < 10 )
*obuf++ = '0' + h; *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 ) static unsigned char *zero_alloc( size_t len )
{ {
void *p; void *p;
size_t actual_len = len != 0 ? len : 1; size_t actual_len = ( len != 0 ) ? len : 1;
p = polarssl_malloc( actual_len ); p = polarssl_malloc( actual_len );
assert( p != NULL ); assert( p != NULL );
@ -131,7 +131,7 @@ static unsigned char *unhexify_alloc( const char *ibuf, size_t *olen )
{ {
unsigned char *obuf; unsigned char *obuf;
*olen = strlen(ibuf) / 2; *olen = strlen( ibuf ) / 2;
if( *olen == 0 ) if( *olen == 0 )
return( zero_alloc( *olen ) ); 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++ ) 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; 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 ); PUT_UINT32_BE( info->v0, result, 0 );