00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00033 #ifndef _DHIES_H
00034 #define _DHIES_H
00035
00036 #include "beecrypt/beecrypt.h"
00037 #include "beecrypt/dldp.h"
00038
00039 #ifdef __cplusplus
00040 struct BEECRYPTAPI dhies_pParameters
00041 #else
00042 struct _dhies_pParameters
00043 #endif
00044 {
00045 const dldp_p* param;
00046 const hashFunction* hash;
00047 const blockCipher* cipher;
00048 const keyedHashFunction* mac;
00049 size_t cipherkeybits;
00050 size_t mackeybits;
00051 };
00052
00053 #ifndef __cplusplus
00054 typedef struct _dhies_pParameters dhies_pParameters;
00055 #endif
00056
00057 #ifdef __cplusplus
00058 struct BEECRYPTAPI dhies_pContext
00059 #else
00060 struct _dhies_pContext
00061 #endif
00062 {
00063 dldp_p param;
00064 mpnumber pub;
00065 mpnumber pri;
00066 hashFunctionContext hash;
00067 blockCipherContext cipher;
00068 keyedHashFunctionContext mac;
00069 size_t cipherkeybits;
00070 size_t mackeybits;
00071 };
00072
00073 #ifndef __cplusplus
00074 typedef struct _dhies_pContext dhies_pContext;
00075 #endif
00076
00077 #ifdef __cplusplus
00078 extern "C" {
00079 #endif
00080
00081 BEECRYPTAPI
00082 int dhies_pUsable(const dhies_pParameters*);
00083
00084 BEECRYPTAPI
00085 int dhies_pContextInit (dhies_pContext*, const dhies_pParameters*);
00086 BEECRYPTAPI
00087 int dhies_pContextInitDecrypt(dhies_pContext*, const dhies_pParameters*, const mpnumber*);
00088 BEECRYPTAPI
00089 int dhies_pContextInitEncrypt(dhies_pContext*, const dhies_pParameters*, const mpnumber*);
00090 BEECRYPTAPI
00091 int dhies_pContextFree (dhies_pContext*);
00092
00093 BEECRYPTAPI
00094 memchunk* dhies_pContextEncrypt(dhies_pContext*, mpnumber*, mpnumber*, const memchunk*, randomGeneratorContext*);
00095 BEECRYPTAPI
00096 memchunk* dhies_pContextDecrypt(dhies_pContext*, const mpnumber*, const mpnumber*, const memchunk*);
00097
00098 #ifdef __cplusplus
00099 }
00100 #endif
00101
00102 #endif