summaryrefslogtreecommitdiff
path: root/wolfssl/wolfcrypt/coding.h
diff options
context:
space:
mode:
authorauth12 <[email protected]>2020-07-22 08:34:12 -0700
committerauth12 <[email protected]>2020-07-22 08:34:12 -0700
commit5015ddb9b1eee748efc24056e46f81888c975f7a (patch)
treea810f6ee90f8bfe0e934fdd9142198e6b3862957 /wolfssl/wolfcrypt/coding.h
downloadwolfssl_windows-5015ddb9b1eee748efc24056e46f81888c975f7a.tar.xz
wolfssl_windows-5015ddb9b1eee748efc24056e46f81888c975f7a.zip
Initial commit
Diffstat (limited to 'wolfssl/wolfcrypt/coding.h')
-rw-r--r--wolfssl/wolfcrypt/coding.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/wolfssl/wolfcrypt/coding.h b/wolfssl/wolfcrypt/coding.h
new file mode 100644
index 0000000..88b1caf
--- /dev/null
+++ b/wolfssl/wolfcrypt/coding.h
@@ -0,0 +1,88 @@
+/* coding.h
+ *
+ * Copyright (C) 2006-2020 wolfSSL Inc.
+ *
+ * This file is part of wolfSSL.
+ *
+ * wolfSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * wolfSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
+ */
+
+/*!
+ \file wolfssl/wolfcrypt/coding.h
+*/
+
+#ifndef WOLF_CRYPT_CODING_H
+#define WOLF_CRYPT_CODING_H
+
+#include <wolfssl/wolfcrypt/types.h>
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
+WOLFSSL_API int Base64_Decode(const byte* in, word32 inLen, byte* out,
+ word32* outLen);
+
+#if defined(OPENSSL_EXTRA) || defined(SESSION_CERTS) || defined(WOLFSSL_KEY_GEN) \
+ || defined(WOLFSSL_CERT_GEN) || defined(HAVE_WEBSERVER) || !defined(NO_DSA)
+ #ifndef WOLFSSL_BASE64_ENCODE
+ #define WOLFSSL_BASE64_ENCODE
+ #endif
+#endif
+
+
+#ifdef WOLFSSL_BASE64_ENCODE
+ enum Escaped {
+ WC_STD_ENC = 0, /* normal \n line ending encoding */
+ WC_ESC_NL_ENC, /* use escape sequence encoding */
+ WC_NO_NL_ENC /* no encoding at all */
+ }; /* Encoding types */
+
+ /* encode isn't */
+ WOLFSSL_API
+ int Base64_Encode(const byte* in, word32 inLen, byte* out,
+ word32* outLen);
+ WOLFSSL_API
+ int Base64_EncodeEsc(const byte* in, word32 inLen, byte* out,
+ word32* outLen);
+ WOLFSSL_API
+ int Base64_Encode_NoNl(const byte* in, word32 inLen, byte* out,
+ word32* outLen);
+#endif
+
+#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) || \
+ defined(HAVE_WEBSERVER) || defined(HAVE_FIPS) || \
+ defined(HAVE_ECC_CDH) || defined(HAVE_SELFTEST) || \
+ defined(WOLFSSL_ENCRYPTED_KEYS)
+ #ifndef WOLFSSL_BASE16
+ #define WOLFSSL_BASE16
+ #endif
+#endif
+
+#ifdef WOLFSSL_BASE16
+ WOLFSSL_API
+ int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen);
+ WOLFSSL_API
+ int Base16_Encode(const byte* in, word32 inLen, byte* out, word32* outLen);
+#endif
+
+
+#ifdef __cplusplus
+ } /* extern "C" */
+#endif
+
+#endif /* WOLF_CRYPT_CODING_H */
+