mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-25 03:18:12 +00:00
fix style issues with tests/suites/helpers.function
This commit is contained in:
parent
1fef5ff5ec
commit
4291445377
1 changed files with 10 additions and 8 deletions
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue