Renesas / SecureDweet
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers coding.h Source File

coding.h

00001 /* coding.h
00002  *
00003  * Copyright (C) 2006-2016 wolfSSL Inc.
00004  *
00005  * This file is part of wolfSSL.
00006  *
00007  * wolfSSL is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * wolfSSL is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
00020  */
00021 
00022 
00023 
00024 #ifndef WOLF_CRYPT_CODING_H
00025 #define WOLF_CRYPT_CODING_H
00026 
00027 #include <wolfssl/wolfcrypt/types.h>
00028 
00029 #ifdef __cplusplus
00030     extern "C" {
00031 #endif
00032 
00033 
00034 WOLFSSL_API int Base64_Decode(const byte* in, word32 inLen, byte* out,
00035                                word32* outLen);
00036 
00037 #if defined(OPENSSL_EXTRA) || defined(SESSION_CERTS) || defined(WOLFSSL_KEY_GEN) \
00038    || defined(WOLFSSL_CERT_GEN) || defined(HAVE_WEBSERVER) || !defined(NO_DSA)
00039     #ifndef WOLFSSL_BASE64_ENCODE
00040         #define WOLFSSL_BASE64_ENCODE
00041     #endif
00042 #endif
00043 
00044 
00045 #ifdef WOLFSSL_BASE64_ENCODE
00046     enum Escaped {
00047         WC_STD_ENC = 0,       /* normal \n line ending encoding */
00048         WC_ESC_NL_ENC,        /* use escape sequence encoding   */
00049         WC_NO_NL_ENC          /* no encoding at all             */
00050     }; /* Encoding types */
00051 
00052     /* encode isn't */
00053     WOLFSSL_API
00054     int Base64_Encode(const byte* in, word32 inLen, byte* out,
00055                                   word32* outLen);
00056     WOLFSSL_API
00057     int Base64_EncodeEsc(const byte* in, word32 inLen, byte* out,
00058                                   word32* outLen);
00059     WOLFSSL_API
00060     int Base64_Encode_NoNl(const byte* in, word32 inLen, byte* out,
00061                                   word32* outLen);
00062 #endif
00063 
00064 #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) || defined(HAVE_FIPS)
00065     WOLFSSL_API
00066     int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen);
00067     WOLFSSL_API
00068     int Base16_Encode(const byte* in, word32 inLen, byte* out, word32* outLen);
00069 #endif
00070 
00071 
00072 #ifdef __cplusplus
00073     } /* extern "C" */
00074 #endif
00075 
00076 #endif /* WOLF_CRYPT_CODING_H */
00077 
00078