From 9592485d0cc53e994084f92e9de8bfd97a4fee2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Fri, 21 Mar 2014 10:54:55 +0100 Subject: [PATCH] Fix some MSVC12 conversion warnings --- library/ctr_drbg.c | 2 +- library/ecdsa.c | 4 ++-- library/hmac_drbg.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/ctr_drbg.c b/library/ctr_drbg.c index 3be65e102..3cb63415e 100644 --- a/library/ctr_drbg.c +++ b/library/ctr_drbg.c @@ -456,7 +456,7 @@ static const unsigned char result_nopr[16] = { 0xa0, 0x54, 0x30, 0x3d, 0x8a, 0x7e, 0xa9, 0x88, 0x9d, 0x90, 0x3e, 0x07, 0x7c, 0x6f, 0x21, 0x8f }; -static int test_offset; +static size_t test_offset; static int ctr_drbg_self_test_entropy( void *data, unsigned char *buf, size_t len ) { diff --git a/library/ecdsa.c b/library/ecdsa.c index 12076d536..94522a4a6 100644 --- a/library/ecdsa.c +++ b/library/ecdsa.c @@ -49,7 +49,7 @@ * * Argument is the minimum size in bytes of the MD output. */ -static const md_info_t *md_info_by_size( int min_size ) +static const md_info_t *md_info_by_size( size_t min_size ) { const md_info_t *md_cur, *md_picked = NULL; const int *md_alg; @@ -57,7 +57,7 @@ static const md_info_t *md_info_by_size( int min_size ) for( md_alg = md_list(); *md_alg != 0; md_alg++ ) { if( ( md_cur = md_info_from_type( *md_alg ) ) == NULL || - md_cur->size < min_size || + (size_t) md_cur->size < min_size || ( md_picked != NULL && md_cur->size > md_picked->size ) ) continue; diff --git a/library/hmac_drbg.c b/library/hmac_drbg.c index 7a210925e..c05717b9a 100644 --- a/library/hmac_drbg.c +++ b/library/hmac_drbg.c @@ -414,7 +414,7 @@ static const unsigned char result_nopr[OUTPUT_LEN] = { 0xe8, 0x5f, 0x13, 0x0f, 0xc8, 0xa4, 0x59, 0xb7 }; /* "Entropy" from buffer */ -static int test_offset; +static size_t test_offset; static int hmac_drbg_self_test_entropy( void *data, unsigned char *buf, size_t len ) {