camellia.h File Reference

Camellia block cipher. More...

#include "config.h"
#include <string.h>
#include <inttypes.h>
Include dependency graph for camellia.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  camellia_context
 CAMELLIA context structure. More...

Defines

#define CAMELLIA_ENCRYPT   1
#define CAMELLIA_DECRYPT   0
#define POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH   -0x0024
 Invalid key length.
#define POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH   -0x0026
 Invalid data input length.

Functions

int camellia_setkey_enc (camellia_context *ctx, const unsigned char *key, unsigned int keysize)
 CAMELLIA key schedule (encryption).
int camellia_setkey_dec (camellia_context *ctx, const unsigned char *key, unsigned int keysize)
 CAMELLIA key schedule (decryption).
int camellia_crypt_ecb (camellia_context *ctx, int mode, const unsigned char input[16], unsigned char output[16])
 CAMELLIA-ECB block encryption/decryption.
int camellia_self_test (int verbose)
 Checkup routine.

Detailed Description

Camellia block cipher.

Copyright (C) 2006-2013, Brainspark B.V.

This file is part of PolarSSL (http://www.polarssl.org) Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>

All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Definition in file camellia.h.


Define Documentation

#define CAMELLIA_DECRYPT   0
#define CAMELLIA_ENCRYPT   1
#define POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH   -0x0026

Invalid data input length.

Definition at line 45 of file camellia.h.

Referenced by camellia_crypt_cbc(), polarssl_strerror(), and verify_int().

#define POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH   -0x0024

Invalid key length.

Definition at line 44 of file camellia.h.

Referenced by camellia_setkey_dec(), camellia_setkey_enc(), polarssl_strerror(), and verify_int().


Function Documentation

int camellia_crypt_ecb ( camellia_context ctx,
int  mode,
const unsigned char  input[16],
unsigned char  output[16] 
)

CAMELLIA-ECB block encryption/decryption.

Parameters:
ctx CAMELLIA context
mode CAMELLIA_ENCRYPT or CAMELLIA_DECRYPT
input 16-byte input block
output 16-byte output block
Returns:
0 if successful

Definition at line 467 of file camellia.c.

References camellia_feistel(), FL, FLInv, GET_UINT32_BE, camellia_context::nr, PUT_UINT32_BE, and camellia_context::rk.

Referenced by camellia_crypt_cbc(), camellia_crypt_cfb128(), camellia_crypt_ctr(), camellia_crypt_ecb_wrap(), camellia_self_test(), test_suite_camellia_decrypt_ecb(), and test_suite_camellia_encrypt_ecb().

int camellia_self_test ( int  verbose  ) 
int camellia_setkey_dec ( camellia_context ctx,
const unsigned char *  key,
unsigned int  keysize 
)

CAMELLIA key schedule (decryption).

Parameters:
ctx CAMELLIA context to be initialized
key decryption key
keysize must be 128, 192 or 256
Returns:
0 if successful, or POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH

Definition at line 416 of file camellia.c.

References camellia_setkey_enc(), camellia_context::nr, POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH, and camellia_context::rk.

Referenced by camellia_self_test(), camellia_setkey_dec_wrap(), test_suite_camellia_decrypt_cbc(), and test_suite_camellia_decrypt_ecb().

int camellia_setkey_enc ( camellia_context ctx,
const unsigned char *  key,
unsigned int  keysize 
)

CAMELLIA key schedule (encryption).

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

Definition at line 312 of file camellia.c.

References camellia_feistel(), GET_UINT32_BE, camellia_context::nr, POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH, camellia_context::rk, SHIFT_AND_PLACE, SIGMA_CHARS, and transposes.

Referenced by camellia_self_test(), camellia_setkey_dec(), camellia_setkey_enc_wrap(), test_suite_camellia_decrypt_cfb128(), test_suite_camellia_encrypt_cbc(), test_suite_camellia_encrypt_cfb128(), and test_suite_camellia_encrypt_ecb().


Generated on 9 Apr 2014 for PolarSSL v1.3.2 by  doxygen 1.6.1