| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 1 | /** | 
|  | 2 | * \file camellia.h | 
|  | 3 | * | 
| Paul Bakker | 37ca75d | 2011-01-06 12:28:03 +0000 | [diff] [blame] | 4 | * \brief Camellia block cipher | 
|  | 5 | * | 
| Manuel Pégourié-Gonnard | 6fb8187 | 2015-07-27 11:11:48 +0200 | [diff] [blame] | 6 | *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved | 
| Manuel Pégourié-Gonnard | 37ff140 | 2015-09-04 14:21:07 +0200 | [diff] [blame] | 7 | *  SPDX-License-Identifier: Apache-2.0 | 
|  | 8 | * | 
|  | 9 | *  Licensed under the Apache License, Version 2.0 (the "License"); you may | 
|  | 10 | *  not use this file except in compliance with the License. | 
|  | 11 | *  You may obtain a copy of the License at | 
|  | 12 | * | 
|  | 13 | *  http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 14 | * | 
|  | 15 | *  Unless required by applicable law or agreed to in writing, software | 
|  | 16 | *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | 
|  | 17 | *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 18 | *  See the License for the specific language governing permissions and | 
|  | 19 | *  limitations under the License. | 
| Paul Bakker | b96f154 | 2010-07-18 20:36:00 +0000 | [diff] [blame] | 20 | * | 
| Manuel Pégourié-Gonnard | fe44643 | 2015-03-06 13:17:10 +0000 | [diff] [blame] | 21 | *  This file is part of mbed TLS (https://tls.mbed.org) | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 22 | */ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 23 | #ifndef MBEDTLS_CAMELLIA_H | 
|  | 24 | #define MBEDTLS_CAMELLIA_H | 
| Paul Bakker | 477fd32 | 2009-10-04 13:22:13 +0000 | [diff] [blame] | 25 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 26 | #if !defined(MBEDTLS_CONFIG_FILE) | 
| Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 27 | #include "config.h" | 
| Manuel Pégourié-Gonnard | cef4ad2 | 2014-04-29 12:39:06 +0200 | [diff] [blame] | 28 | #else | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 29 | #include MBEDTLS_CONFIG_FILE | 
| Manuel Pégourié-Gonnard | cef4ad2 | 2014-04-29 12:39:06 +0200 | [diff] [blame] | 30 | #endif | 
| Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 31 |  | 
| Rich Evans | 00ab470 | 2015-02-06 13:43:58 +0000 | [diff] [blame] | 32 | #include <stddef.h> | 
| Manuel Pégourié-Gonnard | ab22910 | 2015-04-15 11:53:16 +0200 | [diff] [blame] | 33 | #include <stdint.h> | 
| Paul Bakker | c81f6c3 | 2009-05-03 13:09:15 +0000 | [diff] [blame] | 34 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 35 | #define MBEDTLS_CAMELLIA_ENCRYPT     1 | 
|  | 36 | #define MBEDTLS_CAMELLIA_DECRYPT     0 | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 37 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 38 | #define MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH           -0x0024  /**< Invalid key length. */ | 
|  | 39 | #define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH         -0x0026  /**< Invalid data input length. */ | 
| Paul Bakker | 2b222c8 | 2009-07-27 21:03:45 +0000 | [diff] [blame] | 40 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 41 | #if !defined(MBEDTLS_CAMELLIA_ALT) | 
| Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 42 | // Regular implementation | 
|  | 43 | // | 
|  | 44 |  | 
| Paul Bakker | 407a0da | 2013-06-27 14:29:21 +0200 | [diff] [blame] | 45 | #ifdef __cplusplus | 
|  | 46 | extern "C" { | 
|  | 47 | #endif | 
|  | 48 |  | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 49 | /** | 
|  | 50 | * \brief          CAMELLIA context structure | 
|  | 51 | */ | 
|  | 52 | typedef struct | 
|  | 53 | { | 
|  | 54 | int nr;                     /*!<  number of rounds  */ | 
| Paul Bakker | c81f6c3 | 2009-05-03 13:09:15 +0000 | [diff] [blame] | 55 | uint32_t rk[68];            /*!<  CAMELLIA round keys    */ | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 56 | } | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 57 | mbedtls_camellia_context; | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 58 |  | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 59 | /** | 
| Paul Bakker | c7ea99a | 2014-06-18 11:12:03 +0200 | [diff] [blame] | 60 | * \brief          Initialize CAMELLIA context | 
|  | 61 | * | 
|  | 62 | * \param ctx      CAMELLIA context to be initialized | 
|  | 63 | */ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 64 | void mbedtls_camellia_init( mbedtls_camellia_context *ctx ); | 
| Paul Bakker | c7ea99a | 2014-06-18 11:12:03 +0200 | [diff] [blame] | 65 |  | 
|  | 66 | /** | 
|  | 67 | * \brief          Clear CAMELLIA context | 
|  | 68 | * | 
|  | 69 | * \param ctx      CAMELLIA context to be cleared | 
|  | 70 | */ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 71 | void mbedtls_camellia_free( mbedtls_camellia_context *ctx ); | 
| Paul Bakker | c7ea99a | 2014-06-18 11:12:03 +0200 | [diff] [blame] | 72 |  | 
|  | 73 | /** | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 74 | * \brief          CAMELLIA key schedule (encryption) | 
|  | 75 | * | 
|  | 76 | * \param ctx      CAMELLIA context to be initialized | 
|  | 77 | * \param key      encryption key | 
| Manuel Pégourié-Gonnard | b8186a5 | 2015-06-18 14:58:58 +0200 | [diff] [blame] | 78 | * \param keybits  must be 128, 192 or 256 | 
| Paul Bakker | 9af723c | 2014-05-01 13:03:14 +0200 | [diff] [blame] | 79 | * | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 80 | * \return         0 if successful, or MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 81 | */ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 82 | int mbedtls_camellia_setkey_enc( mbedtls_camellia_context *ctx, const unsigned char *key, | 
| Manuel Pégourié-Gonnard | b8186a5 | 2015-06-18 14:58:58 +0200 | [diff] [blame] | 83 | unsigned int keybits ); | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 84 |  | 
|  | 85 | /** | 
|  | 86 | * \brief          CAMELLIA key schedule (decryption) | 
|  | 87 | * | 
|  | 88 | * \param ctx      CAMELLIA context to be initialized | 
|  | 89 | * \param key      decryption key | 
| Manuel Pégourié-Gonnard | b8186a5 | 2015-06-18 14:58:58 +0200 | [diff] [blame] | 90 | * \param keybits  must be 128, 192 or 256 | 
| Paul Bakker | 9af723c | 2014-05-01 13:03:14 +0200 | [diff] [blame] | 91 | * | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 92 | * \return         0 if successful, or MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 93 | */ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 94 | int mbedtls_camellia_setkey_dec( mbedtls_camellia_context *ctx, const unsigned char *key, | 
| Manuel Pégourié-Gonnard | b8186a5 | 2015-06-18 14:58:58 +0200 | [diff] [blame] | 95 | unsigned int keybits ); | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 96 |  | 
|  | 97 | /** | 
|  | 98 | * \brief          CAMELLIA-ECB block encryption/decryption | 
|  | 99 | * | 
|  | 100 | * \param ctx      CAMELLIA context | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 101 | * \param mode     MBEDTLS_CAMELLIA_ENCRYPT or MBEDTLS_CAMELLIA_DECRYPT | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 102 | * \param input    16-byte input block | 
|  | 103 | * \param output   16-byte output block | 
| Paul Bakker | 9af723c | 2014-05-01 13:03:14 +0200 | [diff] [blame] | 104 | * | 
| Paul Bakker | 27caa8a | 2010-03-21 15:43:59 +0000 | [diff] [blame] | 105 | * \return         0 if successful | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 106 | */ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 107 | int mbedtls_camellia_crypt_ecb( mbedtls_camellia_context *ctx, | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 108 | int mode, | 
| Paul Bakker | ff60ee6 | 2010-03-16 21:09:09 +0000 | [diff] [blame] | 109 | const unsigned char input[16], | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 110 | unsigned char output[16] ); | 
|  | 111 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 112 | #if defined(MBEDTLS_CIPHER_MODE_CBC) | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 113 | /** | 
|  | 114 | * \brief          CAMELLIA-CBC buffer encryption/decryption | 
| Paul Bakker | 4c067eb | 2009-05-17 10:25:19 +0000 | [diff] [blame] | 115 | *                 Length should be a multiple of the block | 
|  | 116 | *                 size (16 bytes) | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 117 | * | 
| Manuel Pégourié-Gonnard | 2be147a | 2015-01-23 16:19:47 +0000 | [diff] [blame] | 118 | * \note           Upon exit, the content of the IV is updated so that you can | 
|  | 119 | *                 call the function same function again on the following | 
|  | 120 | *                 block(s) of data and get the same result as if it was | 
|  | 121 | *                 encrypted in one call. This allows a "streaming" usage. | 
|  | 122 | *                 If on the other hand you need to retain the contents of the | 
|  | 123 | *                 IV, you should either save it manually or use the cipher | 
|  | 124 | *                 module instead. | 
|  | 125 | * | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 126 | * \param ctx      CAMELLIA context | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 127 | * \param mode     MBEDTLS_CAMELLIA_ENCRYPT or MBEDTLS_CAMELLIA_DECRYPT | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 128 | * \param length   length of the input data | 
|  | 129 | * \param iv       initialization vector (updated after use) | 
|  | 130 | * \param input    buffer holding the input data | 
|  | 131 | * \param output   buffer holding the output data | 
| Paul Bakker | 9af723c | 2014-05-01 13:03:14 +0200 | [diff] [blame] | 132 | * | 
| Paul Bakker | b9e4e2c | 2014-05-01 14:18:25 +0200 | [diff] [blame] | 133 | * \return         0 if successful, or | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 134 | *                 MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 135 | */ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 136 | int mbedtls_camellia_crypt_cbc( mbedtls_camellia_context *ctx, | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 137 | int mode, | 
| Paul Bakker | 23986e5 | 2011-04-24 08:57:21 +0000 | [diff] [blame] | 138 | size_t length, | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 139 | unsigned char iv[16], | 
| Paul Bakker | ff60ee6 | 2010-03-16 21:09:09 +0000 | [diff] [blame] | 140 | const unsigned char *input, | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 141 | unsigned char *output ); | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 142 | #endif /* MBEDTLS_CIPHER_MODE_CBC */ | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 143 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 144 | #if defined(MBEDTLS_CIPHER_MODE_CFB) | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 145 | /** | 
|  | 146 | * \brief          CAMELLIA-CFB128 buffer encryption/decryption | 
|  | 147 | * | 
| Paul Bakker | ca6f3e2 | 2011-10-06 13:11:08 +0000 | [diff] [blame] | 148 | * Note: Due to the nature of CFB you should use the same key schedule for | 
|  | 149 | * both encryption and decryption. So a context initialized with | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 150 | * mbedtls_camellia_setkey_enc() for both MBEDTLS_CAMELLIA_ENCRYPT and CAMELLIE_DECRYPT. | 
| Paul Bakker | ca6f3e2 | 2011-10-06 13:11:08 +0000 | [diff] [blame] | 151 | * | 
| Manuel Pégourié-Gonnard | 2be147a | 2015-01-23 16:19:47 +0000 | [diff] [blame] | 152 | * \note           Upon exit, the content of the IV is updated so that you can | 
|  | 153 | *                 call the function same function again on the following | 
|  | 154 | *                 block(s) of data and get the same result as if it was | 
|  | 155 | *                 encrypted in one call. This allows a "streaming" usage. | 
|  | 156 | *                 If on the other hand you need to retain the contents of the | 
|  | 157 | *                 IV, you should either save it manually or use the cipher | 
|  | 158 | *                 module instead. | 
|  | 159 | * | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 160 | * \param ctx      CAMELLIA context | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 161 | * \param mode     MBEDTLS_CAMELLIA_ENCRYPT or MBEDTLS_CAMELLIA_DECRYPT | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 162 | * \param length   length of the input data | 
|  | 163 | * \param iv_off   offset in IV (updated after use) | 
|  | 164 | * \param iv       initialization vector (updated after use) | 
|  | 165 | * \param input    buffer holding the input data | 
|  | 166 | * \param output   buffer holding the output data | 
| Paul Bakker | dcbfdcc | 2013-09-10 16:16:50 +0200 | [diff] [blame] | 167 | * | 
| Paul Bakker | b9e4e2c | 2014-05-01 14:18:25 +0200 | [diff] [blame] | 168 | * \return         0 if successful, or | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 169 | *                 MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 170 | */ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 171 | int mbedtls_camellia_crypt_cfb128( mbedtls_camellia_context *ctx, | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 172 | int mode, | 
| Paul Bakker | 23986e5 | 2011-04-24 08:57:21 +0000 | [diff] [blame] | 173 | size_t length, | 
| Paul Bakker | 1ef71df | 2011-06-09 14:14:58 +0000 | [diff] [blame] | 174 | size_t *iv_off, | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 175 | unsigned char iv[16], | 
| Paul Bakker | ff60ee6 | 2010-03-16 21:09:09 +0000 | [diff] [blame] | 176 | const unsigned char *input, | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 177 | unsigned char *output ); | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 178 | #endif /* MBEDTLS_CIPHER_MODE_CFB */ | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 179 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 180 | #if defined(MBEDTLS_CIPHER_MODE_CTR) | 
| Paul Bakker | 9a73632 | 2012-11-14 12:39:52 +0000 | [diff] [blame] | 181 | /** | 
| Paul Bakker | 1ef71df | 2011-06-09 14:14:58 +0000 | [diff] [blame] | 182 | * \brief               CAMELLIA-CTR buffer encryption/decryption | 
|  | 183 | * | 
|  | 184 | * Warning: You have to keep the maximum use of your counter in mind! | 
|  | 185 | * | 
| Paul Bakker | ca6f3e2 | 2011-10-06 13:11:08 +0000 | [diff] [blame] | 186 | * Note: Due to the nature of CTR you should use the same key schedule for | 
|  | 187 | * both encryption and decryption. So a context initialized with | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 188 | * mbedtls_camellia_setkey_enc() for both MBEDTLS_CAMELLIA_ENCRYPT and MBEDTLS_CAMELLIA_DECRYPT. | 
| Paul Bakker | ca6f3e2 | 2011-10-06 13:11:08 +0000 | [diff] [blame] | 189 | * | 
| Paul Bakker | dcbfdcc | 2013-09-10 16:16:50 +0200 | [diff] [blame] | 190 | * \param ctx           CAMELLIA context | 
| Paul Bakker | 1ef71df | 2011-06-09 14:14:58 +0000 | [diff] [blame] | 191 | * \param length        The length of the data | 
|  | 192 | * \param nc_off        The offset in the current stream_block (for resuming | 
|  | 193 | *                      within current cipher stream). The offset pointer to | 
|  | 194 | *                      should be 0 at the start of a stream. | 
|  | 195 | * \param nonce_counter The 128-bit nonce and counter. | 
|  | 196 | * \param stream_block  The saved stream-block for resuming. Is overwritten | 
|  | 197 | *                      by the function. | 
|  | 198 | * \param input         The input data stream | 
|  | 199 | * \param output        The output data stream | 
|  | 200 | * | 
|  | 201 | * \return         0 if successful | 
|  | 202 | */ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 203 | int mbedtls_camellia_crypt_ctr( mbedtls_camellia_context *ctx, | 
| Paul Bakker | 1ef71df | 2011-06-09 14:14:58 +0000 | [diff] [blame] | 204 | size_t length, | 
|  | 205 | size_t *nc_off, | 
|  | 206 | unsigned char nonce_counter[16], | 
|  | 207 | unsigned char stream_block[16], | 
|  | 208 | const unsigned char *input, | 
|  | 209 | unsigned char *output ); | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 210 | #endif /* MBEDTLS_CIPHER_MODE_CTR */ | 
| Paul Bakker | 1ef71df | 2011-06-09 14:14:58 +0000 | [diff] [blame] | 211 |  | 
| Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 212 | #ifdef __cplusplus | 
|  | 213 | } | 
|  | 214 | #endif | 
|  | 215 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 216 | #else  /* MBEDTLS_CAMELLIA_ALT */ | 
| Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 217 | #include "camellia_alt.h" | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 218 | #endif /* MBEDTLS_CAMELLIA_ALT */ | 
| Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 219 |  | 
|  | 220 | #ifdef __cplusplus | 
|  | 221 | extern "C" { | 
|  | 222 | #endif | 
|  | 223 |  | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 224 | /** | 
|  | 225 | * \brief          Checkup routine | 
|  | 226 | * | 
|  | 227 | * \return         0 if successful, or 1 if the test failed | 
|  | 228 | */ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 229 | int mbedtls_camellia_self_test( int verbose ); | 
| Paul Bakker | 38119b1 | 2009-01-10 23:31:23 +0000 | [diff] [blame] | 230 |  | 
|  | 231 | #ifdef __cplusplus | 
|  | 232 | } | 
|  | 233 | #endif | 
|  | 234 |  | 
|  | 235 | #endif /* camellia.h */ |