00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00026 #ifndef _FIPS186_H
00027 #define _FIPS186_H
00028
00029 #include "beecrypt/beecrypt.h"
00030
00031 #ifdef _REENTRANT
00032 # if WIN32
00033 # include <windows.h>
00034 # include <winbase.h>
00035 # endif
00036 #endif
00037
00038 #include "beecrypt.h"
00039 #include "sha1.h"
00040
00041 #if (MP_WBITS == 64)
00042 # define FIPS186_STATE_SIZE 8
00043 #elif (MP_WBITS == 32)
00044 # define FIPS186_STATE_SIZE 16
00045 #else
00046 # error
00047 #endif
00048
00051 #ifdef __cplusplus
00052 struct BEECRYPTAPI fips186Param
00053 #else
00054 struct _fips186Param
00055 #endif
00056 {
00057 #ifdef _REENTRANT
00058 bc_mutex_t lock;
00059 #endif
00060 sha1Param param;
00061 mpw state[FIPS186_STATE_SIZE];
00062 byte digest[20];
00063 unsigned char digestremain;
00064 };
00065
00066 #ifndef __cplusplus
00067 typedef struct _fips186Param fips186Param;
00068 #endif
00069
00070 #ifdef __cplusplus
00071 extern "C" {
00072 #endif
00073
00074 extern BEECRYPTAPI const randomGenerator fips186prng;
00075
00076 BEECRYPTAPI
00077 int fips186Setup (fips186Param*);
00078 BEECRYPTAPI
00079 int fips186Seed (fips186Param*, const byte*, size_t);
00080 BEECRYPTAPI
00081 int fips186Next (fips186Param*, byte*, size_t);
00082 BEECRYPTAPI
00083 int fips186Cleanup(fips186Param*);
00084
00085 #ifdef __cplusplus
00086 }
00087 #endif
00088
00089 #endif