Camellia block cipher.
More...
#include "config.h"
#include <stddef.h>
#include <stdint.h>
#include "platform_util.h"
Go to the source code of this file.
◆ MBEDTLS_CAMELLIA_DECRYPT
#define MBEDTLS_CAMELLIA_DECRYPT 0 |
◆ MBEDTLS_CAMELLIA_ENCRYPT
#define MBEDTLS_CAMELLIA_ENCRYPT 1 |
◆ MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA
#define MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA -0x0024 |
◆ MBEDTLS_ERR_CAMELLIA_HW_ACCEL_FAILED
#define MBEDTLS_ERR_CAMELLIA_HW_ACCEL_FAILED -0x0027 |
Camellia hardware accelerator failed.
◆ MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH
#define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH -0x0026 |
Invalid data input length.
◆ MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH
◆ mbedtls_camellia_context
CAMELLIA context structure.
◆ mbedtls_camellia_crypt_ecb()
int mbedtls_camellia_crypt_ecb |
( |
mbedtls_camellia_context * |
ctx, |
|
|
int |
mode, |
|
|
const unsigned char |
input[16], |
|
|
unsigned char |
output[16] |
|
) |
| |
Perform a CAMELLIA-ECB block encryption/decryption operation.
- Parameters
-
ctx | The CAMELLIA context to use. This must be initialized and bound to a key. |
mode | The mode of operation. This must be either MBEDTLS_CAMELLIA_ENCRYPT or MBEDTLS_CAMELLIA_DECRYPT. |
input | The input block. This must be a readable buffer of size 16 Bytes. |
output | The output block. This must be a writable buffer of size 16 Bytes. |
- Returns
0
if successful.
-
A negative error code on failure.
◆ mbedtls_camellia_free()
Clear a CAMELLIA context.
- Parameters
-
ctx | The CAMELLIA context to be cleared. This may be NULL , in which case this function returns immediately. If it is not NULL , it must be initialized. |
◆ mbedtls_camellia_init()
Initialize a CAMELLIA context.
- Parameters
-
ctx | The CAMELLIA context to be initialized. This must not be NULL . |
◆ mbedtls_camellia_self_test()
int mbedtls_camellia_self_test |
( |
int |
verbose | ) |
|
Checkup routine.
- Returns
- 0 if successful, or 1 if the test failed
◆ mbedtls_camellia_setkey_dec()
Perform a CAMELLIA key schedule operation for decryption.
- Parameters
-
ctx | The CAMELLIA context to use. This must be initialized. |
key | The decryption key. This must be a readable buffer of size keybits Bits. |
keybits | The length of key in Bits. This must be either 128 , 192 or 256 . |
- Returns
0
if successful.
-
A negative error code on failure.
◆ mbedtls_camellia_setkey_enc()
Perform a CAMELLIA key schedule operation for encryption.
- Parameters
-
ctx | The CAMELLIA context to use. This must be initialized. |
key | The encryption key to use. This must be a readable buffer of size keybits Bits. |
keybits | The length of key in Bits. This must be either 128 , 192 or 256 . |
- Returns
0
if successful.
-
A negative error code on failure.