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

beecrypt/dldp.h

Go to the documentation of this file.
00001 
00007 /*
00008  * <conformance statement for IEEE P1363 needed here>
00009  *
00010  * Copyright (c) 2000, 2001 Virtual Unlimited B.V.
00011  *
00012  * Author: Bob Deblier <bob@virtualunlimited.com>
00013  *
00014  * This library is free software; you can redistribute it and/or
00015  * modify it under the terms of the GNU Lesser General Public
00016  * License as published by the Free Software Foundation; either
00017  * version 2.1 of the License, or (at your option) any later version.
00018  *
00019  * This library is distributed in the hope that it will be useful,
00020  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00022  * Lesser General Public License for more details.
00023  *
00024  * You should have received a copy of the GNU Lesser General Public
00025  * License along with this library; if not, write to the Free Software
00026  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00027  *
00028  */
00029 
00030 #ifndef _DLDP_H
00031 #define _DLDP_H
00032 
00033 #include "beecrypt.h"
00034 #include "mp32barrett.h"
00035 
00051 typedef struct
00052 {
00053         mp32barrett p;
00054         mp32barrett q;
00055         mp32number  r;
00056         mp32number  g;
00057         mp32barrett n;
00058 } dldp_p;
00059 
00060 #ifdef __cplusplus
00061 extern "C" {
00062 #endif
00063 
00066 BEECRYPTAPI
00067 int dldp_pInit(dldp_p* dp)
00068         /*@modifies dp->p, dp->q, dp->r, dp->g, dp->n @*/;
00069 
00072 BEECRYPTAPI
00073 int dldp_pFree(/*@special@*/ dldp_p* dp)
00074         /*@releases dp->p.modl, dp->q.modl, dp->n.modl @*/
00075         /*@modifies dp->p, dp->q, dp->r, dp->g, dp->n @*/;
00076 
00079 BEECRYPTAPI
00080 int dldp_pCopy(dldp_p* dst, const dldp_p* src)
00081         /*@modifies dst @*/;
00082 
00083 /*
00084  * Functions for generating keys
00085  */
00086 
00089 BEECRYPTAPI /*@unused@*/
00090 int dldp_pPrivate(const dldp_p* dp, randomGeneratorContext* rgc, mp32number* x)
00091         /*@modifies rgc, x @*/;
00092 
00095 BEECRYPTAPI /*@unused@*/
00096 int dldp_pPublic(const dldp_p* dp, const mp32number* x, mp32number* y)
00097         /*@modifies y @*/;
00098 
00101 BEECRYPTAPI
00102 int dldp_pPair(const dldp_p* dp, randomGeneratorContext* rgc, mp32number* x, mp32number* y)
00103         /*@modifies rgc, x, y @*/;
00104 
00105 /*
00106  * Function for comparing domain parameters
00107  */
00108 
00109 
00112 BEECRYPTAPI
00113 int  dldp_pEqual(const dldp_p* a, const dldp_p* b)
00114         /*@*/;
00115 
00116 /*
00117  * Functions for generating and validating dldp_pgoq variant domain parameters
00118  */
00119 
00120 
00123 BEECRYPTAPI /*@unused@*/
00124 int dldp_pgoqMake(dldp_p* dp, randomGeneratorContext* rgc, uint32 psize, uint32 qsize, int cofactor)
00125         /*@modifies dp->p, dp->q, dp->r, dp->g, dp->n, rgc @*/;
00126 
00129 BEECRYPTAPI /*@unused@*/
00130 int dldp_pgoqMakeSafe(dldp_p* dp, randomGeneratorContext* rgc, uint32 psize)
00131         /*@modifies dp->p, dp->q, dp->r, dp->g, dp->n, rgc @*/;
00132 
00135 BEECRYPTAPI /*@unused@*/
00136 int dldp_pgoqGenerator(dldp_p* dp, randomGeneratorContext* rgc)
00137         /*@modifies dp->p, dp->q, dp->r, dp->g, dp->n, rgc @*/;
00138 
00141 BEECRYPTAPI /*@unused@*/
00142 int  dldp_pgoqValidate(const dldp_p*, randomGeneratorContext* rgc, int cofactor)
00143         /*@modifies rgc @*/;
00144 
00145 /*
00146  * Functions for generating and validating dldp_pgon variant domain parameters
00147  */
00148 
00151 BEECRYPTAPI /*@unused@*/
00152 int dldp_pgonMake(dldp_p* dp, randomGeneratorContext* rgc, uint32 psize, uint32 qsize)
00153         /*@modifies dp->p, dp->q, dp->r, dp->g, dp->n, rgc @*/;
00154 
00157 BEECRYPTAPI /*@unused@*/
00158 int dldp_pgonMakeSafe(dldp_p* dp, randomGeneratorContext* rgc, uint32 psize)
00159         /*@modifies dp->p, dp->q, dp->r, dp->g, dp->n, rgc @*/;
00160 
00163 BEECRYPTAPI /*@unused@*/
00164 int dldp_pgonGenerator(dldp_p* dp, randomGeneratorContext* rgc)
00165         /*@modifies dp->p, dp->q, dp->r, dp->g, dp->n, rgc @*/;
00166 
00169 BEECRYPTAPI /*@unused@*/
00170 int  dldp_pgonValidate(const dldp_p* dp, randomGeneratorContext* rgc)
00171         /*@modifies rgc @*/;
00172 
00173 #ifdef __cplusplus
00174 }
00175 #endif
00176 
00177 #endif

Generated on Tue Sep 17 15:56:36 2002 for rpm by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002