Add static and casts to prevent compiler warnings
diff --git a/library/ctr_drbg.c b/library/ctr_drbg.c
index aec29b9..1b46f45 100644
--- a/library/ctr_drbg.c
+++ b/library/ctr_drbg.c
@@ -48,6 +48,14 @@
void *p_entropy,
const unsigned char *custom,
size_t len,
+ size_t entropy_len );
+
+int ctr_drbg_init_entropy_len(
+ ctr_drbg_context *ctx,
+ int (*f_entropy)(void *, unsigned char *, size_t),
+ void *p_entropy,
+ const unsigned char *custom,
+ size_t len,
size_t entropy_len )
{
int ret;
@@ -98,8 +106,8 @@
ctx->reseed_interval = interval;
}
-int block_cipher_df( unsigned char *output,
- const unsigned char *data, size_t data_len )
+static int block_cipher_df( unsigned char *output,
+ const unsigned char *data, size_t data_len )
{
unsigned char buf[CTR_DRBG_MAX_SEED_INPUT + CTR_DRBG_BLOCKSIZE + 16];
unsigned char tmp[CTR_DRBG_SEEDLEN];
@@ -180,8 +188,8 @@
return( 0 );
}
-int ctr_drbg_update_internal( ctr_drbg_context *ctx,
- const unsigned char data[CTR_DRBG_SEEDLEN] )
+static int ctr_drbg_update_internal( ctr_drbg_context *ctx,
+ const unsigned char data[CTR_DRBG_SEEDLEN] )
{
unsigned char tmp[CTR_DRBG_SEEDLEN];
unsigned char *p = tmp;
@@ -449,7 +457,8 @@
0x9d, 0x90, 0x3e, 0x07, 0x7c, 0x6f, 0x21, 0x8f };
static size_t test_offset;
-int ctr_drbg_self_test_entropy( void *data, unsigned char *buf, size_t len )
+static int ctr_drbg_self_test_entropy( void *data, unsigned char *buf,
+ size_t len )
{
unsigned char *p = data;
memcpy( buf, p + test_offset, len );