Skip to content

Commit

Permalink
- [email protected] 2001/04/03 19:53:29
Browse files Browse the repository at this point in the history
     [dh.c dh.h kex.c kex.h sshconnect2.c sshd.c]
     move kex to kex*.c, used dispatch_set() callbacks for kex. should
     make rekeying easier.
  • Loading branch information
mouring committed Apr 4, 2001
1 parent 86ebcb6 commit 20d7c7b
Show file tree
Hide file tree
Showing 7 changed files with 284 additions and 959 deletions.
6 changes: 5 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
- [email protected] 2001/04/03 13:56:11
[sftp-glob.c ssh-agent.c ssh-keygen.c]
free() -> xfree()
- [email protected] 2001/04/03 19:53:29
[dh.c dh.h kex.c kex.h sshconnect2.c sshd.c]
move kex to kex*.c, used dispatch_set() callbacks for kex. should
make rekeying easier.

20010403
- OpenBSD CVS Sync
Expand Down Expand Up @@ -4816,4 +4820,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1

$Id: ChangeLog,v 1.1049 2001/04/04 01:53:20 mouring Exp $
$Id: ChangeLog,v 1.1050 2001/04/04 01:56:17 mouring Exp $
21 changes: 20 additions & 1 deletion dh.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

#include "includes.h"
RCSID("$OpenBSD: dh.c,v 1.11 2001/03/29 21:17:39 markus Exp $");
RCSID("$OpenBSD: dh.c,v 1.12 2001/04/03 19:53:29 markus Exp $");

#include "xmalloc.h"

Expand Down Expand Up @@ -273,3 +273,22 @@ dh_new_group1(void)

return (dh_new_group_asc(gen, group1));
}

/*
* Estimates the group order for a Diffie-Hellman group that has an
* attack complexity approximately the same as O(2**bits). Estimate
* with: O(exp(1.9223 * (ln q)^(1/3) (ln ln q)^(2/3)))
*/

int
dh_estimate(int bits)
{

if (bits < 64)
return (512); /* O(2**63) */
if (bits < 128)
return (1024); /* O(2**86) */
if (bits < 192)
return (2048); /* O(2**116) */
return (4096); /* O(2**156) */
}
4 changes: 3 additions & 1 deletion dh.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: dh.h,v 1.4 2001/03/29 21:17:39 markus Exp $ */
/* $OpenBSD: dh.h,v 1.5 2001/04/03 19:53:29 markus Exp $ */

/*
* Copyright (c) 2000 Niels Provos. All rights reserved.
Expand Down Expand Up @@ -40,6 +40,8 @@ DH *dh_new_group1(void);
void dh_gen_key(DH *, int);
int dh_pub_is_valid(DH *dh, BIGNUM *dh_pub);

int dh_estimate(int bits);

#define DH_GRP_MIN 1024
#define DH_GRP_MAX 8192

Expand Down
Loading

0 comments on commit 20d7c7b

Please sign in to comment.