blob: fa175f07c15225aa6df119a5a01be942f1147f65 [file] [log] [blame]
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +00001/**
2 * \file aria.h
3 *
4 * \brief ARIA block cipher
5 *
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +01006 * The ARIA algorithm is a symmetric block cipher that can encrypt and
7 * decrypt information. It is defined by the Korean Agency for
8 * Technology and Standards (KATS) in <em>KS X 1213:2004</em> (in
9 * Korean, but see http://210.104.33.10/ARIA/index-e.html in English)
10 * and also described by the IETF in <em>RFC 5794</em>.
11 */
Bence Szépkúti86974652020-06-15 11:59:37 +020012/*
Bence Szépkúti1e148272020-08-07 13:07:28 +020013 * Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +000014 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000015 */
16
17#ifndef MBEDTLS_ARIA_H
18#define MBEDTLS_ARIA_H
Mateusz Starzyk846f0212021-05-19 19:44:07 +020019#include "mbedtls/private_access.h"
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000020
Bence Szépkútic662b362021-05-27 11:25:03 +020021#include "mbedtls/build_info.h"
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000022
23#include <stddef.h>
24#include <stdint.h>
25
Jaeden Ameroc49fbbf2019-07-04 20:01:14 +010026#include "mbedtls/platform_util.h"
Andrzej Kurekc470b6b2019-01-31 08:20:20 -050027
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +010028#define MBEDTLS_ARIA_ENCRYPT 1 /**< ARIA encryption. */
29#define MBEDTLS_ARIA_DECRYPT 0 /**< ARIA decryption. */
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000030
Manuel Pégourié-Gonnard8abc3492018-03-01 10:02:47 +010031#define MBEDTLS_ARIA_BLOCKSIZE 16 /**< ARIA block size in bytes. */
Shaun Case8b0ecbc2021-12-20 21:14:10 -080032#define MBEDTLS_ARIA_MAX_ROUNDS 16 /**< Maximum number of rounds in ARIA. */
Manuel Pégourié-Gonnard8abc3492018-03-01 10:02:47 +010033#define MBEDTLS_ARIA_MAX_KEYSIZE 32 /**< Maximum size of an ARIA key in bytes. */
Manuel Pégourié-Gonnard5ad88b62018-03-01 09:20:47 +010034
Gilles Peskined2971572021-07-26 18:48:10 +020035/** Bad input data. */
36#define MBEDTLS_ERR_ARIA_BAD_INPUT_DATA -0x005C
Andrzej Kurekc470b6b2019-01-31 08:20:20 -050037
Gilles Peskined2971572021-07-26 18:48:10 +020038/** Invalid data input length. */
39#define MBEDTLS_ERR_ARIA_INVALID_INPUT_LENGTH -0x005E
Ron Eldor9924bdc2018-10-04 10:59:13 +030040
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000041#ifdef __cplusplus
42extern "C" {
43#endif
44
45/**
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +010046 * \brief The ARIA context-type definition.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000047 */
Gilles Peskine449bd832023-01-11 14:50:10 +010048typedef struct mbedtls_aria_context {
Mateusz Starzyk846f0212021-05-19 19:44:07 +020049 unsigned char MBEDTLS_PRIVATE(nr); /*!< The number of rounds (12, 14 or 16) */
Manuel Pégourié-Gonnard5ad88b62018-03-01 09:20:47 +010050 /*! The ARIA round keys. */
Mateusz Starzyk846f0212021-05-19 19:44:07 +020051 uint32_t MBEDTLS_PRIVATE(rk)[MBEDTLS_ARIA_MAX_ROUNDS + 1][MBEDTLS_ARIA_BLOCKSIZE / 4];
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000052}
53mbedtls_aria_context;
54
55/**
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +010056 * \brief This function initializes the specified ARIA context.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000057 *
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +010058 * It must be the first API called before using
59 * the context.
60 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -050061 * \param ctx The ARIA context to initialize. This must not be \c NULL.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000062 */
Gilles Peskine449bd832023-01-11 14:50:10 +010063void mbedtls_aria_init(mbedtls_aria_context *ctx);
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000064
65/**
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +010066 * \brief This function releases and clears the specified ARIA context.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000067 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -050068 * \param ctx The ARIA context to clear. This may be \c NULL, in which
69 * case this function returns immediately. If it is not \c NULL,
70 * it must point to an initialized ARIA context.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000071 */
Gilles Peskine449bd832023-01-11 14:50:10 +010072void mbedtls_aria_free(mbedtls_aria_context *ctx);
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000073
74/**
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +010075 * \brief This function sets the encryption key.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000076 *
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +010077 * \param ctx The ARIA context to which the key should be bound.
Andrzej Kurekc470b6b2019-01-31 08:20:20 -050078 * This must be initialized.
79 * \param key The encryption key. This must be a readable buffer
80 * of size \p keybits Bits.
81 * \param keybits The size of \p key in Bits. Valid options are:
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +010082 * <ul><li>128 bits</li>
83 * <li>192 bits</li>
84 * <li>256 bits</li></ul>
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000085 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -050086 * \return \c 0 on success.
87 * \return A negative error code on failure.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000088 */
Gilles Peskine449bd832023-01-11 14:50:10 +010089int mbedtls_aria_setkey_enc(mbedtls_aria_context *ctx,
90 const unsigned char *key,
91 unsigned int keybits);
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000092
Yanray Wangb67b4742023-10-31 17:10:32 +080093#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000094/**
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +010095 * \brief This function sets the decryption key.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +000096 *
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +010097 * \param ctx The ARIA context to which the key should be bound.
Andrzej Kurekc470b6b2019-01-31 08:20:20 -050098 * This must be initialized.
99 * \param key The decryption key. This must be a readable buffer
100 * of size \p keybits Bits.
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100101 * \param keybits The size of data passed. Valid options are:
102 * <ul><li>128 bits</li>
103 * <li>192 bits</li>
104 * <li>256 bits</li></ul>
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000105 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500106 * \return \c 0 on success.
107 * \return A negative error code on failure.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000108 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100109int mbedtls_aria_setkey_dec(mbedtls_aria_context *ctx,
110 const unsigned char *key,
111 unsigned int keybits);
Yanray Wangb67b4742023-10-31 17:10:32 +0800112#endif /* !MBEDTLS_BLOCK_CIPHER_NO_DECRYPT */
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000113
114/**
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100115 * \brief This function performs an ARIA single-block encryption or
116 * decryption operation.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000117 *
Manuel Pégourié-Gonnard08c337d2018-05-22 13:18:01 +0200118 * It performs encryption or decryption (depending on whether
119 * the key was set for encryption on decryption) on the input
120 * data buffer defined in the \p input parameter.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000121 *
Manuel Pégourié-Gonnard9d410732018-05-22 12:49:22 +0200122 * mbedtls_aria_init(), and either mbedtls_aria_setkey_enc() or
123 * mbedtls_aria_setkey_dec() must be called before the first
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100124 * call to this API with the same context.
125 *
126 * \param ctx The ARIA context to use for encryption or decryption.
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500127 * This must be initialized and bound to a key.
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100128 * \param input The 16-Byte buffer holding the input data.
129 * \param output The 16-Byte buffer holding the output data.
130
131 * \return \c 0 on success.
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500132 * \return A negative error code on failure.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000133 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100134int mbedtls_aria_crypt_ecb(mbedtls_aria_context *ctx,
135 const unsigned char input[MBEDTLS_ARIA_BLOCKSIZE],
136 unsigned char output[MBEDTLS_ARIA_BLOCKSIZE]);
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000137
138#if defined(MBEDTLS_CIPHER_MODE_CBC)
139/**
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100140 * \brief This function performs an ARIA-CBC encryption or decryption operation
141 * on full blocks.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000142 *
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100143 * It performs the operation defined in the \p mode
144 * parameter (encrypt/decrypt), on the input data buffer defined in
145 * the \p input parameter.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000146 *
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100147 * It can be called as many times as needed, until all the input
Manuel Pégourié-Gonnard9d410732018-05-22 12:49:22 +0200148 * data is processed. mbedtls_aria_init(), and either
149 * mbedtls_aria_setkey_enc() or mbedtls_aria_setkey_dec() must be called
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100150 * before the first call to this API with the same context.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000151 *
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100152 * \note This function operates on aligned blocks, that is, the input size
153 * must be a multiple of the ARIA block size of 16 Bytes.
154 *
155 * \note Upon exit, the content of the IV is updated so that you can
156 * call the same function again on the next
157 * block(s) of data and get the same result as if it was
158 * encrypted in one call. This allows a "streaming" usage.
159 * If you need to retain the contents of the IV, you should
160 * either save it manually or use the cipher module instead.
161 *
162 *
163 * \param ctx The ARIA context to use for encryption or decryption.
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500164 * This must be initialized and bound to a key.
165 * \param mode The mode of operation. This must be either
166 * #MBEDTLS_ARIA_ENCRYPT for encryption, or
167 * #MBEDTLS_ARIA_DECRYPT for decryption.
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100168 * \param length The length of the input data in Bytes. This must be a
169 * multiple of the block size (16 Bytes).
170 * \param iv Initialization vector (updated after use).
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500171 * This must be a readable buffer of size 16 Bytes.
172 * \param input The buffer holding the input data. This must
173 * be a readable buffer of length \p length Bytes.
174 * \param output The buffer holding the output data. This must
175 * be a writable buffer of length \p length Bytes.
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100176 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500177 * \return \c 0 on success.
178 * \return A negative error code on failure.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000179 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100180int mbedtls_aria_crypt_cbc(mbedtls_aria_context *ctx,
181 int mode,
182 size_t length,
183 unsigned char iv[MBEDTLS_ARIA_BLOCKSIZE],
184 const unsigned char *input,
185 unsigned char *output);
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000186#endif /* MBEDTLS_CIPHER_MODE_CBC */
187
188#if defined(MBEDTLS_CIPHER_MODE_CFB)
189/**
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100190 * \brief This function performs an ARIA-CFB128 encryption or decryption
191 * operation.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000192 *
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100193 * It performs the operation defined in the \p mode
194 * parameter (encrypt or decrypt), on the input data buffer
195 * defined in the \p input parameter.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000196 *
Manuel Pégourié-Gonnard9d410732018-05-22 12:49:22 +0200197 * For CFB, you must set up the context with mbedtls_aria_setkey_enc(),
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100198 * regardless of whether you are performing an encryption or decryption
199 * operation, that is, regardless of the \p mode parameter. This is
200 * because CFB mode uses the same key schedule for encryption and
201 * decryption.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000202 *
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100203 * \note Upon exit, the content of the IV is updated so that you can
204 * call the same function again on the next
205 * block(s) of data and get the same result as if it was
206 * encrypted in one call. This allows a "streaming" usage.
207 * If you need to retain the contents of the
208 * IV, you must either save it manually or use the cipher
209 * module instead.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000210 *
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100211 *
212 * \param ctx The ARIA context to use for encryption or decryption.
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500213 * This must be initialized and bound to a key.
214 * \param mode The mode of operation. This must be either
215 * #MBEDTLS_ARIA_ENCRYPT for encryption, or
216 * #MBEDTLS_ARIA_DECRYPT for decryption.
217 * \param length The length of the input data \p input in Bytes.
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100218 * \param iv_off The offset in IV (updated after use).
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500219 * This must not be larger than 15.
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100220 * \param iv The initialization vector (updated after use).
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500221 * This must be a readable buffer of size 16 Bytes.
222 * \param input The buffer holding the input data. This must
223 * be a readable buffer of length \p length Bytes.
224 * \param output The buffer holding the output data. This must
225 * be a writable buffer of length \p length Bytes.
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100226 *
227 * \return \c 0 on success.
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500228 * \return A negative error code on failure.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000229 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100230int mbedtls_aria_crypt_cfb128(mbedtls_aria_context *ctx,
231 int mode,
232 size_t length,
233 size_t *iv_off,
234 unsigned char iv[MBEDTLS_ARIA_BLOCKSIZE],
235 const unsigned char *input,
236 unsigned char *output);
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000237#endif /* MBEDTLS_CIPHER_MODE_CFB */
238
239#if defined(MBEDTLS_CIPHER_MODE_CTR)
240/**
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100241 * \brief This function performs an ARIA-CTR encryption or decryption
242 * operation.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000243 *
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100244 * Due to the nature of CTR, you must use the same key schedule
245 * for both encryption and decryption operations. Therefore, you
Manuel Pégourié-Gonnard9d410732018-05-22 12:49:22 +0200246 * must use the context initialized with mbedtls_aria_setkey_enc()
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100247 * for both #MBEDTLS_ARIA_ENCRYPT and #MBEDTLS_ARIA_DECRYPT.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000248 *
Manuel Pégourié-Gonnard22997b72018-02-28 12:29:41 +0100249 * \warning You must never reuse a nonce value with the same key. Doing so
250 * would void the encryption for the two messages encrypted with
251 * the same nonce and key.
252 *
253 * There are two common strategies for managing nonces with CTR:
254 *
Manuel Pégourié-Gonnard8a1b2c82018-05-23 13:26:22 +0200255 * 1. You can handle everything as a single message processed over
256 * successive calls to this function. In that case, you want to
257 * set \p nonce_counter and \p nc_off to 0 for the first call, and
258 * then preserve the values of \p nonce_counter, \p nc_off and \p
259 * stream_block across calls to this function as they will be
260 * updated by this function.
261 *
262 * With this strategy, you must not encrypt more than 2**128
Manuel Pégourié-Gonnardf5842862018-05-24 11:51:58 +0200263 * blocks of data with the same key.
Manuel Pégourié-Gonnard22997b72018-02-28 12:29:41 +0100264 *
Manuel Pégourié-Gonnard8a1b2c82018-05-23 13:26:22 +0200265 * 2. You can encrypt separate messages by dividing the \p
266 * nonce_counter buffer in two areas: the first one used for a
267 * per-message nonce, handled by yourself, and the second one
268 * updated by this function internally.
269 *
270 * For example, you might reserve the first 12 bytes for the
271 * per-message nonce, and the last 4 bytes for internal use. In that
272 * case, before calling this function on a new message you need to
273 * set the first 12 bytes of \p nonce_counter to your chosen nonce
274 * value, the last 4 to 0, and \p nc_off to 0 (which will cause \p
275 * stream_block to be ignored). That way, you can encrypt at most
Manuel Pégourié-Gonnardf5842862018-05-24 11:51:58 +0200276 * 2**96 messages of up to 2**32 blocks each with the same key.
Manuel Pégourié-Gonnard8a1b2c82018-05-23 13:26:22 +0200277 *
278 * The per-message nonce (or information sufficient to reconstruct
279 * it) needs to be communicated with the ciphertext and must be unique.
280 * The recommended way to ensure uniqueness is to use a message
281 * counter. An alternative is to generate random nonces, but this
282 * limits the number of messages that can be securely encrypted:
283 * for example, with 96-bit random nonces, you should not encrypt
284 * more than 2**32 messages with the same key.
285 *
Tom Cosgrove1e211442022-05-26 11:51:00 +0100286 * Note that for both strategies, sizes are measured in blocks and
Manuel Pégourié-Gonnardf5842862018-05-24 11:51:58 +0200287 * that an ARIA block is 16 bytes.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000288 *
Manuel Pégourié-Gonnardfa0c47d2018-05-24 19:02:06 +0200289 * \warning Upon return, \p stream_block contains sensitive data. Its
Manuel Pégourié-Gonnard8a1b2c82018-05-23 13:26:22 +0200290 * content must not be written to insecure storage and should be
291 * securely discarded as soon as it's no longer needed.
292 *
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100293 * \param ctx The ARIA context to use for encryption or decryption.
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500294 * This must be initialized and bound to a key.
295 * \param length The length of the input data \p input in Bytes.
296 * \param nc_off The offset in Bytes in the current \p stream_block,
297 * for resuming within the current cipher stream. The
298 * offset pointer should be \c 0 at the start of a
299 * stream. This must not be larger than \c 15 Bytes.
300 * \param nonce_counter The 128-bit nonce and counter. This must point to
301 * a read/write buffer of length \c 16 bytes.
302 * \param stream_block The saved stream block for resuming. This must
303 * point to a read/write buffer of length \c 16 bytes.
304 * This is overwritten by the function.
305 * \param input The buffer holding the input data. This must
306 * be a readable buffer of length \p length Bytes.
307 * \param output The buffer holding the output data. This must
308 * be a writable buffer of length \p length Bytes.
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100309 *
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500310 * \return \c 0 on success.
311 * \return A negative error code on failure.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000312 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100313int mbedtls_aria_crypt_ctr(mbedtls_aria_context *ctx,
314 size_t length,
315 size_t *nc_off,
316 unsigned char nonce_counter[MBEDTLS_ARIA_BLOCKSIZE],
317 unsigned char stream_block[MBEDTLS_ARIA_BLOCKSIZE],
318 const unsigned char *input,
319 unsigned char *output);
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000320#endif /* MBEDTLS_CIPHER_MODE_CTR */
321
Manuel Pégourié-Gonnardc0893122018-05-22 15:17:20 +0200322#if defined(MBEDTLS_SELF_TEST)
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000323/**
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100324 * \brief Checkup routine.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000325 *
Manuel Pégourié-Gonnard5aa4e3b2018-02-28 11:55:49 +0100326 * \return \c 0 on success, or \c 1 on failure.
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000327 */
Gilles Peskine449bd832023-01-11 14:50:10 +0100328int mbedtls_aria_self_test(int verbose);
Manuel Pégourié-Gonnardc0893122018-05-22 15:17:20 +0200329#endif /* MBEDTLS_SELF_TEST */
Markku-Juhani O. Saarinen41efbaa2017-11-30 11:37:55 +0000330
331#ifdef __cplusplus
332}
333#endif
334
335#endif /* aria.h */