IBR-DTNSuite
0.8
|
00001 /* 00002 --------------------------------------------------------------------------- 00003 Copyright (c) 1998-2006, Brian Gladman, Worcester, UK. All rights reserved. 00004 00005 LICENSE TERMS 00006 00007 The free distribution and use of this software in both source and binary 00008 form is allowed (with or without changes) provided that: 00009 00010 1. distributions of this source code include the above copyright 00011 notice, this list of conditions and the following disclaimer; 00012 00013 2. distributions in binary form include the above copyright 00014 notice, this list of conditions and the following disclaimer 00015 in the documentation and/or other associated materials; 00016 00017 3. the copyright holder's name is not used to endorse products 00018 built using this software without specific written permission. 00019 00020 ALTERNATIVELY, provided that this notice is retained in full, this product 00021 may be distributed under the terms of the GNU General Public License (GPL), 00022 in which case the provisions of the GPL apply INSTEAD OF those given above. 00023 00024 DISCLAIMER 00025 00026 This software is provided 'as is' with no explicit or implied warranties 00027 in respect of its properties, including, but not limited to, correctness 00028 and/or fitness for purpose. 00029 --------------------------------------------------------------------------- 00030 Issue 16/04/2007 00031 00032 */ 00033 00034 /* This file changed 5 June 2007, extracted from "aes.h", extracting 00035 only those portions needed to use gcm-mode in an OpenSSL environment. 00036 Changed by Peter Lovell, SPARTA Inc., for DTN project. 00037 */ 00038 00039 #ifndef _AES_H 00040 #define _AES_H 00041 00042 #include <stdlib.h> 00043 #include <openssl/aes.h> 00044 00045 /* This include is used to find 8 & 32 bit unsigned integer types */ 00046 #include "brg_types.h" 00047 00048 #if defined(__cplusplus) 00049 extern "C" 00050 { 00051 #endif 00052 00053 #define USE_AES_ENCRYPT /* if support for encryption is needed */ 00054 00055 #define AES_RETURN VOID_RETURN 00056 00057 /* the encrypt context maps to OpenSSL AES context type */ 00058 00059 #define aes_encrypt_ctx AES_KEY 00060 00061 00062 /* Key lengths in the range 16 <= key_len <= 32 are given in bytes, */ 00063 /* those in the range 128 <= key_len <= 256 are given in bits */ 00064 00065 AES_RETURN aes_encrypt_key(const unsigned char *key, int key_len, aes_encrypt_ctx* cx); 00066 00067 #define aes_encrypt AES_encrypt 00068 00069 00070 #if defined(__cplusplus) 00071 } 00072 #endif 00073 00074 #endif