dh.h revision 137015
119370Spst/*	$OpenBSD: dh.h,v 1.8 2004/06/13 12:53:24 djm Exp $	*/
298948Sobrien
3130809Smarcel/*
498948Sobrien * Copyright (c) 2000 Niels Provos.  All rights reserved.
519370Spst *
619370Spst * Redistribution and use in source and binary forms, with or without
798948Sobrien * modification, are permitted provided that the following conditions
819370Spst * are met:
998948Sobrien * 1. Redistributions of source code must retain the above copyright
1098948Sobrien *    notice, this list of conditions and the following disclaimer.
1198948Sobrien * 2. Redistributions in binary form must reproduce the above copyright
1298948Sobrien *    notice, this list of conditions and the following disclaimer in the
1319370Spst *    documentation and/or other materials provided with the distribution.
1498948Sobrien *
1598948Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1698948Sobrien * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1798948Sobrien * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1819370Spst * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1998948Sobrien * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2098948Sobrien * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2198948Sobrien * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2298948Sobrien * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2319370Spst * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2419370Spst * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2519370Spst */
2619370Spst#ifndef DH_H
2746283Sdfr#define DH_H
2819370Spst
2919370Spststruct dhgroup {
3019370Spst	int size;
31130809Smarcel	BIGNUM *g;
3219370Spst	BIGNUM *p;
3319370Spst};
3419370Spst
3519370SpstDH	*choose_dh(int, int, int);
3619370SpstDH	*dh_new_group_asc(const char *, const char *);
3719370SpstDH	*dh_new_group(BIGNUM *, BIGNUM *);
3819370SpstDH	*dh_new_group1(void);
3919370SpstDH	*dh_new_group14(void);
4019370Spst
4119370Spstvoid	 dh_gen_key(DH *, int);
4219370Spstint	 dh_pub_is_valid(DH *, BIGNUM *);
4319370Spst
4498948Sobrienint	 dh_estimate(int);
45130809Smarcel
46130809Smarcel#define DH_GRP_MIN	1024
4719370Spst#define DH_GRP_MAX	8192
48130809Smarcel
49130809Smarcel#endif
5098948Sobrien