Main Page Modules Data Structures File List Data Fields Globals Related Pages

# beecrypt/dhaes.h

Go to the documentation of this file.

    00001
    00007 /*
    00008  * Copyright (c) 2000, 2001 Virtual Unlimited, B.V.
    00009  *
    00010  * Author: Bob Deblier <bob@virtualunlimited.com>
    00011  *
    00012  * This library is free software; you can redistribute it and/or
    00013  * modify it under the terms of the GNU Lesser General Public
    00014  * License as published by the Free Software Foundation; either
    00015  * version 2.1 of the License, or (at your option) any later version.
    00016  *
    00017  * This library is distributed in the hope that it will be useful,
    00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00020  * Lesser General Public License for more details.
    00021  *
    00022  * You should have received a copy of the GNU Lesser General Public
    00023  * License along with this library; if not, write to the Free Software
    00024  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    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 /*@-exportlocal@*/
    00067 BEECRYPTAPI
    00068 int dhaes_pUsable(const dhaes_pParameters* params)
    00069         /*@*/;
    00070 /*@=exportlocal@*/
    00071
    00074 /*@-exportlocal@*/
    00075 BEECRYPTAPI
    00076 int dhaes_pContextInit       (dhaes_pContext* ctxt, const dhaes_pParameters* params)
    00077         /*@modifies ctxt */;
    00078 /*@=exportlocal@*/
    00079
    00082 BEECRYPTAPI /*@unused@*/
    00083 int dhaes_pContextInitDecrypt(dhaes_pContext* ctxt, const dhaes_pParameters* params, const mp32number* pri)
    00084         /*@modifies ctxt */;
    00085
    00088 BEECRYPTAPI /*@unused@*/
    00089 int dhaes_pContextInitEncrypt(dhaes_pContext* ctxt, const dhaes_pParameters* params, const mp32number* pub)
    00090         /*@modifies ctxt */;
    00091
    00094 BEECRYPTAPI /*@unused@*/
    00095 int dhaes_pContextFree       (/*@only@*/ dhaes_pContext* ctxt)
    00096         /*@modifies ctxt */;
    00097
    00100 BEECRYPTAPI /*@only@*/ /*@null@*/ /*@unused@*/
    00101 memchunk* dhaes_pContextEncrypt(dhaes_pContext* ctxt,       mp32number* ephemeralPublicKey,       mp32number* mac, const memchunk* cleartext, randomGeneratorContext* rng)
    00102         /*@modifies ctxt, ephemeralPublicKey, mac, rng */;
    00103
    00106 BEECRYPTAPI /*@only@*/ /*@null@*/ /*@unused@*/
    00107 memchunk* dhaes_pContextDecrypt(dhaes_pContext* ctxt, const mp32number* ephemeralPublicKey, const mp32number* mac, const memchunk* ciphertext)
    00108         /*@modifies ctxt */;
    00109
    00110 #ifdef __cplusplus
    00111 }
    00112 #endif
    00113
    00114 #endif