00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _DHAES_H
00029 #define _DHAES_H
00030
00031 #include "beecrypt.h"
00032 #include "dldp.h"
00033
00036 typedef struct
00037 {
00038 const dldp_p* param;
00039 const hashFunction* hash;
00040 const blockCipher* cipher;
00041 const keyedHashFunction* mac;
00042 int cipherkeybits;
00043 int mackeybits;
00044 } dhaes_pParameters;
00045
00048 typedef struct
00049 {
00050 dldp_p param;
00051 mp32number pub;
00052 mp32number pri;
00053 hashFunctionContext hash;
00054 blockCipherContext cipher;
00055 keyedHashFunctionContext mac;
00056 int cipherkeybits;
00057 int mackeybits;
00058 } dhaes_pContext;
00059
00060 #ifdef __cplusplus
00061 extern "C" {
00062 #endif
00063
00066
00067 BEECRYPTAPI
00068 int dhaes_pUsable(const dhaes_pParameters* params)
00069 ;
00070
00071
00074
00075 BEECRYPTAPI
00076 int dhaes_pContextInit (dhaes_pContext* ctxt, const dhaes_pParameters* params)
00077 ;
00078
00079
00082 BEECRYPTAPI
00083 int dhaes_pContextInitDecrypt(dhaes_pContext* ctxt, const dhaes_pParameters* params, const mp32number* pri)
00084 ;
00085
00088 BEECRYPTAPI
00089 int dhaes_pContextInitEncrypt(dhaes_pContext* ctxt, const dhaes_pParameters* params, const mp32number* pub)
00090 ;
00091
00094 BEECRYPTAPI
00095 int dhaes_pContextFree ( dhaes_pContext* ctxt)
00096 ;
00097
00100 BEECRYPTAPI
00101 memchunk* dhaes_pContextEncrypt(dhaes_pContext* ctxt, mp32number* ephemeralPublicKey, mp32number* mac, const memchunk* cleartext, randomGeneratorContext* rng)
00102 ;
00103
00106 BEECRYPTAPI
00107 memchunk* dhaes_pContextDecrypt(dhaes_pContext* ctxt, const mp32number* ephemeralPublicKey, const mp32number* mac, const memchunk* ciphertext)
00108 ;
00109
00110 #ifdef __cplusplus
00111 }
00112 #endif
00113
00114 #endif