00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _FIPS186_H
00029 #define _FIPS186_H
00030
00031 #include "beecrypt.h"
00032
00033 #ifdef _REENTRANT
00034 # if WIN32
00035 # include <windows.h>
00036 # include <winbase.h>
00037 # else
00038 # if HAVE_THREAD_H && HAVE_SYNCH_H
00039 # include <synch.h>
00040 # elif HAVE_PTHREAD_H
00041 # include <pthread.h>
00042 # else
00043 # error need locking mechanism
00044 # endif
00045 # endif
00046 #endif
00047
00048 #include "sha1.h"
00049
00050 #define FIPS186_STATE_SIZE 16
00051
00054 typedef struct
00055 {
00056 #ifdef _REENTRANT
00057 # if WIN32
00058 HANDLE lock;
00059 # else
00060 # if HAVE_THREAD_H && HAVE_SYNCH_H
00061 mutex_t lock;
00062 # elif HAVE_PTHREAD_H
00063 pthread_mutex_t lock;
00064 # else
00065 # error need locking mechanism
00066 # endif
00067 # endif
00068 #endif
00069 sha1Param param;
00070 uint32 state[FIPS186_STATE_SIZE];
00071 int digestsize;
00072 } fips186Param;
00073
00074 #ifdef __cplusplus
00075 extern "C" {
00076 #endif
00077
00080
00081 extern BEECRYPTAPI const randomGenerator fips186prng;
00082
00085
00086 BEECRYPTAPI
00087 int fips186Setup (fips186Param* fp)
00088 ;
00089
00090
00093
00094 BEECRYPTAPI
00095 int fips186Seed (fips186Param* fp, const uint32* data, int size)
00096 ;
00097
00098
00101
00102 BEECRYPTAPI
00103 int fips186Next (fips186Param* fp, uint32* data, int size)
00104 ;
00105
00106
00109
00110 BEECRYPTAPI
00111 int fips186Cleanup(fips186Param* fp)
00112 ;
00113
00114
00115 #ifdef __cplusplus
00116 }
00117 #endif
00118
00119 #endif