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