1 .\" $OpenBSD: get_rfc3526_prime_8192.3,v 1.4 2018/03/23 23:18:17 schwarze Exp $
2 .\" checked up to: OpenSSL DH_get_1024_160 99d63d46 Oct 26 13:56:48 2016 -0400
4 .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 .Dd $Mdocdate: March 23 2018 $
19 .Dt GET_RFC3526_PRIME_8192 3
22 .Nm get_rfc2409_prime_768 ,
23 .Nm get_rfc2409_prime_1024 ,
24 .Nm get_rfc3526_prime_1536 ,
25 .Nm get_rfc3526_prime_2048 ,
26 .Nm get_rfc3526_prime_3072 ,
27 .Nm get_rfc3526_prime_4096 ,
28 .Nm get_rfc3526_prime_6144 ,
29 .Nm get_rfc3526_prime_8192 ,
30 .Nm BN_get_rfc2409_prime_768 ,
31 .Nm BN_get_rfc2409_prime_1024 ,
32 .Nm BN_get_rfc3526_prime_2048 ,
33 .Nm BN_get_rfc3526_prime_3072 ,
34 .Nm BN_get_rfc3526_prime_4096 ,
35 .Nm BN_get_rfc3526_prime_6144 ,
36 .Nm BN_get_rfc3526_prime_8192
37 .Nd standard moduli for Diffie-Hellmann key exchange
41 .Fn get_rfc2409_prime_768 "BIGNUM *bn"
43 .Fn get_rfc2409_prime_1024 "BIGNUM *bn"
45 .Fn get_rfc3526_prime_1536 "BIGNUM *bn"
47 .Fn get_rfc3526_prime_2048 "BIGNUM *bn"
49 .Fn get_rfc3526_prime_3072 "BIGNUM *bn"
51 .Fn get_rfc3526_prime_4096 "BIGNUM *bn"
53 .Fn get_rfc3526_prime_6144 "BIGNUM *bn"
55 .Fn get_rfc3526_prime_8192 "BIGNUM *bn"
57 .Fn BN_get_rfc2409_prime_768 "BIGNUM *bn"
59 .Fn BN_get_rfc2409_prime_1024 "BIGNUM *bn"
61 .Fn BN_get_rfc3526_prime_1536 "BIGNUM *bn"
63 .Fn BN_get_rfc3526_prime_2048 "BIGNUM *bn"
65 .Fn BN_get_rfc3526_prime_3072 "BIGNUM *bn"
67 .Fn BN_get_rfc3526_prime_4096 "BIGNUM *bn"
69 .Fn BN_get_rfc3526_prime_6144 "BIGNUM *bn"
71 .Fn BN_get_rfc3526_prime_8192 "BIGNUM *bn"
73 Each of these functions returns one specific constant Sophie Germain
76 The names with the prefix
78 are aliases for the names without that prefix.
86 object is created and returned.
87 Otherwise, the number is stored in
93 All these numbers are of the form
96 p = 2 sup s - 2 sup left ( s - 64 right ) - 1 + 2 sup 64 *
97 left { left [ 2 sup left ( s - 130 right ) pi right ] + offset right }
103 is the size of the binary representation of the number in bits
104 and appears at the end of the function names.
105 As long as the offset is sufficiently small, the above form assures
106 that the top and bottom 64 bits of each number are all 1.
108 The offsets are defined in the standards as follows:
109 .Bl -column 16n 8n -offset indent
110 .It size Ar s Ta Ar offset
112 .It \ 768 = 3 * 2^8 Ta 149686
113 .It 1024 = 2 * 2^9 Ta 129093
114 .It 1536 = 3 * 2^9 Ta 741804
115 .It 2048 = 2 * 2^10 Ta 124476
116 .It 3072 = 3 * 2^10 Ta 1690314
117 .It 4096 = 2 * 2^11 Ta 240904
118 .It 6144 = 3 * 2^11 Ta 929484
119 .It 8192 = 2 * 2^12 Ta 4743158
122 For each of these prime numbers, the finite group of natural numbers
125 where the group operation is defined as multiplication modulo
127 is used for Diffie-Hellmann key exchange.
128 The first two of these groups are called the First Oakley Group and
129 the Second Oakley Group.
130 Obiviously, all these groups are cyclic groups of order
132 respectively, and the numbers returned by these functions are not
135 If memory allocation fails, these functions return
137 That can happen even if
147 RFC 2409, "The Internet Key Exchange (IKE)", defines the Oakley Groups.
149 RFC 2412, "The OAKLEY Key Determination Protocol", contains additional
150 information about these numbers.
152 RFC 3526, "More Modular Exponential (MODP) Diffie-Hellman groups
153 for Internet Key Exchange (IKE)", defines the other six numbers.
155 .Fn get_rfc2409_prime_768 ,
156 .Fn get_rfc2409_prime_1024 ,
157 .Fn get_rfc3526_prime_1536 ,
158 .Fn get_rfc3526_prime_2048 ,
159 .Fn get_rfc3526_prime_3072 ,
160 .Fn get_rfc3526_prime_4096 ,
161 .Fn get_rfc3526_prime_6144 ,
163 .Fn get_rfc3526_prime_8192
164 first appeared in OpenSSL 0.9.8a and have been available since
169 aliases first appeared in OpenSSL 1.1.0 and have been available since
172 As all the memory needed for storing the numbers is dynamically
174 .Dv BN_FLG_STATIC_DATA
175 flag is not set on the returned
178 So be careful to not change the returned numbers.