NCBI C++ ToolKit
Classes | Macros | Typedefs | Functions
camellia.h File Reference

Camellia block cipher. More...

#include "mbedtls/private_access.h"
#include "mbedtls/build_info.h"
#include <stddef.h>
#include <stdint.h>
#include "mbedtls/platform_util.h"
+ Include dependency graph for camellia.h:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  mbedtls_camellia_context
 CAMELLIA context structure. More...
 

Macros

#define MBEDTLS_CAMELLIA_ENCRYPT   1
 
#define MBEDTLS_CAMELLIA_DECRYPT   0
 
#define MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA   -0x0024
 Bad input data. More...
 
#define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH   -0x0026
 Invalid data input length. More...
 

Typedefs

typedef struct mbedtls_camellia_context mbedtls_camellia_context
 CAMELLIA context structure. More...
 

Functions

void mbedtls_camellia_init (mbedtls_camellia_context *ctx)
 Initialize a CAMELLIA context. More...
 
void mbedtls_camellia_free (mbedtls_camellia_context *ctx)
 Clear a CAMELLIA context. More...
 
int mbedtls_camellia_setkey_enc (mbedtls_camellia_context *ctx, const unsigned char *key, unsigned int keybits)
 Perform a CAMELLIA key schedule operation for encryption. More...
 
int mbedtls_camellia_setkey_dec (mbedtls_camellia_context *ctx, const unsigned char *key, unsigned int keybits)
 Perform a CAMELLIA key schedule operation for decryption. More...
 
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. More...
 

Detailed Description

Camellia block cipher.

Definition in file camellia.h.

Macro Definition Documentation

◆ MBEDTLS_CAMELLIA_DECRYPT

#define MBEDTLS_CAMELLIA_DECRYPT   0

Definition at line 22 of file camellia.h.

◆ MBEDTLS_CAMELLIA_ENCRYPT

#define MBEDTLS_CAMELLIA_ENCRYPT   1

Definition at line 21 of file camellia.h.

◆ MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA

#define MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA   -0x0024

Bad input data.

Definition at line 25 of file camellia.h.

◆ MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH

#define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH   -0x0026

Invalid data input length.

Definition at line 28 of file camellia.h.

Typedef Documentation

◆ mbedtls_camellia_context

CAMELLIA context structure.

Function Documentation

◆ 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
ctxThe CAMELLIA context to use. This must be initialized and bound to a key.
modeThe mode of operation. This must be either MBEDTLS_CAMELLIA_ENCRYPT or MBEDTLS_CAMELLIA_DECRYPT.
inputThe input block. This must be a readable buffer of size 16 Bytes.
outputThe 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()

void mbedtls_camellia_free ( mbedtls_camellia_context ctx)

Clear a CAMELLIA context.

Parameters
ctxThe 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()

void mbedtls_camellia_init ( mbedtls_camellia_context ctx)

Initialize a CAMELLIA context.

Parameters
ctxThe CAMELLIA context to be initialized. This must not be NULL.

◆ mbedtls_camellia_setkey_dec()

int mbedtls_camellia_setkey_dec ( mbedtls_camellia_context ctx,
const unsigned char *  key,
unsigned int  keybits 
)

Perform a CAMELLIA key schedule operation for decryption.

Parameters
ctxThe CAMELLIA context to use. This must be initialized.
keyThe decryption key. This must be a readable buffer of size keybits Bits.
keybitsThe 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()

int mbedtls_camellia_setkey_enc ( mbedtls_camellia_context ctx,
const unsigned char *  key,
unsigned int  keybits 
)

Perform a CAMELLIA key schedule operation for encryption.

Parameters
ctxThe CAMELLIA context to use. This must be initialized.
keyThe encryption key to use. This must be a readable buffer of size keybits Bits.
keybitsThe length of key in Bits. This must be either 128, 192 or 256.
Returns
0 if successful.
A negative error code on failure.
Modified on Fri Jun 07 13:34:03 2024 by modify_doxy.py rev. 669887