diff options
author | Niels Möller <nisse@lysator.liu.se> | 2013-04-26 13:43:57 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2013-04-26 13:43:57 +0200 |
commit | 86fdb2ce31177028de997b98cc71b5027cf0bc1c (patch) | |
tree | 36354b55648781af22b5dc6c32862d2f3f70a6af /base64-encode.c | |
parent | eb7c996e529a49b5eedeb064df275378486987d7 (diff) | |
download | nettle-86fdb2ce31177028de997b98cc71b5027cf0bc1c.tar.gz |
Use size_t rather than unsigned for base16, base64, nettle_bufer and sexp related functions.
Diffstat (limited to 'base64-encode.c')
-rw-r--r-- | base64-encode.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/base64-encode.c b/base64-encode.c index b594923f..658c9b64 100644 --- a/base64-encode.c +++ b/base64-encode.c @@ -39,7 +39,7 @@ static const uint8_t encode_table[64] = #define ENCODE(x) (encode_table[0x3F & (x)]) void -base64_encode_raw(uint8_t *dst, unsigned length, const uint8_t *src) +base64_encode_raw(uint8_t *dst, size_t length, const uint8_t *src) { const uint8_t *in = src + length; uint8_t *out = dst + BASE64_ENCODE_RAW_LENGTH(length); @@ -140,7 +140,7 @@ base64_encode_init(struct base64_encode_ctx *ctx) } /* Encodes a single byte. */ -unsigned +size_t base64_encode_single(struct base64_encode_ctx *ctx, uint8_t *dst, uint8_t src) @@ -165,16 +165,16 @@ base64_encode_single(struct base64_encode_ctx *ctx, /* Returns the number of output characters. DST should point to an * area of size at least BASE64_ENCODE_LENGTH(length). */ -unsigned +size_t base64_encode_update(struct base64_encode_ctx *ctx, uint8_t *dst, - unsigned length, + size_t length, const uint8_t *src) { - unsigned done = 0; - unsigned left = length; + size_t done = 0; + size_t left = length; unsigned left_over; - unsigned bulk; + size_t bulk; while (ctx->bits && left) { @@ -208,7 +208,7 @@ base64_encode_update(struct base64_encode_ctx *ctx, /* DST should point to an area of size at least * BASE64_ENCODE_FINAL_SIZE */ -unsigned +size_t base64_encode_final(struct base64_encode_ctx *ctx, uint8_t *dst) { |