Xuyi Wang / wolfcrypt

Dependents:   OS

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers wc_port.h Source File

wc_port.h

00001 /* wc_port.h
00002  *
00003  * Copyright (C) 2006-2017 wolfSSL Inc.
00004  *
00005  * This file is part of wolfSSL.
00006  *
00007  * wolfSSL is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * wolfSSL is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
00020  */
00021 
00022 /*!
00023     \file wolfssl/wolfcrypt/wc_port.h
00024 */
00025 
00026 #ifndef WOLF_CRYPT_PORT_H
00027 #define WOLF_CRYPT_PORT_H
00028 
00029 #include <wolfcrypt/settings.h>
00030 #include <wolfcrypt/visibility.h>
00031 
00032 #ifdef __cplusplus
00033     extern "C" {
00034 #endif
00035 
00036 /* Detect if compiler supports C99. "NO_WOLF_C99" can be defined in
00037  * user_settings.h to disable checking for C99 support. */
00038 #if !defined(WOLF_C99) && defined(__STDC_VERSION__) && \
00039     !defined(WOLFSSL_ARDUINO) && !defined(NO_WOLF_C99)
00040     #if __STDC_VERSION__ >= 199901L
00041         #define WOLF_C99
00042     #endif
00043 #endif
00044 
00045 #ifdef USE_WINDOWS_API
00046     #ifdef WOLFSSL_GAME_BUILD
00047         #include "system/xtl.h"
00048     #else
00049         #ifndef WIN32_LEAN_AND_MEAN
00050             #define WIN32_LEAN_AND_MEAN
00051         #endif
00052         #ifndef WOLFSSL_SGX
00053             #if defined(_WIN32_WCE) || defined(WIN32_LEAN_AND_MEAN)
00054                 /* On WinCE winsock2.h must be included before windows.h */
00055                 #include <winsock2.h>
00056             #endif
00057             #include <windows.h>
00058         #endif /* WOLFSSL_SGX */
00059     #endif
00060 #elif defined(THREADX)
00061     #ifndef SINGLE_THREADED
00062         #ifdef NEED_THREADX_TYPES
00063             #include <types.h>
00064         #endif
00065         #include <tx_api.h>
00066     #endif
00067 #elif defined(MICRIUM)
00068     /* do nothing, just don't pick Unix */
00069 #elif defined(FREERTOS) || defined(FREERTOS_TCP) || defined(WOLFSSL_SAFERTOS)
00070     /* do nothing */
00071 #elif defined(EBSNET)
00072     /* do nothing */
00073 #elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX)
00074     /* do nothing */
00075 #elif defined(FREESCALE_FREE_RTOS)
00076     #include "fsl_os_abstraction.h"
00077 #elif defined(WOLFSSL_uITRON4)
00078     #include "stddef.h"
00079     #include "kernel.h"
00080 #elif  defined(WOLFSSL_uTKERNEL2)
00081     #include "tk/tkernel.h"
00082 #elif defined(WOLFSSL_CMSIS_RTOS)
00083     #include "cmsis_os.h"
00084 #elif defined(WOLFSSL_MDK_ARM)
00085     #if defined(WOLFSSL_MDK5)
00086         #include "cmsis_os.h"
00087     #else
00088         #include <rtl.h>
00089     #endif
00090 #elif defined(WOLFSSL_CMSIS_RTOS)
00091     #include "cmsis_os.h"
00092 #elif defined(WOLFSSL_TIRTOS)
00093     #include <ti/sysbios/BIOS.h>
00094     #include <ti/sysbios/knl/Semaphore.h>
00095 #elif defined(WOLFSSL_FROSTED)
00096     #include <semaphore.h>
00097 #elif defined(INTIME_RTOS)
00098     #include <rt.h>
00099     #include <io.h>
00100 #elif defined(WOLFSSL_NUCLEUS_1_2)
00101     /* NU_DEBUG needed struct access in nucleus_realloc */
00102     #define NU_DEBUG
00103     #include "plus/nucleus.h"
00104     #include "nucleus.h"
00105 #else
00106     #ifndef SINGLE_THREADED
00107         #define WOLFSSL_PTHREADS
00108         #include <pthread.h>
00109     #endif
00110     #if defined(OPENSSL_EXTRA) || defined(GOAHEAD_WS)
00111         #include <unistd.h>      /* for close of BIO */
00112     #endif
00113 #endif
00114 
00115 /* For FIPS keep the function names the same */
00116 #ifdef HAVE_FIPS
00117 #define wc_InitMutex   InitMutex
00118 #define wc_FreeMutex   FreeMutex
00119 #define wc_LockMutex   LockMutex
00120 #define wc_UnLockMutex UnLockMutex
00121 #endif /* HAVE_FIPS */
00122 
00123 #ifdef SINGLE_THREADED
00124     typedef int wolfSSL_Mutex;
00125 #else /* MULTI_THREADED */
00126     /* FREERTOS comes first to enable use of FreeRTOS Windows simulator only */
00127     #if defined(FREERTOS)
00128         typedef xSemaphoreHandle wolfSSL_Mutex;
00129     #elif defined(FREERTOS_TCP)
00130         #include "FreeRTOS.h"
00131         #include "semphr.h"
00132         typedef SemaphoreHandle_t  wolfSSL_Mutex;
00133     #elif defined(WOLFSSL_SAFERTOS)
00134         typedef struct wolfSSL_Mutex {
00135             signed char mutexBuffer[portQUEUE_OVERHEAD_BYTES];
00136             xSemaphoreHandle mutex;
00137         } wolfSSL_Mutex;
00138     #elif defined(USE_WINDOWS_API)
00139         typedef CRITICAL_SECTION wolfSSL_Mutex;
00140     #elif defined(WOLFSSL_PTHREADS)
00141         typedef pthread_mutex_t wolfSSL_Mutex;
00142     #elif defined(THREADX)
00143         typedef TX_MUTEX wolfSSL_Mutex;
00144     #elif defined(MICRIUM)
00145         typedef OS_MUTEX wolfSSL_Mutex;
00146     #elif defined(EBSNET)
00147         typedef RTP_MUTEX wolfSSL_Mutex;
00148     #elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX)
00149         typedef MUTEX_STRUCT wolfSSL_Mutex;
00150     #elif defined(FREESCALE_FREE_RTOS)
00151         typedef mutex_t wolfSSL_Mutex;
00152     #elif defined(WOLFSSL_uITRON4)
00153         typedef struct wolfSSL_Mutex {
00154             T_CSEM sem ;
00155             ID     id ;
00156         } wolfSSL_Mutex;
00157     #elif defined(WOLFSSL_uTKERNEL2)
00158         typedef struct wolfSSL_Mutex {
00159             T_CSEM sem ;
00160             ID     id ;
00161         } wolfSSL_Mutex;
00162     #elif defined(WOLFSSL_MDK_ARM)
00163         #if defined(WOLFSSL_CMSIS_RTOS)
00164             typedef osMutexId wolfSSL_Mutex;
00165         #else
00166             typedef OS_MUT wolfSSL_Mutex;
00167         #endif
00168     #elif defined(WOLFSSL_CMSIS_RTOS)
00169         typedef osMutexId wolfSSL_Mutex;
00170     #elif defined(WOLFSSL_TIRTOS)
00171         typedef ti_sysbios_knl_Semaphore_Handle wolfSSL_Mutex;
00172     #elif defined(WOLFSSL_FROSTED)
00173         typedef mutex_t * wolfSSL_Mutex;
00174     #elif defined(INTIME_RTOS)
00175         typedef RTHANDLE wolfSSL_Mutex;
00176     #elif defined(WOLFSSL_NUCLEUS_1_2)
00177         typedef NU_SEMAPHORE wolfSSL_Mutex;
00178     #else
00179         #error Need a mutex type in multithreaded mode
00180     #endif /* USE_WINDOWS_API */
00181 #endif /* SINGLE_THREADED */
00182 
00183 /* Enable crypt HW mutex for Freescale MMCAU or PIC32MZ */
00184 #if defined(FREESCALE_MMCAU) || defined(WOLFSSL_MICROCHIP_PIC32MZ)
00185     #ifndef WOLFSSL_CRYPT_HW_MUTEX
00186         #define WOLFSSL_CRYPT_HW_MUTEX  1
00187     #endif
00188 #endif /* FREESCALE_MMCAU */
00189 
00190 #ifndef WOLFSSL_CRYPT_HW_MUTEX
00191     #define WOLFSSL_CRYPT_HW_MUTEX  0
00192 #endif
00193 
00194 #if WOLFSSL_CRYPT_HW_MUTEX
00195     /* wolfSSL_CryptHwMutexInit is called on first wolfSSL_CryptHwMutexLock,
00196        however it's recommended to call this directly on Hw init to avoid possible
00197        race condition where two calls to wolfSSL_CryptHwMutexLock are made at
00198        the same time. */
00199     int wolfSSL_CryptHwMutexInit(void);
00200     int wolfSSL_CryptHwMutexLock(void);
00201     int wolfSSL_CryptHwMutexUnLock(void);
00202 #else
00203     /* Define stubs, since HW mutex is disabled */
00204     #define wolfSSL_CryptHwMutexInit()      0 /* Success */
00205     #define wolfSSL_CryptHwMutexLock()      0 /* Success */
00206     #define wolfSSL_CryptHwMutexUnLock()    (void)0 /* Success */
00207 #endif /* WOLFSSL_CRYPT_HW_MUTEX */
00208 
00209 /* Mutex functions */
00210 WOLFSSL_API int wc_InitMutex(wolfSSL_Mutex*);
00211 WOLFSSL_API wolfSSL_Mutex* wc_InitAndAllocMutex(void);
00212 WOLFSSL_API int wc_FreeMutex(wolfSSL_Mutex*);
00213 WOLFSSL_API int wc_LockMutex(wolfSSL_Mutex*);
00214 WOLFSSL_API int wc_UnLockMutex(wolfSSL_Mutex*);
00215 #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
00216 /* dynamiclly set which mutex to use. unlock / lock is controlled by flag */
00217 typedef void (mutex_cb)(int flag, int type, const char* file, int line);
00218 
00219 WOLFSSL_API int wc_LockMutex_ex(int flag, int type, const char* file, int line);
00220 WOLFSSL_API int wc_SetMutexCb(mutex_cb* cb);
00221 #endif
00222 
00223 /* main crypto initialization function */
00224 WOLFSSL_API int wolfCrypt_Init(void);
00225 WOLFSSL_API int wolfCrypt_Cleanup(void);
00226 
00227 /* filesystem abstraction layer, used by ssl.c */
00228 #ifndef NO_FILESYSTEM
00229 
00230 #if defined(EBSNET)
00231     #include "vfapi.h"
00232     #include "vfile.h"
00233 
00234     #define XFILE                    int
00235     #define XFOPEN(NAME, MODE)       vf_open((const char *)NAME, VO_RDONLY, 0);
00236     #define XFSEEK                   vf_lseek
00237     #define XFTELL                   vf_tell
00238     #define XREWIND                  vf_rewind
00239     #define XFREAD(BUF, SZ, AMT, FD) vf_read(FD, BUF, SZ*AMT)
00240     #define XFWRITE(BUF, SZ, AMT, FD) vf_write(FD, BUF, SZ*AMT)
00241     #define XFCLOSE                  vf_close
00242     #define XSEEK_END                VSEEK_END
00243     #define XBADFILE                 -1
00244     #define XFGETS(b,s,f)            -2 /* Not ported yet */
00245 #elif defined(LSR_FS)
00246     #include <fs.h>
00247     #define XFILE                   struct fs_file*
00248     #define XFOPEN(NAME, MODE)      fs_open((char*)NAME);
00249     #define XFSEEK(F, O, W)         (void)F
00250     #define XFTELL(F)               (F)->len
00251     #define XREWIND(F)              (void)F
00252     #define XFREAD(BUF, SZ, AMT, F) fs_read(F, (char*)BUF, SZ*AMT)
00253     #define XFWRITE(BUF, SZ, AMT, F) fs_write(F, (char*)BUF, SZ*AMT)
00254     #define XFCLOSE                 fs_close
00255     #define XSEEK_END               0
00256     #define XBADFILE                NULL
00257     #define XFGETS(b,s,f)            -2 /* Not ported yet */
00258 #elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX)
00259     #define XFILE                   MQX_FILE_PTR
00260     #define XFOPEN                  fopen
00261     #define XFSEEK                  fseek
00262     #define XFTELL                  ftell
00263     #define XREWIND(F)              fseek(F, 0, IO_SEEK_SET)
00264     #define XFREAD                  fread
00265     #define XFWRITE                 fwrite
00266     #define XFCLOSE                 fclose
00267     #define XSEEK_END               IO_SEEK_END
00268     #define XBADFILE                NULL
00269     #define XFGETS                  fgets
00270 #elif defined(MICRIUM)
00271     #include <fs_api.h>
00272     #define XFILE      FS_FILE*
00273     #define XFOPEN     fs_fopen
00274     #define XFSEEK     fs_fseek
00275     #define XFTELL     fs_ftell
00276     #define XREWIND    fs_rewind
00277     #define XFREAD     fs_fread
00278     #define XFWRITE    fs_fwrite
00279     #define XFCLOSE    fs_fclose
00280     #define XSEEK_END  FS_SEEK_END
00281     #define XBADFILE   NULL
00282     #define XFGETS(b,s,f) -2 /* Not ported yet */
00283 #elif defined(WOLFSSL_NUCLEUS_1_2)
00284     #include "fal/inc/fal.h"
00285     #define XFILE      FILE*
00286     #define XFOPEN     fopen
00287     #define XFSEEK     fseek
00288     #define XFTELL     ftell
00289     #define XREWIND    rewind
00290     #define XFREAD     fread
00291     #define XFWRITE    fwrite
00292     #define XFCLOSE    fclose
00293     #define XSEEK_END  PSEEK_END
00294     #define XBADFILE   NULL
00295 #else
00296     /* stdio, default case */
00297     #include <stdio.h>
00298     #define XFILE      FILE*
00299     #if defined(WOLFSSL_MDK_ARM)
00300         extern FILE * wolfSSL_fopen(const char *name, const char *mode) ;
00301         #define XFOPEN     wolfSSL_fopen
00302     #else
00303         #define XFOPEN     fopen
00304     #endif
00305     #define XFSEEK     fseek
00306     #define XFTELL     ftell
00307     #define XREWIND    rewind
00308     #define XFREAD     fread
00309     #define XFWRITE    fwrite
00310     #define XFCLOSE    fclose
00311     #define XSEEK_END  SEEK_END
00312     #define XBADFILE   NULL
00313     #define XFGETS     fgets
00314 
00315     #if !defined(USE_WINDOWS_API) && !defined(NO_WOLFSSL_DIR)\
00316         && !defined(WOLFSSL_NUCLEUS) && !defined(WOLFSSL_NUCLEUS_1_2)
00317         #include <dirent.h>
00318         #include <unistd.h>
00319         #include <sys/stat.h>
00320     #endif
00321 #endif
00322 
00323     #ifndef MAX_FILENAME_SZ
00324         #define MAX_FILENAME_SZ  256 /* max file name length */
00325     #endif
00326     #ifndef MAX_PATH
00327         #define MAX_PATH 256
00328     #endif
00329 
00330 #if !defined(NO_WOLFSSL_DIR) && !defined(WOLFSSL_NUCLEUS) && \
00331     !defined(WOLFSSL_NUCLEUS_1_2)
00332     typedef struct ReadDirCtx {
00333     #ifdef USE_WINDOWS_API
00334         WIN32_FIND_DATAA FindFileData;
00335         HANDLE hFind;
00336     #else
00337         struct dirent* entry;
00338         DIR*   dir;
00339         struct stat s;
00340     #endif
00341         char name[MAX_FILENAME_SZ];
00342     } ReadDirCtx;
00343 
00344     WOLFSSL_API int wc_ReadDirFirst(ReadDirCtx* ctx, const char* path, char** name);
00345     WOLFSSL_API int wc_ReadDirNext(ReadDirCtx* ctx, const char* path, char** name);
00346     WOLFSSL_API void wc_ReadDirClose(ReadDirCtx* ctx);
00347 #endif /* !NO_WOLFSSL_DIR */
00348 
00349 #endif /* !NO_FILESYSTEM */
00350 
00351 /* Windows API defines its own min() macro. */
00352 #if defined(USE_WINDOWS_API)
00353     #if defined(min) || defined(WOLFSSL_MYSQL_COMPATIBLE)
00354         #define WOLFSSL_HAVE_MIN
00355     #endif /* min */
00356     #if defined(max) || defined(WOLFSSL_MYSQL_COMPATIBLE)
00357         #define WOLFSSL_HAVE_MAX
00358     #endif /* max */
00359 #endif /* USE_WINDOWS_API */
00360 
00361 /* Time functions */
00362 #ifndef NO_ASN_TIME
00363 #if defined(USER_TIME)
00364     /* Use our gmtime and time_t/struct tm types.
00365        Only needs seconds since EPOCH using XTIME function.
00366        time_t XTIME(time_t * timer) {}
00367     */
00368     #define WOLFSSL_GMTIME
00369     #define USE_WOLF_TM
00370     #define USE_WOLF_TIME_T
00371 
00372 #elif defined(TIME_OVERRIDES)
00373     /* Override XTIME() and XGMTIME() functionality.
00374        Requires user to provide these functions:
00375         time_t XTIME(time_t * timer) {}
00376         struct tm* XGMTIME(const time_t* timer, struct tm* tmp) {}
00377     */
00378     #ifndef HAVE_TIME_T_TYPE
00379         #define USE_WOLF_TIME_T
00380     #endif
00381     #ifndef HAVE_TM_TYPE
00382         #define USE_WOLF_TM
00383     #endif
00384     #define NEED_TMP_TIME
00385 
00386 #elif defined(HAVE_RTP_SYS)
00387     #include "os.h"           /* dc_rtc_api needs    */
00388     #include "dc_rtc_api.h"   /* to get current time */
00389 
00390     /* uses parital <time.h> structures */
00391     #define XTIME(tl)       (0)
00392     #define XGMTIME(c, t)   rtpsys_gmtime((c))
00393 
00394 #elif defined(MICRIUM)
00395     #include <clk.h>
00396     #include <time.h>
00397     #define XTIME(t1)       micrium_time((t1))
00398     #define WOLFSSL_GMTIME
00399 
00400 #elif defined(MICROCHIP_TCPIP_V5) || defined(MICROCHIP_TCPIP)
00401     #include <time.h>
00402     #define XTIME(t1)       pic32_time((t1))
00403     #define XGMTIME(c, t)   gmtime((c))
00404 
00405 #elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX)
00406     #ifdef FREESCALE_MQX_4_0
00407         #include <time.h>
00408         extern time_t mqx_time(time_t* timer);
00409     #else
00410         #define HAVE_GMTIME_R
00411     #endif
00412     #define XTIME(t1)       mqx_time((t1))
00413 
00414 #elif defined(FREESCALE_KSDK_BM) || defined(FREESCALE_FREE_RTOS) || defined(FREESCALE_KSDK_FREERTOS)
00415     #include <time.h>
00416     #ifndef XTIME
00417         /*extern time_t ksdk_time(time_t* timer);*/
00418         #define XTIME(t1)   ksdk_time((t1))
00419     #endif
00420     #define XGMTIME(c, t)   gmtime((c))
00421 
00422 #elif defined(WOLFSSL_ATMEL)
00423     #define XTIME(t1)       atmel_get_curr_time_and_date((t1))
00424     #define WOLFSSL_GMTIME
00425     #define USE_WOLF_TM
00426     #define USE_WOLF_TIME_T
00427 
00428 #elif defined(IDIRECT_DEV_TIME)
00429     /*Gets the timestamp from cloak software owned by VT iDirect
00430     in place of time() from <time.h> */
00431     #include <time.h>
00432     #define XTIME(t1)       idirect_time((t1))
00433     #define XGMTIME(c, t)   gmtime((c))
00434 
00435 #elif defined(_WIN32_WCE)
00436     #include <windows.h>
00437     #define XTIME(t1)       windows_time((t1))
00438     #define WOLFSSL_GMTIME
00439 
00440 #else
00441     /* default */
00442     /* uses complete <time.h> facility */
00443     #include <time.h>
00444     #if defined(HAVE_SYS_TIME_H)
00445         #include <sys/time.h>
00446     #endif
00447 
00448     /* PowerPC time_t is int */
00449     #ifdef __PPC__
00450         #define TIME_T_NOT_LONG
00451     #endif
00452 #endif
00453 
00454 
00455 /* Map default time functions */
00456 #if !defined(XTIME) && !defined(TIME_OVERRIDES) && !defined(USER_TIME)
00457     #define XTIME(tl)       time((tl))
00458 #endif
00459 #if !defined(XGMTIME) && !defined(TIME_OVERRIDES)
00460     #if defined(WOLFSSL_GMTIME) || !defined(HAVE_GMTIME_R) || defined(WOLF_C99)
00461         #define XGMTIME(c, t)   gmtime((c))
00462     #else
00463         #define XGMTIME(c, t)   gmtime_r((c), (t))
00464         #define NEED_TMP_TIME
00465     #endif
00466 #endif
00467 #if !defined(XVALIDATE_DATE) && !defined(HAVE_VALIDATE_DATE)
00468     #define USE_WOLF_VALIDDATE
00469     #define XVALIDATE_DATE(d, f, t) ValidateDate((d), (f), (t))
00470 #endif
00471 
00472 /* wolf struct tm and time_t */
00473 #if defined(USE_WOLF_TM)
00474     struct tm {
00475         int  tm_sec;     /* seconds after the minute [0-60] */
00476         int  tm_min;     /* minutes after the hour [0-59] */
00477         int  tm_hour;    /* hours since midnight [0-23] */
00478         int  tm_mday;    /* day of the month [1-31] */
00479         int  tm_mon;     /* months since January [0-11] */
00480         int  tm_year;    /* years since 1900 */
00481         int  tm_wday;    /* days since Sunday [0-6] */
00482         int  tm_yday;    /* days since January 1 [0-365] */
00483         int  tm_isdst;   /* Daylight Savings Time flag */
00484         long tm_gmtoff;  /* offset from CUT in seconds */
00485         char *tm_zone;   /* timezone abbreviation */
00486     };
00487 #endif /* USE_WOLF_TM */
00488 #if defined(USE_WOLF_TIME_T)
00489     typedef long time_t;
00490 #endif
00491 #if defined(USE_WOLF_SUSECONDS_T)
00492     typedef long suseconds_t;
00493 #endif
00494 #if defined(USE_WOLF_TIMEVAL_T)
00495     struct timeval
00496     {
00497         time_t tv_sec;
00498         suseconds_t tv_usec;
00499     };
00500 #endif
00501 
00502     /* forward declarations */
00503 #if defined(USER_TIME)
00504     struct tm* gmtime(const time_t* timer);
00505     extern time_t XTIME(time_t * timer);
00506 
00507     #ifdef STACK_TRAP
00508         /* for stack trap tracking, don't call os gmtime on OS X/linux,
00509            uses a lot of stack spce */
00510         extern time_t time(time_t * timer);
00511         #define XTIME(tl)  time((tl))
00512     #endif /* STACK_TRAP */
00513 
00514 #elif defined(TIME_OVERRIDES)
00515     extern time_t XTIME(time_t * timer);
00516     extern struct tm* XGMTIME(const time_t* timer, struct tm* tmp);
00517 #elif defined(WOLFSSL_GMTIME)
00518     struct tm* gmtime(const time_t* timer);
00519 #endif
00520 #endif /* NO_ASN_TIME */
00521 
00522 #ifndef WOLFSSL_LEANPSK
00523     char* mystrnstr(const char* s1, const char* s2, unsigned int n);
00524 #endif
00525 
00526 #ifndef FILE_BUFFER_SIZE
00527     #define FILE_BUFFER_SIZE 1024     /* default static file buffer size for input,
00528                                     will use dynamic buffer if not big enough */
00529 #endif
00530 
00531 
00532 #ifdef __cplusplus
00533     }  /* extern "C" */
00534 #endif
00535 
00536 #endif /* WOLF_CRYPT_PORT_H */
00537 
00538