BeeCrypt 4.2.1
|
00001 /* 00002 * Copyright (c) 2001, 2002, 2004 X-Way Rights BV 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 */ 00019 00025 #ifndef _BEECRYPT_API_H 00026 #define _BEECRYPT_API_H 00027 00028 #if defined(_WIN32) && !defined(WIN32) 00029 # define WIN32 1 00030 #endif 00031 00032 #if WIN32 00033 # if !__CYGWIN32__ && !__MINGW32__ 00034 # include "beecrypt/win.h" 00035 # else 00036 # include "beecrypt/gnu.h" 00037 # endif 00038 # ifdef BEECRYPT_DLL_EXPORT 00039 # define BEECRYPTAPI __declspec(dllexport) 00040 # else 00041 # define BEECRYPTAPI __declspec(dllimport) 00042 # endif 00043 # ifdef BEECRYPT_CXX_DLL_EXPORT 00044 # define BEECRYPTCXXAPI __declspec(dllexport) 00045 # define BEECRYPTCXXTEMPLATE 00046 # else 00047 # define BEECRYPTCXXAPI __declspec(dllimport) 00048 # define BEECRYPTCXXTEMPLATE extern 00049 # endif 00050 #else 00051 # include "beecrypt/gnu.h" 00052 # define BEECRYPTAPI 00053 # define BEECRYPTCXXAPI 00054 #endif 00055 00056 #if HAVE_ASSERT_H 00057 # include <assert.h> 00058 #else 00059 # define assert(x) 00060 #endif 00061 00062 #ifndef ROTL32 00063 # define ROTL32(x, s) (((x) << (s)) | ((x) >> (32 - (s)))) 00064 #endif 00065 #ifndef ROTR32 00066 # define ROTR32(x, s) (((x) >> (s)) | ((x) << (32 - (s)))) 00067 #endif 00068 #ifndef ROTR64 00069 # define ROTR64(x, s) (((x) >> (s)) | ((x) << (64 - (s)))) 00070 #endif 00071 00072 typedef uint8_t byte; 00073 00074 #if JAVAGLUE 00075 # include <jni.h> 00076 #else 00077 typedef int8_t jbyte; 00078 typedef int16_t jshort; 00079 typedef int32_t jint; 00080 typedef int64_t jlong; 00081 typedef uint16_t jchar; 00082 typedef float jfloat; 00083 typedef double jdouble; 00084 #endif 00085 00086 #if (MP_WBITS == 64) 00087 typedef uint64_t mpw; 00088 typedef uint32_t mphw; 00089 #elif (MP_WBITS == 32) 00090 # if HAVE_UINT64_T 00091 # define HAVE_MPDW 1 00092 typedef uint64_t mpdw; 00093 # endif 00094 typedef uint32_t mpw; 00095 typedef uint16_t mphw; 00096 #else 00097 # error 00098 #endif 00099 00100 #endif