diff options
author | Darren Tucker <dtucker@zip.com.au> | 2013-10-10 10:32:39 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2013-10-10 10:32:39 +1100 |
commit | df62d71e64d29d1054e7a53d1a801075ef70335f (patch) | |
tree | 553ce71d17d086b7647205231ba56d27b2324ad2 /dh.c | |
parent | e6e52f8c5dc89a6767702e65bb595aaf7bc8991c (diff) |
- dtucker@cvs.openbsd.org 2013/10/08 11:42:13
[dh.c dh.h]
Increase the size of the Diffie-Hellman groups requested for a each
symmetric key size. New values from NIST Special Publication 800-57 with
the upper limit specified by RFC4419. Pointed out by Peter Backes, ok
djm@.
Diffstat (limited to 'dh.c')
-rw-r--r-- | dh.c | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh.c,v 1.51 2013/07/02 12:31:43 markus Exp $ */ | 1 | /* $OpenBSD: dh.c,v 1.52 2013/10/08 11:42:13 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Niels Provos. All rights reserved. | 3 | * Copyright (c) 2000 Niels Provos. All rights reserved. |
4 | * | 4 | * |
@@ -352,17 +352,20 @@ dh_new_group14(void) | |||
352 | 352 | ||
353 | /* | 353 | /* |
354 | * Estimates the group order for a Diffie-Hellman group that has an | 354 | * Estimates the group order for a Diffie-Hellman group that has an |
355 | * attack complexity approximately the same as O(2**bits). Estimate | 355 | * attack complexity approximately the same as O(2**bits). |
356 | * with: O(exp(1.9223 * (ln q)^(1/3) (ln ln q)^(2/3))) | 356 | * Values from NIST Special Publication 800-57: Recommendation for Key |
357 | * Management Part 1 (rev 3) limited by the recommended maximum value | ||
358 | * from RFC4419 section 3. | ||
357 | */ | 359 | */ |
358 | 360 | ||
359 | int | 361 | int |
360 | dh_estimate(int bits) | 362 | dh_estimate(int bits) |
361 | { | 363 | { |
362 | 364 | if (bits <= 112) | |
365 | return 2048; | ||
363 | if (bits <= 128) | 366 | if (bits <= 128) |
364 | return (1024); /* O(2**86) */ | 367 | return 3072; |
365 | if (bits <= 192) | 368 | if (bits <= 192) |
366 | return (2048); /* O(2**116) */ | 369 | return 7680; |
367 | return (4096); /* O(2**156) */ | 370 | return 8192; |
368 | } | 371 | } |