This mostly affects function signatures in the manual, i.e. to reflect
prior code changes where e.g. uint8_t pointers were corrected to char
pointers.
NB, this change is limited to the base64/base16 functions, deviations in
other translation units can be addressed with follow-up patches.
const uint8_t *src);
/* DST should point to an area of size at least
const uint8_t *src);
/* DST should point to an area of size at least
- * BASE64_ENCODE_FINAL_LENGTH */
+ * BASE64_ENCODE_FINAL_LENGTH
+ * The return value is the number of output bytes generated. */
size_t
base64_encode_final(struct base64_encode_ctx *ctx,
char *dst);
size_t
base64_encode_final(struct base64_encode_ctx *ctx,
char *dst);
/* Returns 1 on success, 0 on error. DST should point to an area of
* size *DST_LENGTH. Decoding returns failure it output would exceed
/* Returns 1 on success, 0 on error. DST should point to an area of
* size *DST_LENGTH. Decoding returns failure it output would exceed
- * this size. BASE64_DECODE_LENGTH(length) is always sufficient.
+ * this size. BASE64_DECODE_LENGTH(src_length) is always sufficient.
* *DST_LENGTH is updated to reflect the amount of data actually
* generated. */
int
* *DST_LENGTH is updated to reflect the amount of data actually
* generated. */
int
-@deftypefun {size_t} base64_encode_single (struct base64_encode_ctx *@var{ctx}, uint8_t *@var{dst}, uint8_t @var{src})
+@deftypefun {size_t} base64_encode_single (struct base64_encode_ctx *@var{ctx}, char *@var{dst}, uint8_t @var{src})
Encodes a single byte. Returns amount of output (always 1 or 2).
@end deftypefun
Encodes a single byte. Returns amount of output (always 1 or 2).
@end deftypefun
to @code{base64_encode_update}.
@end deffn
to @code{base64_encode_update}.
@end deffn
-@deftypefun {size_t} base64_encode_update (struct base64_encode_ctx *@var{ctx}, uint8_t *@var{dst}, size_t @var{length}, const uint8_t *@var{src})
+@deftypefun {size_t} base64_encode_update (struct base64_encode_ctx *@var{ctx}, char *@var{dst}, size_t @var{length}, const uint8_t *@var{src})
After @var{ctx} is initialized, this function may be called to encode @var{length}
bytes from @var{src}. The result will be placed in @var{dst}, and the return value
will be the number of bytes generated. Note that @var{dst} must be at least of size
After @var{ctx} is initialized, this function may be called to encode @var{length}
bytes from @var{src}. The result will be placed in @var{dst}, and the return value
will be the number of bytes generated. Note that @var{dst} must be at least of size
The maximum amount of output from @code{base64_encode_final}.
@end defvr
The maximum amount of output from @code{base64_encode_final}.
@end defvr
-@deftypefun {size_t} base64_encode_final (struct base64_encode_ctx *@var{ctx}, uint8_t *@var{dst})
+@deftypefun {size_t} base64_encode_final (struct base64_encode_ctx *@var{ctx}, char *@var{dst})
After calling base64_encode_update one or more times, this function
should be called to generate the final output bytes, including any
needed paddding. The return value is the number of output bytes
After calling base64_encode_update one or more times, this function
should be called to generate the final output bytes, including any
needed paddding. The return value is the number of output bytes
alphabet.
@end deftypefun
alphabet.
@end deftypefun
-@deftypefun {int} base64_decode_single (struct base64_decode_ctx *@var{ctx}, uint8_t *@var{dst}, uint8_t @var{src})
+@deftypefun {int} base64_decode_single (struct base64_decode_ctx *@var{ctx}, uint8_t *@var{dst}, char @var{src})
Decodes a single byte (@var{src}) and stores the result in @var{dst}.
Returns amount of output (0 or 1), or -1 on errors.
@end deftypefun
Decodes a single byte (@var{src}) and stores the result in @var{dst}.
Returns amount of output (0 or 1), or -1 on errors.
@end deftypefun
to @code{base64_decode_update}.
@end deffn
to @code{base64_decode_update}.
@end deffn
-@deftypefun {void} base64_decode_update (struct base64_decode_ctx *@var{ctx}, size_t *@var{dst_length}, uint8_t *@var{dst}, size_t @var{src_length}, const uint8_t *@var{src})
+@deftypefun {int} base64_decode_update (struct base64_decode_ctx *@var{ctx}, size_t *@var{dst_length}, uint8_t *@var{dst}, size_t @var{src_length}, const char *@var{src})
After @var{ctx} is initialized, this function may be called to decode
@var{src_length} bytes from @var{src}. The buffer pointed to by
@var{dst} must be of size *@var{dst_length}, and the amount of data
After @var{ctx} is initialized, this function may be called to decode
@var{src_length} bytes from @var{src}. The buffer pointed to by
@var{dst} must be of size *@var{dst_length}, and the amount of data
and are defined in @file{<nettle/base16.h>}. Note that there is no encoding context
necessary for doing base16 encoding.
and are defined in @file{<nettle/base16.h>}. Note that there is no encoding context
necessary for doing base16 encoding.
-@deftypefun {void} base16_encode_single (uint8_t *@var{dst}, uint8_t @var{src})
+@deftypefun {void} base16_encode_single (char *@var{dst}, uint8_t @var{src})
Encodes a single byte. Always stores two digits in @var{dst}[0] and @var{dst}[1].
@end deftypefun
Encodes a single byte. Always stores two digits in @var{dst}[0] and @var{dst}[1].
@end deftypefun
@code{base16_encode_update}.
@end deffn
@code{base16_encode_update}.
@end deffn
-@deftypefun {void} base16_encode_update (uint8_t *@var{dst}, size_t @var{length}, const uint8_t *@var{src})
+@deftypefun {void} base16_encode_update (char *@var{dst}, size_t @var{length}, const uint8_t *@var{src})
Always stores BASE16_ENCODE_LENGTH(@var{length}) digits in @var{dst}.
@end deftypefun
Always stores BASE16_ENCODE_LENGTH(@var{length}) digits in @var{dst}.
@end deftypefun
-@deftypefun {int} base16_decode_single (struct base16_decode_ctx *@var{ctx}, uint8_t *@var{dst}, uint8_t @var{src})
+@deftypefun {int} base16_decode_single (struct base16_decode_ctx *@var{ctx}, uint8_t *@var{dst}, char @var{src})
Decodes a single byte from @var{src} into @var{dst}. Returns amount of output (0 or 1), or -1 on errors.
@end deftypefun
Decodes a single byte from @var{src} into @var{dst}. Returns amount of output (0 or 1), or -1 on errors.
@end deftypefun
to @code{base16_decode_update}.
@end deffn
to @code{base16_decode_update}.
@end deffn
-@deftypefun {int} base16_decode_update (struct base16_decode_ctx *@var{ctx}, size_t *@var{dst_length}, uint8_t *@var{dst}, size_t @var{src_length}, const uint8_t *@var{src})
+@deftypefun {int} base16_decode_update (struct base16_decode_ctx *@var{ctx}, size_t *@var{dst_length}, uint8_t *@var{dst}, size_t @var{src_length}, const char *@var{src})
After @var{ctx} is initialized, this function may be called to decode
@var{src_length} bytes from @var{src}. The buffer pointed to by
@var{dst} must be of size *@var{dst_length}, and the amount of data
After @var{ctx} is initialized, this function may be called to decode
@var{src_length} bytes from @var{src}. The buffer pointed to by
@var{dst} must be of size *@var{dst_length}, and the amount of data