[PATCH v2 09/25] crypto: ansi_cprng - Make length types consistent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The public crypto API uses "unsigned int", but the internals used
a mixture of that and size_t, which are different sizes on 64 bits.

This shuts up a GCC warning about printf format.

Signed-off-by: George Spelvin <linux@xxxxxxxxxxx>
---
 crypto/ansi_cprng.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c
index 62b8f958..d4106e54 100644
--- a/crypto/ansi_cprng.c
+++ b/crypto/ansi_cprng.c
@@ -152,11 +152,11 @@ static int _get_more_prng_bytes(struct prng_context *ctx, bool cont_test)
 }
 
 /* Our exported functions */
-static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx,
-				bool do_cont_test)
+static int get_prng_bytes(char *buf, unsigned int nbytes,
+			  struct prng_context *ctx, bool do_cont_test)
 {
 	unsigned char *ptr = buf;
-	unsigned int byte_count = (unsigned int)nbytes;
+	unsigned int byte_count = nbytes;
 	int err;
 
 
@@ -244,7 +244,7 @@ static void free_prng_context(struct prng_context *ctx)
 }
 
 static int reset_prng_context(struct prng_context *ctx,
-			      unsigned char *key, size_t klen,
+			      unsigned char *key, unsigned int klen,
 			      unsigned char *V, unsigned char *DT)
 {
 	int ret;
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux