Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals

ccipher.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2005, 2006 by KoanLogic s.r.l. <http://www.koanlogic.com>
00003  * All rights reserved.
00004  *
00005  * This file is part of KLone, and as such it is subject to the license stated
00006  * in the LICENSE file which you have received as part of this distribution.
00007  *
00008  * $Id: ccipher.h,v 1.8 2006/01/09 12:38:37 tat Exp $
00009  */
00010 
00011 #ifndef _KLONE_CODEC_CIPHER_H_
00012 #define _KLONE_CODEC_CIPHER_H_
00013 
00014 #include "klone_conf.h"
00015 #include <klone/codec.h>
00016 
00017 #ifdef HAVE_LIBOPENSSL
00018 #include <openssl/evp.h>
00019 
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif 
00023 
00024 /* possibile values for io_gzip_create */
00025 enum { CIPHER_ENCRYPT, CIPHER_DECRYPT };
00026 
00027 enum {
00028     CODEC_CIPHER_KEY_SIZE   = EVP_MAX_KEY_LENGTH, 
00029     CODEC_CIPHER_IV_SIZE    = EVP_MAX_IV_LENGTH,
00030     CODEC_CIPHER_BLOCK_SIZE = EVP_MAX_BLOCK_LENGTH
00031 };
00032 
00033 int codec_cipher_create(int op, const EVP_CIPHER *cipher, 
00034     unsigned char *key, unsigned char *iv, codec_t **pcc);
00035 
00036 #ifdef __cplusplus
00037 }
00038 #endif 
00039 
00040 #else /* HAVE_LIBOPENSSL */
00041 /* to avoid ifdefs in local variable declaration (such vars will not be used 
00042    anyway because the code that use them is ifdef-out) */
00043 enum {
00044     CODEC_CIPHER_KEY_SIZE   = 0, 
00045     CODEC_CIPHER_IV_SIZE    = 0,
00046     CODEC_CIPHER_BLOCK_SIZE = 0
00047 };
00048 
00049 #endif /* HAVE_LIBOPENSSL */
00050 
00051 #endif /* !_KLONE_CODEC_CIPHER_H_ */

←Products
© 2005-2006 - KoanLogic S.r.l. - All rights reserved