00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _ASTERISK_AES_H
00030 #define _ASTERISK_AES_H
00031
00032 #ifdef HAVE_CRYPTO
00033
00034
00035 #include "openssl/aes.h"
00036
00037 typedef AES_KEY ast_aes_encrypt_key;
00038 typedef AES_KEY ast_aes_decrypt_key;
00039
00040 #define ast_aes_encrypt_key(key, context) AES_set_encrypt_key(key, 128, context)
00041
00042 #define ast_aes_decrypt_key(key, context) AES_set_decrypt_key(key, 128, context)
00043
00044 #define ast_aes_encrypt(in, out, context) AES_encrypt(in, out, context)
00045
00046 #define ast_aes_decrypt(in, out, context) AES_decrypt(in, out, context)
00047
00048 #else
00049
00050
00051
00052 #include "aes_internal.h"
00053
00054 typedef aes_encrypt_ctx ast_aes_encrypt_key;
00055 typedef aes_decrypt_ctx ast_aes_decrypt_key;
00056
00057 #define ast_aes_encrypt_key(key, context) aes_encrypt_key128(key, context)
00058
00059 #define ast_aes_decrypt_key(key, context) aes_decrypt_key128(key, context)
00060
00061 #define ast_aes_encrypt(in, out, context) aes_encrypt(in, out, context)
00062
00063 #define ast_aes_decrypt(in, out, context) aes_decrypt(in, out, context)
00064
00065 #endif
00066
00067 #endif