BeeCrypt 4.2.1
|
00001 /* 00002 * Copyright (c) 2000, 2001, 2002, 2005 X-Way Rights BV 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 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