forked from wolfSSL/wolfssl
wolfcrypt/src/coding.c: restore support for BASE64_NO_TABLE builds.
This commit is contained in:
@ -82,6 +82,8 @@ static WC_INLINE byte Base64_Char2Val_CT(byte c)
|
||||
return (byte)(v - 1);
|
||||
}
|
||||
|
||||
#ifndef BASE64_NO_TABLE
|
||||
|
||||
static
|
||||
ALIGN64 const byte base64Decode_table[] = { /* + starts at 0x2B */
|
||||
/* 0x28: + , - . / */ 62, BAD, BAD, BAD, 63,
|
||||
@ -120,6 +122,8 @@ static WC_INLINE byte Base64_Char2Val_by_table(byte c)
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* !BASE64_NO_TABLE */
|
||||
|
||||
int Base64_SkipNewline(const byte* in, word32 *inLen,
|
||||
word32 *outJ)
|
||||
{
|
||||
@ -168,6 +172,8 @@ int Base64_SkipNewline(const byte* in, word32 *inLen,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef BASE64_NO_TABLE
|
||||
|
||||
int Base64_Decode_nonCT(const byte* in, word32 inLen, byte* out, word32* outLen)
|
||||
{
|
||||
word32 i = 0;
|
||||
@ -269,6 +275,8 @@ int Base64_Decode_nonCT(const byte* in, word32 inLen, byte* out, word32* outLen)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* !BASE64_NO_TABLE */
|
||||
|
||||
int Base64_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
|
||||
{
|
||||
word32 i = 0;
|
||||
@ -358,6 +366,12 @@ int Base64_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef BASE64_NO_TABLE
|
||||
int Base64_Decode_nonCT(const byte* in, word32 inLen, byte* out, word32* outLen) {
|
||||
return Base64_Decode(in, inLen, out, outLen);
|
||||
}
|
||||
#endif /* BASE64_NO_TABLE */
|
||||
|
||||
#endif /* WOLFSSL_BASE64_DECODE */
|
||||
|
||||
#if defined(WOLFSSL_BASE64_ENCODE)
|
||||
|
Reference in New Issue
Block a user