mbed TLS v2.14.1
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
include
mbedtls
aria.h
Go to the documentation of this file.
1
12
/* Copyright (C) 2006-2018, ARM Limited, All Rights Reserved
13
* SPDX-License-Identifier: Apache-2.0
14
*
15
* Licensed under the Apache License, Version 2.0 (the "License"); you may
16
* not use this file except in compliance with the License.
17
* You may obtain a copy of the License at
18
*
19
* http://www.apache.org/licenses/LICENSE-2.0
20
*
21
* Unless required by applicable law or agreed to in writing, software
22
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
23
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
* See the License for the specific language governing permissions and
25
* limitations under the License.
26
*
27
* This file is part of mbed TLS (https://tls.mbed.org)
28
*/
29
30
#ifndef MBEDTLS_ARIA_H
31
#define MBEDTLS_ARIA_H
32
33
#if !defined(MBEDTLS_CONFIG_FILE)
34
#include "
config.h
"
35
#else
36
#include MBEDTLS_CONFIG_FILE
37
#endif
38
39
#include <stddef.h>
40
#include <stdint.h>
41
42
#define MBEDTLS_ARIA_ENCRYPT 1
43
#define MBEDTLS_ARIA_DECRYPT 0
45
#define MBEDTLS_ARIA_BLOCKSIZE 16
46
#define MBEDTLS_ARIA_MAX_ROUNDS 16
47
#define MBEDTLS_ARIA_MAX_KEYSIZE 32
49
#define MBEDTLS_ERR_ARIA_INVALID_KEY_LENGTH -0x005C
50
#define MBEDTLS_ERR_ARIA_INVALID_INPUT_LENGTH -0x005E
52
/* MBEDTLS_ERR_ARIA_FEATURE_UNAVAILABLE is deprecated and should not be used.
53
*/
54
#define MBEDTLS_ERR_ARIA_FEATURE_UNAVAILABLE -0x005A
56
/* MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED is deprecated and should not be used. */
57
#define MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED -0x0058
59
#if !defined(MBEDTLS_ARIA_ALT)
60
// Regular implementation
61
//
62
63
#ifdef __cplusplus
64
extern
"C"
{
65
#endif
66
70
typedef
struct
mbedtls_aria_context
71
{
72
unsigned
char
nr
;
74
uint32_t
rk
[
MBEDTLS_ARIA_MAX_ROUNDS
+ 1][
MBEDTLS_ARIA_BLOCKSIZE
/ 4];
75
}
76
mbedtls_aria_context
;
77
78
#else
/* MBEDTLS_ARIA_ALT */
79
#include "aria_alt.h"
80
#endif
/* MBEDTLS_ARIA_ALT */
81
90
void
mbedtls_aria_init
(
mbedtls_aria_context
*ctx );
91
97
void
mbedtls_aria_free
(
mbedtls_aria_context
*ctx );
98
112
int
mbedtls_aria_setkey_enc
(
mbedtls_aria_context
*ctx,
113
const
unsigned
char
*key,
114
unsigned
int
keybits );
115
128
int
mbedtls_aria_setkey_dec
(
mbedtls_aria_context
*ctx,
129
const
unsigned
char
*key,
130
unsigned
int
keybits );
131
150
int
mbedtls_aria_crypt_ecb
(
mbedtls_aria_context
*ctx,
151
const
unsigned
char
input[
MBEDTLS_ARIA_BLOCKSIZE
],
152
unsigned
char
output[MBEDTLS_ARIA_BLOCKSIZE] );
153
154
#if defined(MBEDTLS_CIPHER_MODE_CBC)
155
191
int
mbedtls_aria_crypt_cbc
(
mbedtls_aria_context
*ctx,
192
int
mode,
193
size_t
length,
194
unsigned
char
iv[
MBEDTLS_ARIA_BLOCKSIZE
],
195
const
unsigned
char
*input,
196
unsigned
char
*output );
197
#endif
/* MBEDTLS_CIPHER_MODE_CBC */
198
199
#if defined(MBEDTLS_CIPHER_MODE_CFB)
200
234
int
mbedtls_aria_crypt_cfb128
(
mbedtls_aria_context
*ctx,
235
int
mode,
236
size_t
length,
237
size_t
*iv_off,
238
unsigned
char
iv[
MBEDTLS_ARIA_BLOCKSIZE
],
239
const
unsigned
char
*input,
240
unsigned
char
*output );
241
#endif
/* MBEDTLS_CIPHER_MODE_CFB */
242
243
#if defined(MBEDTLS_CIPHER_MODE_CTR)
244
314
int
mbedtls_aria_crypt_ctr
(
mbedtls_aria_context
*ctx,
315
size_t
length,
316
size_t
*nc_off,
317
unsigned
char
nonce_counter[
MBEDTLS_ARIA_BLOCKSIZE
],
318
unsigned
char
stream_block[MBEDTLS_ARIA_BLOCKSIZE],
319
const
unsigned
char
*input,
320
unsigned
char
*output );
321
#endif
/* MBEDTLS_CIPHER_MODE_CTR */
322
323
#if defined(MBEDTLS_SELF_TEST)
324
329
int
mbedtls_aria_self_test
(
int
verbose );
330
#endif
/* MBEDTLS_SELF_TEST */
331
332
#ifdef __cplusplus
333
}
334
#endif
335
336
#endif
/* aria.h */
Generated on Mon Jun 27 2022 04:24:25 for mbed TLS v2.14.1 by
1.8.1.2