ReactOS  0.4.15-dev-3428-g0609db5
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  * This file is provided under the Apache License 2.0, or the
17  * GNU General Public License v2.0 or later.
18  *
19  * **********
20  * Apache License 2.0:
21  *
22  * Licensed under the Apache License, Version 2.0 (the "License"); you may
23  * not use this file except in compliance with the License.
24  * You may obtain a copy of the License at
25  *
26  * http://www.apache.org/licenses/LICENSE-2.0
27  *
28  * Unless required by applicable law or agreed to in writing, software
29  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
30  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  * See the License for the specific language governing permissions and
32  * limitations under the License.
33  *
34  * **********
35  *
36  * **********
37  * GNU General Public License v2.0 or later:
38  *
39  * This program is free software; you can redistribute it and/or modify
40  * it under the terms of the GNU General Public License as published by
41  * the Free Software Foundation; either version 2 of the License, or
42  * (at your option) any later version.
43  *
44  * This program is distributed in the hope that it will be useful,
45  * but WITHOUT ANY WARRANTY; without even the implied warranty of
46  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47  * GNU General Public License for more details.
48  *
49  * You should have received a copy of the GNU General Public License along
50  * with this program; if not, write to the Free Software Foundation, Inc.,
51  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
52  *
53  * **********
54  */
55 
56 #ifndef MBEDTLS_ARIA_H
57 #define MBEDTLS_ARIA_H
58 
59 #if !defined(MBEDTLS_CONFIG_FILE)
60 #include "config.h"
61 #else
62 #include MBEDTLS_CONFIG_FILE
63 #endif
64 
65 #include <stddef.h>
66 #include <stdint.h>
67 
68 #include "platform_util.h"
69 
70 #define MBEDTLS_ARIA_ENCRYPT 1
71 #define MBEDTLS_ARIA_DECRYPT 0
73 #define MBEDTLS_ARIA_BLOCKSIZE 16
74 #define MBEDTLS_ARIA_MAX_ROUNDS 16
75 #define MBEDTLS_ARIA_MAX_KEYSIZE 32
77 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
78 #define MBEDTLS_ERR_ARIA_INVALID_KEY_LENGTH MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( -0x005C )
79 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
80 #define MBEDTLS_ERR_ARIA_BAD_INPUT_DATA -0x005C
82 #define MBEDTLS_ERR_ARIA_INVALID_INPUT_LENGTH -0x005E
84 /* MBEDTLS_ERR_ARIA_FEATURE_UNAVAILABLE is deprecated and should not be used.
85  */
86 #define MBEDTLS_ERR_ARIA_FEATURE_UNAVAILABLE -0x005A
88 /* MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED is deprecated and should not be used. */
89 #define MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED -0x0058
91 #ifdef __cplusplus
92 extern "C" {
93 #endif
94 
95 #if !defined(MBEDTLS_ARIA_ALT)
96 // Regular implementation
97 //
98 
102 typedef struct mbedtls_aria_context
103 {
104  unsigned char nr;
107 }
109 
110 #else /* MBEDTLS_ARIA_ALT */
111 #include "aria_alt.h"
112 #endif /* MBEDTLS_ARIA_ALT */
113 
123 
132 
149  const unsigned char *key,
150  unsigned int keybits );
151 
168  const unsigned char *key,
169  unsigned int keybits );
170 
192  const unsigned char input[MBEDTLS_ARIA_BLOCKSIZE],
193  unsigned char output[MBEDTLS_ARIA_BLOCKSIZE] );
194 
195 #if defined(MBEDTLS_CIPHER_MODE_CBC)
196 
238  int mode,
239  size_t length,
240  unsigned char iv[MBEDTLS_ARIA_BLOCKSIZE],
241  const unsigned char *input,
242  unsigned char *output );
243 #endif /* MBEDTLS_CIPHER_MODE_CBC */
244 
245 #if defined(MBEDTLS_CIPHER_MODE_CFB)
246 
288  int mode,
289  size_t length,
290  size_t *iv_off,
291  unsigned char iv[MBEDTLS_ARIA_BLOCKSIZE],
292  const unsigned char *input,
293  unsigned char *output );
294 #endif /* MBEDTLS_CIPHER_MODE_CFB */
295 
296 #if defined(MBEDTLS_CIPHER_MODE_CTR)
297 
375  size_t length,
376  size_t *nc_off,
377  unsigned char nonce_counter[MBEDTLS_ARIA_BLOCKSIZE],
378  unsigned char stream_block[MBEDTLS_ARIA_BLOCKSIZE],
379  const unsigned char *input,
380  unsigned char *output );
381 #endif /* MBEDTLS_CIPHER_MODE_CTR */
382 
383 #if defined(MBEDTLS_SELF_TEST)
384 
389 int mbedtls_aria_self_test( int verbose );
390 #endif /* MBEDTLS_SELF_TEST */
391 
392 #ifdef __cplusplus
393 }
394 #endif
395 
396 #endif /* aria.h */
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
unsigned char nr
Definition: aria.h:104
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.
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_MAX_ROUNDS
Definition: aria.h:74
#define verbose
Definition: rosglue.h:36
Common and shared functions used by multiple modules in the Mbed TLS library.
The ARIA context-type definition.
Definition: aria.h:102
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
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.
uint32_t rk[MBEDTLS_ARIA_MAX_ROUNDS+1][MBEDTLS_ARIA_BLOCKSIZE/4]
Definition: aria.h:106
GLenum mode
Definition: glext.h:6217
#define MBEDTLS_ARIA_BLOCKSIZE
Definition: aria.h:73
GLenum GLenum GLenum input
Definition: glext.h:9031
UINT32 uint32_t
Definition: types.h:75
void mbedtls_aria_free(mbedtls_aria_context *ctx)
This function releases and clears the specified ARIA context.
struct mbedtls_aria_context mbedtls_aria_context
The ARIA context-type definition.
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.
int mbedtls_aria_setkey_enc(mbedtls_aria_context *ctx, const unsigned char *key, unsigned int keybits)
This function sets the encryption key.
void mbedtls_aria_init(mbedtls_aria_context *ctx)
This function initializes the specified ARIA context.
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.
Definition: path.c:41