A library for setting up Secure Socket Layer (SSL) connections and verifying remote hosts using certificates. Contains only the source files for mbed platform implementation of the library.
Dependents: HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL
cyassl/ctaocrypt/camellia.h@0:b86d15c6ba29, 2015-01-19 (annotated)
- Committer:
- Vanger
- Date:
- Mon Jan 19 21:45:42 2015 +0000
- Revision:
- 0:b86d15c6ba29
Updated CyaSSL Library to 3.3.0. Changed Settings and functions to be implemented for mbed platforms
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Vanger | 0:b86d15c6ba29 | 1 | /* camellia.h ver 1.2.0 |
Vanger | 0:b86d15c6ba29 | 2 | * |
Vanger | 0:b86d15c6ba29 | 3 | * Copyright (c) 2006,2007 |
Vanger | 0:b86d15c6ba29 | 4 | * NTT (Nippon Telegraph and Telephone Corporation) . All rights reserved. |
Vanger | 0:b86d15c6ba29 | 5 | * |
Vanger | 0:b86d15c6ba29 | 6 | * Redistribution and use in source and binary forms, with or without |
Vanger | 0:b86d15c6ba29 | 7 | * modification, are permitted provided that the following conditions |
Vanger | 0:b86d15c6ba29 | 8 | * are met: |
Vanger | 0:b86d15c6ba29 | 9 | * 1. Redistributions of source code must retain the above copyright |
Vanger | 0:b86d15c6ba29 | 10 | * notice, this list of conditions and the following disclaimer as |
Vanger | 0:b86d15c6ba29 | 11 | * the first lines of this file unmodified. |
Vanger | 0:b86d15c6ba29 | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
Vanger | 0:b86d15c6ba29 | 13 | * notice, this list of conditions and the following disclaimer in the |
Vanger | 0:b86d15c6ba29 | 14 | * documentation and/or other materials provided with the distribution. |
Vanger | 0:b86d15c6ba29 | 15 | * |
Vanger | 0:b86d15c6ba29 | 16 | * THIS SOFTWARE IS PROVIDED BY NTT ``AS IS'' AND ANY EXPRESS OR |
Vanger | 0:b86d15c6ba29 | 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
Vanger | 0:b86d15c6ba29 | 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
Vanger | 0:b86d15c6ba29 | 19 | * IN NO EVENT SHALL NTT BE LIABLE FOR ANY DIRECT, INDIRECT, |
Vanger | 0:b86d15c6ba29 | 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
Vanger | 0:b86d15c6ba29 | 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
Vanger | 0:b86d15c6ba29 | 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
Vanger | 0:b86d15c6ba29 | 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
Vanger | 0:b86d15c6ba29 | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
Vanger | 0:b86d15c6ba29 | 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Vanger | 0:b86d15c6ba29 | 26 | */ |
Vanger | 0:b86d15c6ba29 | 27 | |
Vanger | 0:b86d15c6ba29 | 28 | /* camellia.h |
Vanger | 0:b86d15c6ba29 | 29 | * |
Vanger | 0:b86d15c6ba29 | 30 | * Copyright (C) 2006-2014 wolfSSL Inc. |
Vanger | 0:b86d15c6ba29 | 31 | * |
Vanger | 0:b86d15c6ba29 | 32 | * This file is part of CyaSSL. |
Vanger | 0:b86d15c6ba29 | 33 | * |
Vanger | 0:b86d15c6ba29 | 34 | * CyaSSL is free software; you can redistribute it and/or modify |
Vanger | 0:b86d15c6ba29 | 35 | * it under the terms of the GNU General Public License as published by |
Vanger | 0:b86d15c6ba29 | 36 | * the Free Software Foundation; either version 2 of the License, or |
Vanger | 0:b86d15c6ba29 | 37 | * (at your option) any later version. |
Vanger | 0:b86d15c6ba29 | 38 | * |
Vanger | 0:b86d15c6ba29 | 39 | * CyaSSL is distributed in the hope that it will be useful, |
Vanger | 0:b86d15c6ba29 | 40 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
Vanger | 0:b86d15c6ba29 | 41 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Vanger | 0:b86d15c6ba29 | 42 | * GNU General Public License for more details. |
Vanger | 0:b86d15c6ba29 | 43 | * |
Vanger | 0:b86d15c6ba29 | 44 | * You should have received a copy of the GNU General Public License |
Vanger | 0:b86d15c6ba29 | 45 | * along with this program; if not, write to the Free Software |
Vanger | 0:b86d15c6ba29 | 46 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
Vanger | 0:b86d15c6ba29 | 47 | */ |
Vanger | 0:b86d15c6ba29 | 48 | |
Vanger | 0:b86d15c6ba29 | 49 | #ifdef HAVE_CAMELLIA |
Vanger | 0:b86d15c6ba29 | 50 | |
Vanger | 0:b86d15c6ba29 | 51 | #ifndef CTAO_CRYPT_CAMELLIA_H |
Vanger | 0:b86d15c6ba29 | 52 | #define CTAO_CRYPT_CAMELLIA_H |
Vanger | 0:b86d15c6ba29 | 53 | |
Vanger | 0:b86d15c6ba29 | 54 | |
Vanger | 0:b86d15c6ba29 | 55 | #include <cyassl/ctaocrypt/types.h> |
Vanger | 0:b86d15c6ba29 | 56 | |
Vanger | 0:b86d15c6ba29 | 57 | #ifdef __cplusplus |
Vanger | 0:b86d15c6ba29 | 58 | extern "C" { |
Vanger | 0:b86d15c6ba29 | 59 | #endif |
Vanger | 0:b86d15c6ba29 | 60 | |
Vanger | 0:b86d15c6ba29 | 61 | |
Vanger | 0:b86d15c6ba29 | 62 | enum { |
Vanger | 0:b86d15c6ba29 | 63 | CAMELLIA_BLOCK_SIZE = 16 |
Vanger | 0:b86d15c6ba29 | 64 | }; |
Vanger | 0:b86d15c6ba29 | 65 | |
Vanger | 0:b86d15c6ba29 | 66 | #define CAMELLIA_TABLE_BYTE_LEN 272 |
Vanger | 0:b86d15c6ba29 | 67 | #define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / sizeof(word32)) |
Vanger | 0:b86d15c6ba29 | 68 | |
Vanger | 0:b86d15c6ba29 | 69 | typedef word32 KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; |
Vanger | 0:b86d15c6ba29 | 70 | |
Vanger | 0:b86d15c6ba29 | 71 | typedef struct Camellia { |
Vanger | 0:b86d15c6ba29 | 72 | word32 keySz; |
Vanger | 0:b86d15c6ba29 | 73 | KEY_TABLE_TYPE key; |
Vanger | 0:b86d15c6ba29 | 74 | word32 reg[CAMELLIA_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */ |
Vanger | 0:b86d15c6ba29 | 75 | word32 tmp[CAMELLIA_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */ |
Vanger | 0:b86d15c6ba29 | 76 | } Camellia; |
Vanger | 0:b86d15c6ba29 | 77 | |
Vanger | 0:b86d15c6ba29 | 78 | |
Vanger | 0:b86d15c6ba29 | 79 | CYASSL_API int CamelliaSetKey(Camellia* cam, |
Vanger | 0:b86d15c6ba29 | 80 | const byte* key, word32 len, const byte* iv); |
Vanger | 0:b86d15c6ba29 | 81 | CYASSL_API int CamelliaSetIV(Camellia* cam, const byte* iv); |
Vanger | 0:b86d15c6ba29 | 82 | CYASSL_API void CamelliaEncryptDirect(Camellia* cam, byte* out, const byte* in); |
Vanger | 0:b86d15c6ba29 | 83 | CYASSL_API void CamelliaDecryptDirect(Camellia* cam, byte* out, const byte* in); |
Vanger | 0:b86d15c6ba29 | 84 | CYASSL_API void CamelliaCbcEncrypt(Camellia* cam, |
Vanger | 0:b86d15c6ba29 | 85 | byte* out, const byte* in, word32 sz); |
Vanger | 0:b86d15c6ba29 | 86 | CYASSL_API void CamelliaCbcDecrypt(Camellia* cam, |
Vanger | 0:b86d15c6ba29 | 87 | byte* out, const byte* in, word32 sz); |
Vanger | 0:b86d15c6ba29 | 88 | |
Vanger | 0:b86d15c6ba29 | 89 | |
Vanger | 0:b86d15c6ba29 | 90 | #ifdef __cplusplus |
Vanger | 0:b86d15c6ba29 | 91 | } /* extern "C" */ |
Vanger | 0:b86d15c6ba29 | 92 | #endif |
Vanger | 0:b86d15c6ba29 | 93 | |
Vanger | 0:b86d15c6ba29 | 94 | #endif /* CTAO_CRYPT_AES_H */ |
Vanger | 0:b86d15c6ba29 | 95 | #endif /* HAVE_CAMELLIA */ |
Vanger | 0:b86d15c6ba29 | 96 |