diff --git a/doc/crypt.tex b/doc/crypt.tex index 28435d5b8..1c3a10288 100644 --- a/doc/crypt.tex +++ b/doc/crypt.tex @@ -6710,12 +6710,12 @@ \subsection{URL--safe 'base64url' encoding} \begin{verbatim} int base16_encode(const unsigned char *in, unsigned long inlen, char *out, unsigned long *outlen, - int caps); + unsigned int options); \end{verbatim} Where \textit{in} is the binary string, \textit{out} is where the ASCII output is placed -and \textit{caps} is either $0$ to use lower-letter \textit{a..f} or else to use caps \textit{A..F}. +and \textit{options} is either $0$ to use lower-letter \textit{a..f} or else to use caps \textit{A..F}. To decode a base16 string call: diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index a7edc7126..b30e087d3 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -54,7 +54,7 @@ int base32_decode(const char *in, unsigned long inlen, #ifdef LTC_BASE16 int base16_encode(const unsigned char *in, unsigned long inlen, char *out, unsigned long *outlen, - int caps); + unsigned int options); int base16_decode(const char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen); #endif diff --git a/src/misc/base16/base16_decode.c b/src/misc/base16/base16_decode.c index fb8c07eea..d02b9e28f 100644 --- a/src/misc/base16/base16_decode.c +++ b/src/misc/base16/base16_decode.c @@ -21,6 +21,7 @@ /** Base16 decode a string @param in The Base16 string to decode + @param inlen The length of the Base16 data @param out [out] The destination of the binary decoded data @param outlen [in/out] The max size and resulting size of the decoded data @return CRYPT_OK if successful diff --git a/src/misc/base16/base16_encode.c b/src/misc/base16/base16_encode.c index 7e68dce4b..f052fd1fd 100644 --- a/src/misc/base16/base16_encode.c +++ b/src/misc/base16/base16_encode.c @@ -22,12 +22,12 @@ @param inlen The length of the input buffer @param out [out] The destination of the Base16 encoded data @param outlen [in/out] The max size and resulting size of the encoded data - @param caps Output 'a-f' on 0 and 'A-F' otherwise. + @param options Output 'a-f' on 0 and 'A-F' otherwise. @return CRYPT_OK if successful */ int base16_encode(const unsigned char *in, unsigned long inlen, char *out, unsigned long *outlen, - int caps) + unsigned int options) { unsigned long i, x; const char *alphabet; @@ -52,7 +52,7 @@ int base16_encode(const unsigned char *in, unsigned long inlen, x--; *outlen = x; /* returning the length without terminating NUL */ - if (caps == 0) alphabet = alphabets[0]; + if (options == 0) alphabet = alphabets[0]; else alphabet = alphabets[1]; for (i = 0; i < x; i += 2) {