camellia.h File Reference

Camellia block cipher. More...

#include "config.h"
#include <stddef.h>
#include <stdint.h>
Include dependency graph for camellia.h:

Go to the source code of this file.

Data Structures

struct  mbedtls_camellia_context
 CAMELLIA context structure. More...

Defines

#define MBEDTLS_CAMELLIA_ENCRYPT   1
#define MBEDTLS_CAMELLIA_DECRYPT   0
#define MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH   -0x0024
#define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH   -0x0026
#define MBEDTLS_ERR_CAMELLIA_HW_ACCEL_FAILED   -0x0027

Functions

void mbedtls_camellia_init (mbedtls_camellia_context *ctx)
 Initialize CAMELLIA context.
void mbedtls_camellia_free (mbedtls_camellia_context *ctx)
 Clear CAMELLIA context.
int mbedtls_camellia_setkey_enc (mbedtls_camellia_context *ctx, const unsigned char *key, unsigned int keybits)
 CAMELLIA key schedule (encryption).
int mbedtls_camellia_setkey_dec (mbedtls_camellia_context *ctx, const unsigned char *key, unsigned int keybits)
 CAMELLIA key schedule (decryption).
int mbedtls_camellia_crypt_ecb (mbedtls_camellia_context *ctx, int mode, const unsigned char input[16], unsigned char output[16])
 CAMELLIA-ECB block encryption/decryption.
int mbedtls_camellia_self_test (int verbose)
 Checkup routine.

Detailed Description

Camellia block cipher.

Definition in file camellia.h.


Define Documentation

#define MBEDTLS_CAMELLIA_DECRYPT   0

Definition at line 64 of file camellia.h.

#define MBEDTLS_CAMELLIA_ENCRYPT   1

Definition at line 63 of file camellia.h.

#define MBEDTLS_ERR_CAMELLIA_HW_ACCEL_FAILED   -0x0027

Camellia hardware accelerator failed.

Definition at line 68 of file camellia.h.

#define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH   -0x0026

Invalid data input length.

Definition at line 67 of file camellia.h.

#define MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH   -0x0024

Invalid key length.

Definition at line 66 of file camellia.h.


Function Documentation

int mbedtls_camellia_crypt_ecb ( mbedtls_camellia_context ctx,
int  mode,
const unsigned char  input[16],
unsigned char  output[16] 
)

CAMELLIA-ECB block encryption/decryption.

Parameters:
ctx CAMELLIA context
mode MBEDTLS_CAMELLIA_ENCRYPT or MBEDTLS_CAMELLIA_DECRYPT
input 16-byte input block
output 16-byte output block
Returns:
0 if successful
void mbedtls_camellia_free ( mbedtls_camellia_context ctx  ) 

Clear CAMELLIA context.

Parameters:
ctx CAMELLIA context to be cleared
void mbedtls_camellia_init ( mbedtls_camellia_context ctx  ) 

Initialize CAMELLIA context.

Parameters:
ctx CAMELLIA context to be initialized
int mbedtls_camellia_self_test ( int  verbose  ) 

Checkup routine.

Returns:
0 if successful, or 1 if the test failed
int mbedtls_camellia_setkey_dec ( mbedtls_camellia_context ctx,
const unsigned char *  key,
unsigned int  keybits 
)

CAMELLIA key schedule (decryption).

Parameters:
ctx CAMELLIA context to be initialized
key decryption key
keybits must be 128, 192 or 256
Returns:
0 if successful, or MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH
int mbedtls_camellia_setkey_enc ( mbedtls_camellia_context ctx,
const unsigned char *  key,
unsigned int  keybits 
)

CAMELLIA key schedule (encryption).

Parameters:
ctx CAMELLIA context to be initialized
key encryption key
keybits must be 128, 192 or 256
Returns:
0 if successful, or MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH

Generated on 10 Aug 2020 for mbed TLS v2.7.16 by  doxygen 1.6.1