00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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