wolfSSL SSL/TLS library, support up to TLS1.3

Dependents:   CyaSSL-Twitter-OAuth4Tw Example-client-tls-cert TwitterReader TweetTest ... more

Committer:
wolfSSL
Date:
Tue Aug 22 10:48:22 2017 +0000
Revision:
13:f67a6c6013ca
Parent:
11:cee25a834751
wolfSSL3.12.0 with TLS1.3

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 11:cee25a834751 1 /* coding.h
wolfSSL 11:cee25a834751 2 *
wolfSSL 11:cee25a834751 3 * Copyright (C) 2006-2016 wolfSSL Inc.
wolfSSL 11:cee25a834751 4 *
wolfSSL 11:cee25a834751 5 * This file is part of wolfSSL.
wolfSSL 11:cee25a834751 6 *
wolfSSL 11:cee25a834751 7 * wolfSSL is free software; you can redistribute it and/or modify
wolfSSL 11:cee25a834751 8 * it under the terms of the GNU General Public License as published by
wolfSSL 11:cee25a834751 9 * the Free Software Foundation; either version 2 of the License, or
wolfSSL 11:cee25a834751 10 * (at your option) any later version.
wolfSSL 11:cee25a834751 11 *
wolfSSL 11:cee25a834751 12 * wolfSSL is distributed in the hope that it will be useful,
wolfSSL 11:cee25a834751 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
wolfSSL 11:cee25a834751 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wolfSSL 11:cee25a834751 15 * GNU General Public License for more details.
wolfSSL 11:cee25a834751 16 *
wolfSSL 11:cee25a834751 17 * You should have received a copy of the GNU General Public License
wolfSSL 11:cee25a834751 18 * along with this program; if not, write to the Free Software
wolfSSL 11:cee25a834751 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
wolfSSL 11:cee25a834751 20 */
wolfSSL 11:cee25a834751 21
wolfSSL 11:cee25a834751 22
wolfSSL 11:cee25a834751 23
wolfSSL 11:cee25a834751 24 #ifndef WOLF_CRYPT_CODING_H
wolfSSL 11:cee25a834751 25 #define WOLF_CRYPT_CODING_H
wolfSSL 11:cee25a834751 26
wolfSSL 11:cee25a834751 27 #include <wolfssl/wolfcrypt/types.h>
wolfSSL 11:cee25a834751 28
wolfSSL 11:cee25a834751 29 #ifdef __cplusplus
wolfSSL 11:cee25a834751 30 extern "C" {
wolfSSL 11:cee25a834751 31 #endif
wolfSSL 11:cee25a834751 32
wolfSSL 11:cee25a834751 33
wolfSSL 11:cee25a834751 34 WOLFSSL_API int Base64_Decode(const byte* in, word32 inLen, byte* out,
wolfSSL 11:cee25a834751 35 word32* outLen);
wolfSSL 11:cee25a834751 36
wolfSSL 11:cee25a834751 37 #if defined(OPENSSL_EXTRA) || defined(SESSION_CERTS) || defined(WOLFSSL_KEY_GEN) \
wolfSSL 11:cee25a834751 38 || defined(WOLFSSL_CERT_GEN) || defined(HAVE_WEBSERVER) || !defined(NO_DSA)
wolfSSL 11:cee25a834751 39 #ifndef WOLFSSL_BASE64_ENCODE
wolfSSL 11:cee25a834751 40 #define WOLFSSL_BASE64_ENCODE
wolfSSL 11:cee25a834751 41 #endif
wolfSSL 11:cee25a834751 42 #endif
wolfSSL 11:cee25a834751 43
wolfSSL 11:cee25a834751 44
wolfSSL 11:cee25a834751 45 #ifdef WOLFSSL_BASE64_ENCODE
wolfSSL 11:cee25a834751 46 enum Escaped {
wolfSSL 11:cee25a834751 47 WC_STD_ENC = 0, /* normal \n line ending encoding */
wolfSSL 11:cee25a834751 48 WC_ESC_NL_ENC, /* use escape sequence encoding */
wolfSSL 11:cee25a834751 49 WC_NO_NL_ENC /* no encoding at all */
wolfSSL 11:cee25a834751 50 }; /* Encoding types */
wolfSSL 11:cee25a834751 51
wolfSSL 11:cee25a834751 52 /* encode isn't */
wolfSSL 11:cee25a834751 53 WOLFSSL_API
wolfSSL 11:cee25a834751 54 int Base64_Encode(const byte* in, word32 inLen, byte* out,
wolfSSL 11:cee25a834751 55 word32* outLen);
wolfSSL 11:cee25a834751 56 WOLFSSL_API
wolfSSL 11:cee25a834751 57 int Base64_EncodeEsc(const byte* in, word32 inLen, byte* out,
wolfSSL 11:cee25a834751 58 word32* outLen);
wolfSSL 11:cee25a834751 59 WOLFSSL_API
wolfSSL 11:cee25a834751 60 int Base64_Encode_NoNl(const byte* in, word32 inLen, byte* out,
wolfSSL 11:cee25a834751 61 word32* outLen);
wolfSSL 11:cee25a834751 62 #endif
wolfSSL 11:cee25a834751 63
wolfSSL 11:cee25a834751 64 #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) || defined(HAVE_FIPS) \
wolfSSL 11:cee25a834751 65 || defined(HAVE_ECC_CDH)
wolfSSL 11:cee25a834751 66 WOLFSSL_API
wolfSSL 11:cee25a834751 67 int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen);
wolfSSL 11:cee25a834751 68 WOLFSSL_API
wolfSSL 11:cee25a834751 69 int Base16_Encode(const byte* in, word32 inLen, byte* out, word32* outLen);
wolfSSL 11:cee25a834751 70 #endif
wolfSSL 11:cee25a834751 71
wolfSSL 11:cee25a834751 72
wolfSSL 11:cee25a834751 73 #ifdef __cplusplus
wolfSSL 11:cee25a834751 74 } /* extern "C" */
wolfSSL 11:cee25a834751 75 #endif
wolfSSL 11:cee25a834751 76
wolfSSL 11:cee25a834751 77 #endif /* WOLF_CRYPT_CODING_H */
wolfSSL 11:cee25a834751 78
wolfSSL 11:cee25a834751 79