ARIA block cipher. More...
Go to the source code of this file.
Classes | |
struct | mbedtls_aria_context |
The ARIA context-type definition. More... | |
Macros | |
#define | MBEDTLS_ARIA_ENCRYPT 1 |
#define | MBEDTLS_ARIA_DECRYPT 0 |
#define | MBEDTLS_ARIA_BLOCKSIZE 16 |
#define | MBEDTLS_ARIA_MAX_ROUNDS 16 |
#define | MBEDTLS_ARIA_MAX_KEYSIZE 32 |
#define | MBEDTLS_ERR_ARIA_INVALID_KEY_LENGTH MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( -0x005C ) |
#define | MBEDTLS_ERR_ARIA_BAD_INPUT_DATA -0x005C |
#define | MBEDTLS_ERR_ARIA_INVALID_INPUT_LENGTH -0x005E |
#define | MBEDTLS_ERR_ARIA_FEATURE_UNAVAILABLE -0x005A |
#define | MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED -0x0058 |
Typedefs | |
typedef struct mbedtls_aria_context | mbedtls_aria_context |
The ARIA context-type definition. More... | |
Functions | |
void | mbedtls_aria_init (mbedtls_aria_context *ctx) |
This function initializes the specified ARIA context. More... | |
void | mbedtls_aria_free (mbedtls_aria_context *ctx) |
This function releases and clears the specified ARIA context. More... | |
int | mbedtls_aria_setkey_enc (mbedtls_aria_context *ctx, const unsigned char *key, unsigned int keybits) |
This function sets the encryption key. More... | |
int | mbedtls_aria_setkey_dec (mbedtls_aria_context *ctx, const unsigned char *key, unsigned int keybits) |
This function sets the decryption key. More... | |
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. More... | |
ARIA block cipher.
The ARIA algorithm is a symmetric block cipher that can encrypt and decrypt information. It is defined by the Korean Agency for Technology and Standards (KATS) in <em>KS X 1213:2004</em> (in Korean, but see http://210.104.33.10/ARIA/index-e.html in English) and also described by the IETF in <em>RFC 5794</em>.
#define MBEDTLS_ARIA_BLOCKSIZE 16 |
ARIA block size in bytes.
#define MBEDTLS_ARIA_DECRYPT 0 |
ARIA decryption.
#define MBEDTLS_ARIA_ENCRYPT 1 |
ARIA encryption.
#define MBEDTLS_ARIA_MAX_KEYSIZE 32 |
Maximum size of an ARIA key in bytes.
#define MBEDTLS_ARIA_MAX_ROUNDS 16 |
Maxiumum number of rounds in ARIA.
#define MBEDTLS_ERR_ARIA_BAD_INPUT_DATA -0x005C |
Bad input data.
#define MBEDTLS_ERR_ARIA_FEATURE_UNAVAILABLE -0x005A |
Feature not available. For example, an unsupported ARIA key size.
#define MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED -0x0058 |
ARIA hardware accelerator failed.
#define MBEDTLS_ERR_ARIA_INVALID_INPUT_LENGTH -0x005E |
Invalid data input length.
#define MBEDTLS_ERR_ARIA_INVALID_KEY_LENGTH MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( -0x005C ) |
typedef 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.
It performs encryption or decryption (depending on whether the key was set for encryption on decryption) on the input data buffer defined in the input
parameter.
mbedtls_aria_init(), and either mbedtls_aria_setkey_enc() or mbedtls_aria_setkey_dec() must be called before the first call to this API with the same context.
ctx | The ARIA context to use for encryption or decryption. This must be initialized and bound to a key. |
input | The 16-Byte buffer holding the input data. |
output | The 16-Byte buffer holding the output data. |
0
on success. void mbedtls_aria_free | ( | mbedtls_aria_context * | ctx | ) |
This function releases and clears the specified ARIA context.
ctx | The ARIA context to clear. This may be NULL , in which case this function returns immediately. If it is not NULL , it must point to an initialized ARIA context. |
void mbedtls_aria_init | ( | mbedtls_aria_context * | ctx | ) |
This function initializes the specified ARIA context.
It must be the first API called before using the context.
ctx | The ARIA context to initialize. This must not be NULL . |
int mbedtls_aria_setkey_dec | ( | mbedtls_aria_context * | ctx, |
const unsigned char * | key, | ||
unsigned int | keybits | ||
) |
This function sets the decryption key.
ctx | The ARIA context to which the key should be bound. This must be initialized. |
key | The decryption key. This must be a readable buffer of size keybits Bits. |
keybits | The size of data passed. Valid options are:
|
0
on success. int mbedtls_aria_setkey_enc | ( | mbedtls_aria_context * | ctx, |
const unsigned char * | key, | ||
unsigned int | keybits | ||
) |
This function sets the encryption key.
ctx | The ARIA context to which the key should be bound. This must be initialized. |
key | The encryption key. This must be a readable buffer of size keybits Bits. |
keybits | The size of key in Bits. Valid options are:
|
0
on success.