00001
00002
00003
00004
00005
00006
00007
00008
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
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
00041
00042
00043 enum {
00044 CODEC_CIPHER_KEY_SIZE = 0,
00045 CODEC_CIPHER_IV_SIZE = 0,
00046 CODEC_CIPHER_BLOCK_SIZE = 0
00047 };
00048
00049 #endif
00050
00051 #endif