diff --git a/src/headers/tomcrypt_misc.h b/src/headers/tomcrypt_misc.h index 092c625..4f5e8fa 100644 --- a/src/headers/tomcrypt_misc.h +++ b/src/headers/tomcrypt_misc.h @@ -12,6 +12,8 @@ int base64_strict_decode(const unsigned char *in, unsigned long len, #ifdef LTC_BASE64_URL int base64url_encode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); +int base64url_strict_encode(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); int base64url_decode(const unsigned char *in, unsigned long len, unsigned char *out, unsigned long *outlen); diff --git a/src/misc/base64/base64_encode.c b/src/misc/base64/base64_encode.c index 0ed0aa3..c87f302 100644 --- a/src/misc/base64/base64_encode.c +++ b/src/misc/base64/base64_encode.c @@ -110,6 +110,12 @@ int base64url_encode(const unsigned char *in, unsigned long inlen, { return _base64_encode_internal(in, inlen, out, outlen, codes_base64url, 0); } + +int base64url_strict_encode(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + return _base64_encode_internal(in, inlen, out, outlen, codes_base64url, 1); +} #endif /* LTC_BASE64_URL */ #endif