Mbed TLS v3.5.2
Loading...
Searching...
No Matches
aria.h
Go to the documentation of this file.
1
12/*
13 * Copyright The Mbed TLS Contributors
14 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
15 */
16
17#ifndef MBEDTLS_ARIA_H
18#define MBEDTLS_ARIA_H
20
21#include "mbedtls/build_info.h"
22
23#include <stddef.h>
24#include <stdint.h>
25
27
28#define MBEDTLS_ARIA_ENCRYPT 1
29#define MBEDTLS_ARIA_DECRYPT 0
31#define MBEDTLS_ARIA_BLOCKSIZE 16
32#define MBEDTLS_ARIA_MAX_ROUNDS 16
33#define MBEDTLS_ARIA_MAX_KEYSIZE 32
36#define MBEDTLS_ERR_ARIA_BAD_INPUT_DATA -0x005C
37
39#define MBEDTLS_ERR_ARIA_INVALID_INPUT_LENGTH -0x005E
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45#if !defined(MBEDTLS_ARIA_ALT)
46// Regular implementation
47//
48
52typedef struct mbedtls_aria_context {
53 unsigned char MBEDTLS_PRIVATE(nr);
56}
58
59#else /* MBEDTLS_ARIA_ALT */
60#include "aria_alt.h"
61#endif /* MBEDTLS_ARIA_ALT */
62
72
81
98 const unsigned char *key,
99 unsigned int keybits);
100
117 const unsigned char *key,
118 unsigned int keybits);
119
141 const unsigned char input[MBEDTLS_ARIA_BLOCKSIZE],
142 unsigned char output[MBEDTLS_ARIA_BLOCKSIZE]);
143
144#if defined(MBEDTLS_CIPHER_MODE_CBC)
187 int mode,
188 size_t length,
189 unsigned char iv[MBEDTLS_ARIA_BLOCKSIZE],
190 const unsigned char *input,
191 unsigned char *output);
192#endif /* MBEDTLS_CIPHER_MODE_CBC */
193
194#if defined(MBEDTLS_CIPHER_MODE_CFB)
237 int mode,
238 size_t length,
239 size_t *iv_off,
240 unsigned char iv[MBEDTLS_ARIA_BLOCKSIZE],
241 const unsigned char *input,
242 unsigned char *output);
243#endif /* MBEDTLS_CIPHER_MODE_CFB */
244
245#if defined(MBEDTLS_CIPHER_MODE_CTR)
320 size_t length,
321 size_t *nc_off,
322 unsigned char nonce_counter[MBEDTLS_ARIA_BLOCKSIZE],
323 unsigned char stream_block[MBEDTLS_ARIA_BLOCKSIZE],
324 const unsigned char *input,
325 unsigned char *output);
326#endif /* MBEDTLS_CIPHER_MODE_CTR */
327
328#if defined(MBEDTLS_SELF_TEST)
334int mbedtls_aria_self_test(int verbose);
335#endif /* MBEDTLS_SELF_TEST */
336
337#ifdef __cplusplus
338}
339#endif
340
341#endif /* aria.h */
int mbedtls_aria_self_test(int verbose)
Checkup routine.
int mbedtls_aria_crypt_cbc(mbedtls_aria_context *ctx, int mode, size_t length, unsigned char iv[MBEDTLS_ARIA_BLOCKSIZE], const unsigned char *input, unsigned char *output)
This function performs an ARIA-CBC encryption or decryption operation on full blocks.
int mbedtls_aria_crypt_cfb128(mbedtls_aria_context *ctx, int mode, size_t length, size_t *iv_off, unsigned char iv[MBEDTLS_ARIA_BLOCKSIZE], const unsigned char *input, unsigned char *output)
This function performs an ARIA-CFB128 encryption or decryption operation.
void mbedtls_aria_init(mbedtls_aria_context *ctx)
This function initializes the specified ARIA context.
int mbedtls_aria_setkey_dec(mbedtls_aria_context *ctx, const unsigned char *key, unsigned int keybits)
This function sets the decryption key.
#define MBEDTLS_ARIA_BLOCKSIZE
Definition aria.h:31
int mbedtls_aria_crypt_ecb(mbedtls_aria_context *ctx, const unsigned char input[MBEDTLS_ARIA_BLOCKSIZE], unsigned char output[MBEDTLS_ARIA_BLOCKSIZE])
This function performs an ARIA single-block encryption or decryption operation.
void mbedtls_aria_free(mbedtls_aria_context *ctx)
This function releases and clears the specified ARIA context.
int mbedtls_aria_setkey_enc(mbedtls_aria_context *ctx, const unsigned char *key, unsigned int keybits)
This function sets the encryption key.
#define MBEDTLS_ARIA_MAX_ROUNDS
Definition aria.h:32
int mbedtls_aria_crypt_ctr(mbedtls_aria_context *ctx, size_t length, size_t *nc_off, unsigned char nonce_counter[MBEDTLS_ARIA_BLOCKSIZE], unsigned char stream_block[MBEDTLS_ARIA_BLOCKSIZE], const unsigned char *input, unsigned char *output)
This function performs an ARIA-CTR encryption or decryption operation.
Build-time configuration info.
Common and shared functions used by multiple modules in the Mbed TLS library.
Macro wrapper for struct's members.
#define MBEDTLS_PRIVATE(member)
The ARIA context-type definition.
Definition aria.h:52