xref: /aosp_15_r20/external/mbedtls/include/mbedtls/camellia.h (revision 62c56f9862f102b96d72393aff6076c951fb8148)
1*62c56f98SSadaf Ebrahimi /**
2*62c56f98SSadaf Ebrahimi  * \file camellia.h
3*62c56f98SSadaf Ebrahimi  *
4*62c56f98SSadaf Ebrahimi  * \brief Camellia block cipher
5*62c56f98SSadaf Ebrahimi  */
6*62c56f98SSadaf Ebrahimi /*
7*62c56f98SSadaf Ebrahimi  *  Copyright The Mbed TLS Contributors
8*62c56f98SSadaf Ebrahimi  *  SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
9*62c56f98SSadaf Ebrahimi  */
10*62c56f98SSadaf Ebrahimi #ifndef MBEDTLS_CAMELLIA_H
11*62c56f98SSadaf Ebrahimi #define MBEDTLS_CAMELLIA_H
12*62c56f98SSadaf Ebrahimi #include "mbedtls/private_access.h"
13*62c56f98SSadaf Ebrahimi 
14*62c56f98SSadaf Ebrahimi #include "mbedtls/build_info.h"
15*62c56f98SSadaf Ebrahimi 
16*62c56f98SSadaf Ebrahimi #include <stddef.h>
17*62c56f98SSadaf Ebrahimi #include <stdint.h>
18*62c56f98SSadaf Ebrahimi 
19*62c56f98SSadaf Ebrahimi #include "mbedtls/platform_util.h"
20*62c56f98SSadaf Ebrahimi 
21*62c56f98SSadaf Ebrahimi #define MBEDTLS_CAMELLIA_ENCRYPT     1
22*62c56f98SSadaf Ebrahimi #define MBEDTLS_CAMELLIA_DECRYPT     0
23*62c56f98SSadaf Ebrahimi 
24*62c56f98SSadaf Ebrahimi /** Bad input data. */
25*62c56f98SSadaf Ebrahimi #define MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA -0x0024
26*62c56f98SSadaf Ebrahimi 
27*62c56f98SSadaf Ebrahimi /** Invalid data input length. */
28*62c56f98SSadaf Ebrahimi #define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH -0x0026
29*62c56f98SSadaf Ebrahimi 
30*62c56f98SSadaf Ebrahimi #ifdef __cplusplus
31*62c56f98SSadaf Ebrahimi extern "C" {
32*62c56f98SSadaf Ebrahimi #endif
33*62c56f98SSadaf Ebrahimi 
34*62c56f98SSadaf Ebrahimi #if !defined(MBEDTLS_CAMELLIA_ALT)
35*62c56f98SSadaf Ebrahimi // Regular implementation
36*62c56f98SSadaf Ebrahimi //
37*62c56f98SSadaf Ebrahimi 
38*62c56f98SSadaf Ebrahimi /**
39*62c56f98SSadaf Ebrahimi  * \brief          CAMELLIA context structure
40*62c56f98SSadaf Ebrahimi  */
41*62c56f98SSadaf Ebrahimi typedef struct mbedtls_camellia_context {
42*62c56f98SSadaf Ebrahimi     int MBEDTLS_PRIVATE(nr);                     /*!<  number of rounds  */
43*62c56f98SSadaf Ebrahimi     uint32_t MBEDTLS_PRIVATE(rk)[68];            /*!<  CAMELLIA round keys    */
44*62c56f98SSadaf Ebrahimi }
45*62c56f98SSadaf Ebrahimi mbedtls_camellia_context;
46*62c56f98SSadaf Ebrahimi 
47*62c56f98SSadaf Ebrahimi #else  /* MBEDTLS_CAMELLIA_ALT */
48*62c56f98SSadaf Ebrahimi #include "camellia_alt.h"
49*62c56f98SSadaf Ebrahimi #endif /* MBEDTLS_CAMELLIA_ALT */
50*62c56f98SSadaf Ebrahimi 
51*62c56f98SSadaf Ebrahimi /**
52*62c56f98SSadaf Ebrahimi  * \brief          Initialize a CAMELLIA context.
53*62c56f98SSadaf Ebrahimi  *
54*62c56f98SSadaf Ebrahimi  * \param ctx      The CAMELLIA context to be initialized.
55*62c56f98SSadaf Ebrahimi  *                 This must not be \c NULL.
56*62c56f98SSadaf Ebrahimi  */
57*62c56f98SSadaf Ebrahimi void mbedtls_camellia_init(mbedtls_camellia_context *ctx);
58*62c56f98SSadaf Ebrahimi 
59*62c56f98SSadaf Ebrahimi /**
60*62c56f98SSadaf Ebrahimi  * \brief          Clear a CAMELLIA context.
61*62c56f98SSadaf Ebrahimi  *
62*62c56f98SSadaf Ebrahimi  * \param ctx      The CAMELLIA context to be cleared. This may be \c NULL,
63*62c56f98SSadaf Ebrahimi  *                 in which case this function returns immediately. If it is not
64*62c56f98SSadaf Ebrahimi  *                 \c NULL, it must be initialized.
65*62c56f98SSadaf Ebrahimi  */
66*62c56f98SSadaf Ebrahimi void mbedtls_camellia_free(mbedtls_camellia_context *ctx);
67*62c56f98SSadaf Ebrahimi 
68*62c56f98SSadaf Ebrahimi /**
69*62c56f98SSadaf Ebrahimi  * \brief          Perform a CAMELLIA key schedule operation for encryption.
70*62c56f98SSadaf Ebrahimi  *
71*62c56f98SSadaf Ebrahimi  * \param ctx      The CAMELLIA context to use. This must be initialized.
72*62c56f98SSadaf Ebrahimi  * \param key      The encryption key to use. This must be a readable buffer
73*62c56f98SSadaf Ebrahimi  *                 of size \p keybits Bits.
74*62c56f98SSadaf Ebrahimi  * \param keybits  The length of \p key in Bits. This must be either \c 128,
75*62c56f98SSadaf Ebrahimi  *                 \c 192 or \c 256.
76*62c56f98SSadaf Ebrahimi  *
77*62c56f98SSadaf Ebrahimi  * \return         \c 0 if successful.
78*62c56f98SSadaf Ebrahimi  * \return         A negative error code on failure.
79*62c56f98SSadaf Ebrahimi  */
80*62c56f98SSadaf Ebrahimi int mbedtls_camellia_setkey_enc(mbedtls_camellia_context *ctx,
81*62c56f98SSadaf Ebrahimi                                 const unsigned char *key,
82*62c56f98SSadaf Ebrahimi                                 unsigned int keybits);
83*62c56f98SSadaf Ebrahimi 
84*62c56f98SSadaf Ebrahimi /**
85*62c56f98SSadaf Ebrahimi  * \brief          Perform a CAMELLIA key schedule operation for decryption.
86*62c56f98SSadaf Ebrahimi  *
87*62c56f98SSadaf Ebrahimi  * \param ctx      The CAMELLIA context to use. This must be initialized.
88*62c56f98SSadaf Ebrahimi  * \param key      The decryption key. This must be a readable buffer
89*62c56f98SSadaf Ebrahimi  *                 of size \p keybits Bits.
90*62c56f98SSadaf Ebrahimi  * \param keybits  The length of \p key in Bits. This must be either \c 128,
91*62c56f98SSadaf Ebrahimi  *                 \c 192 or \c 256.
92*62c56f98SSadaf Ebrahimi  *
93*62c56f98SSadaf Ebrahimi  * \return         \c 0 if successful.
94*62c56f98SSadaf Ebrahimi  * \return         A negative error code on failure.
95*62c56f98SSadaf Ebrahimi  */
96*62c56f98SSadaf Ebrahimi int mbedtls_camellia_setkey_dec(mbedtls_camellia_context *ctx,
97*62c56f98SSadaf Ebrahimi                                 const unsigned char *key,
98*62c56f98SSadaf Ebrahimi                                 unsigned int keybits);
99*62c56f98SSadaf Ebrahimi 
100*62c56f98SSadaf Ebrahimi /**
101*62c56f98SSadaf Ebrahimi  * \brief          Perform a CAMELLIA-ECB block encryption/decryption operation.
102*62c56f98SSadaf Ebrahimi  *
103*62c56f98SSadaf Ebrahimi  * \param ctx      The CAMELLIA context to use. This must be initialized
104*62c56f98SSadaf Ebrahimi  *                 and bound to a key.
105*62c56f98SSadaf Ebrahimi  * \param mode     The mode of operation. This must be either
106*62c56f98SSadaf Ebrahimi  *                 #MBEDTLS_CAMELLIA_ENCRYPT or #MBEDTLS_CAMELLIA_DECRYPT.
107*62c56f98SSadaf Ebrahimi  * \param input    The input block. This must be a readable buffer
108*62c56f98SSadaf Ebrahimi  *                 of size \c 16 Bytes.
109*62c56f98SSadaf Ebrahimi  * \param output   The output block. This must be a writable buffer
110*62c56f98SSadaf Ebrahimi  *                 of size \c 16 Bytes.
111*62c56f98SSadaf Ebrahimi  *
112*62c56f98SSadaf Ebrahimi  * \return         \c 0 if successful.
113*62c56f98SSadaf Ebrahimi  * \return         A negative error code on failure.
114*62c56f98SSadaf Ebrahimi  */
115*62c56f98SSadaf Ebrahimi int mbedtls_camellia_crypt_ecb(mbedtls_camellia_context *ctx,
116*62c56f98SSadaf Ebrahimi                                int mode,
117*62c56f98SSadaf Ebrahimi                                const unsigned char input[16],
118*62c56f98SSadaf Ebrahimi                                unsigned char output[16]);
119*62c56f98SSadaf Ebrahimi 
120*62c56f98SSadaf Ebrahimi #if defined(MBEDTLS_CIPHER_MODE_CBC)
121*62c56f98SSadaf Ebrahimi /**
122*62c56f98SSadaf Ebrahimi  * \brief          Perform a CAMELLIA-CBC buffer encryption/decryption operation.
123*62c56f98SSadaf Ebrahimi  *
124*62c56f98SSadaf Ebrahimi  * \note           Upon exit, the content of the IV is updated so that you can
125*62c56f98SSadaf Ebrahimi  *                 call the function same function again on the following
126*62c56f98SSadaf Ebrahimi  *                 block(s) of data and get the same result as if it was
127*62c56f98SSadaf Ebrahimi  *                 encrypted in one call. This allows a "streaming" usage.
128*62c56f98SSadaf Ebrahimi  *                 If on the other hand you need to retain the contents of the
129*62c56f98SSadaf Ebrahimi  *                 IV, you should either save it manually or use the cipher
130*62c56f98SSadaf Ebrahimi  *                 module instead.
131*62c56f98SSadaf Ebrahimi  *
132*62c56f98SSadaf Ebrahimi  * \param ctx      The CAMELLIA context to use. This must be initialized
133*62c56f98SSadaf Ebrahimi  *                 and bound to a key.
134*62c56f98SSadaf Ebrahimi  * \param mode     The mode of operation. This must be either
135*62c56f98SSadaf Ebrahimi  *                 #MBEDTLS_CAMELLIA_ENCRYPT or #MBEDTLS_CAMELLIA_DECRYPT.
136*62c56f98SSadaf Ebrahimi  * \param length   The length in Bytes of the input data \p input.
137*62c56f98SSadaf Ebrahimi  *                 This must be a multiple of \c 16 Bytes.
138*62c56f98SSadaf Ebrahimi  * \param iv       The initialization vector. This must be a read/write buffer
139*62c56f98SSadaf Ebrahimi  *                 of length \c 16 Bytes. It is updated to allow streaming
140*62c56f98SSadaf Ebrahimi  *                 use as explained above.
141*62c56f98SSadaf Ebrahimi  * \param input    The buffer holding the input data. This must point to a
142*62c56f98SSadaf Ebrahimi  *                 readable buffer of length \p length Bytes.
143*62c56f98SSadaf Ebrahimi  * \param output   The buffer holding the output data. This must point to a
144*62c56f98SSadaf Ebrahimi  *                 writable buffer of length \p length Bytes.
145*62c56f98SSadaf Ebrahimi  *
146*62c56f98SSadaf Ebrahimi  * \return         \c 0 if successful.
147*62c56f98SSadaf Ebrahimi  * \return         A negative error code on failure.
148*62c56f98SSadaf Ebrahimi  */
149*62c56f98SSadaf Ebrahimi int mbedtls_camellia_crypt_cbc(mbedtls_camellia_context *ctx,
150*62c56f98SSadaf Ebrahimi                                int mode,
151*62c56f98SSadaf Ebrahimi                                size_t length,
152*62c56f98SSadaf Ebrahimi                                unsigned char iv[16],
153*62c56f98SSadaf Ebrahimi                                const unsigned char *input,
154*62c56f98SSadaf Ebrahimi                                unsigned char *output);
155*62c56f98SSadaf Ebrahimi #endif /* MBEDTLS_CIPHER_MODE_CBC */
156*62c56f98SSadaf Ebrahimi 
157*62c56f98SSadaf Ebrahimi #if defined(MBEDTLS_CIPHER_MODE_CFB)
158*62c56f98SSadaf Ebrahimi /**
159*62c56f98SSadaf Ebrahimi  * \brief          Perform a CAMELLIA-CFB128 buffer encryption/decryption
160*62c56f98SSadaf Ebrahimi  *                 operation.
161*62c56f98SSadaf Ebrahimi  *
162*62c56f98SSadaf Ebrahimi  * \note           Due to the nature of CFB mode, you should use the same
163*62c56f98SSadaf Ebrahimi  *                 key for both encryption and decryption. In particular, calls
164*62c56f98SSadaf Ebrahimi  *                 to this function should be preceded by a key-schedule via
165*62c56f98SSadaf Ebrahimi  *                 mbedtls_camellia_setkey_enc() regardless of whether \p mode
166*62c56f98SSadaf Ebrahimi  *                 is #MBEDTLS_CAMELLIA_ENCRYPT or #MBEDTLS_CAMELLIA_DECRYPT.
167*62c56f98SSadaf Ebrahimi  *
168*62c56f98SSadaf Ebrahimi  * \note           Upon exit, the content of the IV is updated so that you can
169*62c56f98SSadaf Ebrahimi  *                 call the function same function again on the following
170*62c56f98SSadaf Ebrahimi  *                 block(s) of data and get the same result as if it was
171*62c56f98SSadaf Ebrahimi  *                 encrypted in one call. This allows a "streaming" usage.
172*62c56f98SSadaf Ebrahimi  *                 If on the other hand you need to retain the contents of the
173*62c56f98SSadaf Ebrahimi  *                 IV, you should either save it manually or use the cipher
174*62c56f98SSadaf Ebrahimi  *                 module instead.
175*62c56f98SSadaf Ebrahimi  *
176*62c56f98SSadaf Ebrahimi  * \param ctx      The CAMELLIA context to use. This must be initialized
177*62c56f98SSadaf Ebrahimi  *                 and bound to a key.
178*62c56f98SSadaf Ebrahimi  * \param mode     The mode of operation. This must be either
179*62c56f98SSadaf Ebrahimi  *                 #MBEDTLS_CAMELLIA_ENCRYPT or #MBEDTLS_CAMELLIA_DECRYPT.
180*62c56f98SSadaf Ebrahimi  * \param length   The length of the input data \p input. Any value is allowed.
181*62c56f98SSadaf Ebrahimi  * \param iv_off   The current offset in the IV. This must be smaller
182*62c56f98SSadaf Ebrahimi  *                 than \c 16 Bytes. It is updated after this call to allow
183*62c56f98SSadaf Ebrahimi  *                 the aforementioned streaming usage.
184*62c56f98SSadaf Ebrahimi  * \param iv       The initialization vector. This must be a read/write buffer
185*62c56f98SSadaf Ebrahimi  *                 of length \c 16 Bytes. It is updated after this call to
186*62c56f98SSadaf Ebrahimi  *                 allow the aforementioned streaming usage.
187*62c56f98SSadaf Ebrahimi  * \param input    The buffer holding the input data. This must be a readable
188*62c56f98SSadaf Ebrahimi  *                 buffer of size \p length Bytes.
189*62c56f98SSadaf Ebrahimi  * \param output   The buffer to hold the output data. This must be a writable
190*62c56f98SSadaf Ebrahimi  *                 buffer of length \p length Bytes.
191*62c56f98SSadaf Ebrahimi  *
192*62c56f98SSadaf Ebrahimi  * \return         \c 0 if successful.
193*62c56f98SSadaf Ebrahimi  * \return         A negative error code on failure.
194*62c56f98SSadaf Ebrahimi  */
195*62c56f98SSadaf Ebrahimi int mbedtls_camellia_crypt_cfb128(mbedtls_camellia_context *ctx,
196*62c56f98SSadaf Ebrahimi                                   int mode,
197*62c56f98SSadaf Ebrahimi                                   size_t length,
198*62c56f98SSadaf Ebrahimi                                   size_t *iv_off,
199*62c56f98SSadaf Ebrahimi                                   unsigned char iv[16],
200*62c56f98SSadaf Ebrahimi                                   const unsigned char *input,
201*62c56f98SSadaf Ebrahimi                                   unsigned char *output);
202*62c56f98SSadaf Ebrahimi #endif /* MBEDTLS_CIPHER_MODE_CFB */
203*62c56f98SSadaf Ebrahimi 
204*62c56f98SSadaf Ebrahimi #if defined(MBEDTLS_CIPHER_MODE_CTR)
205*62c56f98SSadaf Ebrahimi /**
206*62c56f98SSadaf Ebrahimi  * \brief      Perform a CAMELLIA-CTR buffer encryption/decryption operation.
207*62c56f98SSadaf Ebrahimi  *
208*62c56f98SSadaf Ebrahimi  * *note       Due to the nature of CTR mode, you should use the same
209*62c56f98SSadaf Ebrahimi  *             key for both encryption and decryption. In particular, calls
210*62c56f98SSadaf Ebrahimi  *             to this function should be preceded by a key-schedule via
211*62c56f98SSadaf Ebrahimi  *             mbedtls_camellia_setkey_enc() regardless of whether the mode
212*62c56f98SSadaf Ebrahimi  *             is #MBEDTLS_CAMELLIA_ENCRYPT or #MBEDTLS_CAMELLIA_DECRYPT.
213*62c56f98SSadaf Ebrahimi  *
214*62c56f98SSadaf Ebrahimi  * \warning    You must never reuse a nonce value with the same key. Doing so
215*62c56f98SSadaf Ebrahimi  *             would void the encryption for the two messages encrypted with
216*62c56f98SSadaf Ebrahimi  *             the same nonce and key.
217*62c56f98SSadaf Ebrahimi  *
218*62c56f98SSadaf Ebrahimi  *             There are two common strategies for managing nonces with CTR:
219*62c56f98SSadaf Ebrahimi  *
220*62c56f98SSadaf Ebrahimi  *             1. You can handle everything as a single message processed over
221*62c56f98SSadaf Ebrahimi  *             successive calls to this function. In that case, you want to
222*62c56f98SSadaf Ebrahimi  *             set \p nonce_counter and \p nc_off to 0 for the first call, and
223*62c56f98SSadaf Ebrahimi  *             then preserve the values of \p nonce_counter, \p nc_off and \p
224*62c56f98SSadaf Ebrahimi  *             stream_block across calls to this function as they will be
225*62c56f98SSadaf Ebrahimi  *             updated by this function.
226*62c56f98SSadaf Ebrahimi  *
227*62c56f98SSadaf Ebrahimi  *             With this strategy, you must not encrypt more than 2**128
228*62c56f98SSadaf Ebrahimi  *             blocks of data with the same key.
229*62c56f98SSadaf Ebrahimi  *
230*62c56f98SSadaf Ebrahimi  *             2. You can encrypt separate messages by dividing the \p
231*62c56f98SSadaf Ebrahimi  *             nonce_counter buffer in two areas: the first one used for a
232*62c56f98SSadaf Ebrahimi  *             per-message nonce, handled by yourself, and the second one
233*62c56f98SSadaf Ebrahimi  *             updated by this function internally.
234*62c56f98SSadaf Ebrahimi  *
235*62c56f98SSadaf Ebrahimi  *             For example, you might reserve the first \c 12 Bytes for the
236*62c56f98SSadaf Ebrahimi  *             per-message nonce, and the last \c 4 Bytes for internal use.
237*62c56f98SSadaf Ebrahimi  *             In that case, before calling this function on a new message you
238*62c56f98SSadaf Ebrahimi  *             need to set the first \c 12 Bytes of \p nonce_counter to your
239*62c56f98SSadaf Ebrahimi  *             chosen nonce value, the last four to \c 0, and \p nc_off to \c 0
240*62c56f98SSadaf Ebrahimi  *             (which will cause \p stream_block to be ignored). That way, you
241*62c56f98SSadaf Ebrahimi  *             can encrypt at most \c 2**96 messages of up to \c 2**32 blocks
242*62c56f98SSadaf Ebrahimi  *             each  with the same key.
243*62c56f98SSadaf Ebrahimi  *
244*62c56f98SSadaf Ebrahimi  *             The per-message nonce (or information sufficient to reconstruct
245*62c56f98SSadaf Ebrahimi  *             it) needs to be communicated with the ciphertext and must be
246*62c56f98SSadaf Ebrahimi  *             unique. The recommended way to ensure uniqueness is to use a
247*62c56f98SSadaf Ebrahimi  *             message counter. An alternative is to generate random nonces,
248*62c56f98SSadaf Ebrahimi  *             but this limits the number of messages that can be securely
249*62c56f98SSadaf Ebrahimi  *             encrypted: for example, with 96-bit random nonces, you should
250*62c56f98SSadaf Ebrahimi  *             not encrypt more than 2**32 messages with the same key.
251*62c56f98SSadaf Ebrahimi  *
252*62c56f98SSadaf Ebrahimi  *             Note that for both strategies, sizes are measured in blocks and
253*62c56f98SSadaf Ebrahimi  *             that a CAMELLIA block is \c 16 Bytes.
254*62c56f98SSadaf Ebrahimi  *
255*62c56f98SSadaf Ebrahimi  * \warning    Upon return, \p stream_block contains sensitive data. Its
256*62c56f98SSadaf Ebrahimi  *             content must not be written to insecure storage and should be
257*62c56f98SSadaf Ebrahimi  *             securely discarded as soon as it's no longer needed.
258*62c56f98SSadaf Ebrahimi  *
259*62c56f98SSadaf Ebrahimi  * \param ctx           The CAMELLIA context to use. This must be initialized
260*62c56f98SSadaf Ebrahimi  *                      and bound to a key.
261*62c56f98SSadaf Ebrahimi  * \param length        The length of the input data \p input in Bytes.
262*62c56f98SSadaf Ebrahimi  *                      Any value is allowed.
263*62c56f98SSadaf Ebrahimi  * \param nc_off        The offset in the current \p stream_block (for resuming
264*62c56f98SSadaf Ebrahimi  *                      within current cipher stream). The offset pointer to
265*62c56f98SSadaf Ebrahimi  *                      should be \c 0 at the start of a stream. It is updated
266*62c56f98SSadaf Ebrahimi  *                      at the end of this call.
267*62c56f98SSadaf Ebrahimi  * \param nonce_counter The 128-bit nonce and counter. This must be a read/write
268*62c56f98SSadaf Ebrahimi  *                      buffer of length \c 16 Bytes.
269*62c56f98SSadaf Ebrahimi  * \param stream_block  The saved stream-block for resuming. This must be a
270*62c56f98SSadaf Ebrahimi  *                      read/write buffer of length \c 16 Bytes.
271*62c56f98SSadaf Ebrahimi  * \param input         The input data stream. This must be a readable buffer of
272*62c56f98SSadaf Ebrahimi  *                      size \p length Bytes.
273*62c56f98SSadaf Ebrahimi  * \param output        The output data stream. This must be a writable buffer
274*62c56f98SSadaf Ebrahimi  *                      of size \p length Bytes.
275*62c56f98SSadaf Ebrahimi  *
276*62c56f98SSadaf Ebrahimi  * \return              \c 0 if successful.
277*62c56f98SSadaf Ebrahimi  * \return              A negative error code on failure.
278*62c56f98SSadaf Ebrahimi  */
279*62c56f98SSadaf Ebrahimi int mbedtls_camellia_crypt_ctr(mbedtls_camellia_context *ctx,
280*62c56f98SSadaf Ebrahimi                                size_t length,
281*62c56f98SSadaf Ebrahimi                                size_t *nc_off,
282*62c56f98SSadaf Ebrahimi                                unsigned char nonce_counter[16],
283*62c56f98SSadaf Ebrahimi                                unsigned char stream_block[16],
284*62c56f98SSadaf Ebrahimi                                const unsigned char *input,
285*62c56f98SSadaf Ebrahimi                                unsigned char *output);
286*62c56f98SSadaf Ebrahimi #endif /* MBEDTLS_CIPHER_MODE_CTR */
287*62c56f98SSadaf Ebrahimi 
288*62c56f98SSadaf Ebrahimi #if defined(MBEDTLS_SELF_TEST)
289*62c56f98SSadaf Ebrahimi 
290*62c56f98SSadaf Ebrahimi /**
291*62c56f98SSadaf Ebrahimi  * \brief          Checkup routine
292*62c56f98SSadaf Ebrahimi  *
293*62c56f98SSadaf Ebrahimi  * \return         0 if successful, or 1 if the test failed
294*62c56f98SSadaf Ebrahimi  */
295*62c56f98SSadaf Ebrahimi int mbedtls_camellia_self_test(int verbose);
296*62c56f98SSadaf Ebrahimi 
297*62c56f98SSadaf Ebrahimi #endif /* MBEDTLS_SELF_TEST */
298*62c56f98SSadaf Ebrahimi 
299*62c56f98SSadaf Ebrahimi #ifdef __cplusplus
300*62c56f98SSadaf Ebrahimi }
301*62c56f98SSadaf Ebrahimi #endif
302*62c56f98SSadaf Ebrahimi 
303*62c56f98SSadaf Ebrahimi #endif /* camellia.h */
304