dh.c
Go to the documentation of this file.
1 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
2  * All rights reserved.
3  *
4  * This package is an SSL implementation written
5  * by Eric Young (eay@cryptsoft.com).
6  * The implementation was written so as to conform with Netscapes SSL.
7  *
8  * This library is free for commercial and non-commercial use as long as
9  * the following conditions are aheared to. The following conditions
10  * apply to all code found in this distribution, be it the RC4, RSA,
11  * lhash, DES, etc., code; not just the SSL code. The SSL documentation
12  * included with this distribution is covered by the same copyright terms
13  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
14  *
15  * Copyright remains Eric Young's, and as such any Copyright notices in
16  * the code are not to be removed.
17  * If this package is used in a product, Eric Young should be given attribution
18  * as the author of the parts of the library used.
19  * This can be in the form of a textual message at program startup or
20  * in documentation (online or textual) provided with the package.
21  *
22  * Redistribution and use in source and binary forms, with or without
23  * modification, are permitted provided that the following conditions
24  * are met:
25  * 1. Redistributions of source code must retain the copyright
26  * notice, this list of conditions and the following disclaimer.
27  * 2. Redistributions in binary form must reproduce the above copyright
28  * notice, this list of conditions and the following disclaimer in the
29  * documentation and/or other materials provided with the distribution.
30  * 3. All advertising materials mentioning features or use of this software
31  * must display the following acknowledgement:
32  * "This product includes cryptographic software written by
33  * Eric Young (eay@cryptsoft.com)"
34  * The word 'cryptographic' can be left out if the rouines from the library
35  * being used are not cryptographic related :-).
36  * 4. If you include any Windows specific code (or a derivative thereof) from
37  * the apps directory (application code) you must include an acknowledgement:
38  * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
39  *
40  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
41  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
44  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
46  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
48  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
49  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50  * SUCH DAMAGE.
51  *
52  * The licence and distribution terms for any publically available version or
53  * derivative of this code cannot be changed. i.e. this code cannot simply be
54  * copied and put under another distribution licence
55  * [including the GNU Public Licence.] */
56 
57 #include <openssl/dh.h>
58 
59 #include <string.h>
60 
61 #include <openssl/bn.h>
62 #include <openssl/err.h>
63 #include <openssl/digest.h>
64 #include <openssl/mem.h>
65 #include <openssl/thread.h>
66 
67 #include "../../internal.h"
68 #include "../bn/internal.h"
69 
70 
71 #define OPENSSL_DH_MAX_MODULUS_BITS 10000
72 
73 DH *DH_new(void) {
74  DH *dh = OPENSSL_malloc(sizeof(DH));
75  if (dh == NULL) {
77  return NULL;
78  }
79 
80  OPENSSL_memset(dh, 0, sizeof(DH));
81 
83 
84  dh->references = 1;
85 
86  return dh;
87 }
88 
89 void DH_free(DH *dh) {
90  if (dh == NULL) {
91  return;
92  }
93 
95  return;
96  }
97 
99  BN_clear_free(dh->p);
100  BN_clear_free(dh->g);
101  BN_clear_free(dh->q);
102  BN_clear_free(dh->j);
103  OPENSSL_free(dh->seed);
104  BN_clear_free(dh->counter);
105  BN_clear_free(dh->pub_key);
106  BN_clear_free(dh->priv_key);
108 
109  OPENSSL_free(dh);
110 }
111 
112 const BIGNUM *DH_get0_pub_key(const DH *dh) { return dh->pub_key; }
113 
114 const BIGNUM *DH_get0_priv_key(const DH *dh) { return dh->priv_key; }
115 
116 const BIGNUM *DH_get0_p(const DH *dh) { return dh->p; }
117 
118 const BIGNUM *DH_get0_q(const DH *dh) { return dh->q; }
119 
120 const BIGNUM *DH_get0_g(const DH *dh) { return dh->g; }
121 
122 void DH_get0_key(const DH *dh, const BIGNUM **out_pub_key,
123  const BIGNUM **out_priv_key) {
124  if (out_pub_key != NULL) {
125  *out_pub_key = dh->pub_key;
126  }
127  if (out_priv_key != NULL) {
128  *out_priv_key = dh->priv_key;
129  }
130 }
131 
132 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) {
133  if (pub_key != NULL) {
134  BN_free(dh->pub_key);
135  dh->pub_key = pub_key;
136  }
137 
138  if (priv_key != NULL) {
139  BN_free(dh->priv_key);
140  dh->priv_key = priv_key;
141  }
142 
143  return 1;
144 }
145 
146 void DH_get0_pqg(const DH *dh, const BIGNUM **out_p, const BIGNUM **out_q,
147  const BIGNUM **out_g) {
148  if (out_p != NULL) {
149  *out_p = dh->p;
150  }
151  if (out_q != NULL) {
152  *out_q = dh->q;
153  }
154  if (out_g != NULL) {
155  *out_g = dh->g;
156  }
157 }
158 
159 int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) {
160  if ((dh->p == NULL && p == NULL) ||
161  (dh->g == NULL && g == NULL)) {
162  return 0;
163  }
164 
165  if (p != NULL) {
166  BN_free(dh->p);
167  dh->p = p;
168  }
169 
170  if (q != NULL) {
171  BN_free(dh->q);
172  dh->q = q;
173  }
174 
175  if (g != NULL) {
176  BN_free(dh->g);
177  dh->g = g;
178  }
179 
180  return 1;
181 }
182 
183 int DH_set_length(DH *dh, unsigned priv_length) {
184  dh->priv_length = priv_length;
185  return 1;
186 }
187 
188 int DH_generate_key(DH *dh) {
189  int ok = 0;
190  int generate_new_key = 0;
191  BN_CTX *ctx = NULL;
192  BIGNUM *pub_key = NULL, *priv_key = NULL;
193 
196  goto err;
197  }
198 
199  ctx = BN_CTX_new();
200  if (ctx == NULL) {
201  goto err;
202  }
203 
204  if (dh->priv_key == NULL) {
205  priv_key = BN_new();
206  if (priv_key == NULL) {
207  goto err;
208  }
209  generate_new_key = 1;
210  } else {
211  priv_key = dh->priv_key;
212  }
213 
214  if (dh->pub_key == NULL) {
215  pub_key = BN_new();
216  if (pub_key == NULL) {
217  goto err;
218  }
219  } else {
220  pub_key = dh->pub_key;
221  }
222 
224  dh->p, ctx)) {
225  goto err;
226  }
227 
228  if (generate_new_key) {
229  if (dh->q) {
230  if (!BN_rand_range_ex(priv_key, 2, dh->q)) {
231  goto err;
232  }
233  } else {
234  // secret exponent length
235  unsigned priv_bits = dh->priv_length;
236  if (priv_bits == 0) {
237  const unsigned p_bits = BN_num_bits(dh->p);
238  if (p_bits == 0) {
239  goto err;
240  }
241 
242  priv_bits = p_bits - 1;
243  }
244 
245  if (!BN_rand(priv_key, priv_bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY)) {
246  goto err;
247  }
248  }
249  }
250 
251  if (!BN_mod_exp_mont_consttime(pub_key, dh->g, priv_key, dh->p, ctx,
252  dh->method_mont_p)) {
253  goto err;
254  }
255 
256  dh->pub_key = pub_key;
257  dh->priv_key = priv_key;
258  ok = 1;
259 
260 err:
261  if (ok != 1) {
263  }
264 
265  if (dh->pub_key == NULL) {
266  BN_free(pub_key);
267  }
268  if (dh->priv_key == NULL) {
269  BN_free(priv_key);
270  }
271  BN_CTX_free(ctx);
272  return ok;
273 }
274 
275 static int dh_compute_key(DH *dh, BIGNUM *out_shared_key,
276  const BIGNUM *peers_key, BN_CTX *ctx) {
279  return 0;
280  }
281 
282  if (dh->priv_key == NULL) {
284  return 0;
285  }
286 
287  int check_result;
288  if (!DH_check_pub_key(dh, peers_key, &check_result) || check_result) {
290  return 0;
291  }
292 
293  int ret = 0;
294  BN_CTX_start(ctx);
295  BIGNUM *p_minus_1 = BN_CTX_get(ctx);
296 
297  if (!p_minus_1 ||
299  dh->p, ctx)) {
300  goto err;
301  }
302 
303  if (!BN_mod_exp_mont_consttime(out_shared_key, peers_key, dh->priv_key, dh->p,
304  ctx, dh->method_mont_p) ||
305  !BN_copy(p_minus_1, dh->p) ||
306  !BN_sub_word(p_minus_1, 1)) {
308  goto err;
309  }
310 
311  // This performs the check required by SP 800-56Ar3 section 5.7.1.1 step two.
312  if (BN_cmp_word(out_shared_key, 1) <= 0 ||
313  BN_cmp(out_shared_key, p_minus_1) == 0) {
315  goto err;
316  }
317 
318  ret = 1;
319 
320  err:
321  BN_CTX_end(ctx);
322  return ret;
323 }
324 
325 int DH_compute_key_padded(unsigned char *out, const BIGNUM *peers_key, DH *dh) {
326  BN_CTX *ctx = BN_CTX_new();
327  if (ctx == NULL) {
328  return -1;
329  }
330  BN_CTX_start(ctx);
331 
332  int dh_size = DH_size(dh);
333  int ret = -1;
334  BIGNUM *shared_key = BN_CTX_get(ctx);
335  if (shared_key &&
336  dh_compute_key(dh, shared_key, peers_key, ctx) &&
337  BN_bn2bin_padded(out, dh_size, shared_key)) {
338  ret = dh_size;
339  }
340 
341  BN_CTX_end(ctx);
342  BN_CTX_free(ctx);
343  return ret;
344 }
345 
346 int DH_compute_key(unsigned char *out, const BIGNUM *peers_key, DH *dh) {
347  BN_CTX *ctx = BN_CTX_new();
348  if (ctx == NULL) {
349  return -1;
350  }
351  BN_CTX_start(ctx);
352 
353  int ret = -1;
354  BIGNUM *shared_key = BN_CTX_get(ctx);
355  if (shared_key && dh_compute_key(dh, shared_key, peers_key, ctx)) {
356  ret = BN_bn2bin(shared_key, out);
357  }
358 
359  BN_CTX_end(ctx);
360  BN_CTX_free(ctx);
361  return ret;
362 }
363 
364 int DH_compute_key_hashed(DH *dh, uint8_t *out, size_t *out_len,
365  size_t max_out_len, const BIGNUM *peers_key,
366  const EVP_MD *digest) {
367  *out_len = (size_t)-1;
368 
369  const size_t digest_len = EVP_MD_size(digest);
370  if (digest_len > max_out_len) {
371  return 0;
372  }
373 
374  int ret = 0;
375  const size_t dh_len = DH_size(dh);
376  uint8_t *shared_bytes = OPENSSL_malloc(dh_len);
377  unsigned out_len_unsigned;
378  if (!shared_bytes ||
379  // SP 800-56A is ambiguous about whether the output should be padded prior
380  // to revision three. But revision three, section C.1, awkwardly specifies
381  // padding to the length of p.
382  //
383  // Also, padded output avoids side-channels, so is always strongly
384  // advisable.
385  DH_compute_key_padded(shared_bytes, peers_key, dh) != (int)dh_len ||
386  !EVP_Digest(shared_bytes, dh_len, out, &out_len_unsigned, digest, NULL) ||
387  out_len_unsigned != digest_len) {
388  goto err;
389  }
390 
391  *out_len = digest_len;
392  ret = 1;
393 
394  err:
395  OPENSSL_free(shared_bytes);
396  return ret;
397 }
398 
399 int DH_size(const DH *dh) { return BN_num_bytes(dh->p); }
400 
401 unsigned DH_num_bits(const DH *dh) { return BN_num_bits(dh->p); }
402 
403 int DH_up_ref(DH *dh) {
405  return 1;
406 }
407 
409  // This is the prime from https://tools.ietf.org/html/rfc7919#appendix-A.1,
410  // which is specifically approved for FIPS in appendix D of SP 800-56Ar3.
411  static const BN_ULONG kFFDHE2048Data[] = {
412  TOBN(0xffffffff, 0xffffffff), TOBN(0x886b4238, 0x61285c97),
413  TOBN(0xc6f34a26, 0xc1b2effa), TOBN(0xc58ef183, 0x7d1683b2),
414  TOBN(0x3bb5fcbc, 0x2ec22005), TOBN(0xc3fe3b1b, 0x4c6fad73),
415  TOBN(0x8e4f1232, 0xeef28183), TOBN(0x9172fe9c, 0xe98583ff),
416  TOBN(0xc03404cd, 0x28342f61), TOBN(0x9e02fce1, 0xcdf7e2ec),
417  TOBN(0x0b07a7c8, 0xee0a6d70), TOBN(0xae56ede7, 0x6372bb19),
418  TOBN(0x1d4f42a3, 0xde394df4), TOBN(0xb96adab7, 0x60d7f468),
419  TOBN(0xd108a94b, 0xb2c8e3fb), TOBN(0xbc0ab182, 0xb324fb61),
420  TOBN(0x30acca4f, 0x483a797a), TOBN(0x1df158a1, 0x36ade735),
421  TOBN(0xe2a689da, 0xf3efe872), TOBN(0x984f0c70, 0xe0e68b77),
422  TOBN(0xb557135e, 0x7f57c935), TOBN(0x85636555, 0x3ded1af3),
423  TOBN(0x2433f51f, 0x5f066ed0), TOBN(0xd3df1ed5, 0xd5fd6561),
424  TOBN(0xf681b202, 0xaec4617a), TOBN(0x7d2fe363, 0x630c75d8),
425  TOBN(0xcc939dce, 0x249b3ef9), TOBN(0xa9e13641, 0x146433fb),
426  TOBN(0xd8b9c583, 0xce2d3695), TOBN(0xafdc5620, 0x273d3cf1),
427  TOBN(0xadf85458, 0xa2bb4a9a), TOBN(0xffffffff, 0xffffffff),
428  };
429 
430  BIGNUM *const ffdhe2048_p = BN_new();
431  BIGNUM *const ffdhe2048_q = BN_new();
432  BIGNUM *const ffdhe2048_g = BN_new();
433  DH *const dh = DH_new();
434 
435  if (!ffdhe2048_p || !ffdhe2048_q || !ffdhe2048_g || !dh) {
436  goto err;
437  }
438 
439  bn_set_static_words(ffdhe2048_p, kFFDHE2048Data,
440  OPENSSL_ARRAY_SIZE(kFFDHE2048Data));
441 
442  if (!BN_rshift1(ffdhe2048_q, ffdhe2048_p) ||
443  !BN_set_word(ffdhe2048_g, 2) ||
444  !DH_set0_pqg(dh, ffdhe2048_p, ffdhe2048_q, ffdhe2048_g)) {
445  goto err;
446  }
447 
448  return dh;
449 
450  err:
451  BN_free(ffdhe2048_p);
452  BN_free(ffdhe2048_q);
453  BN_free(ffdhe2048_g);
454  DH_free(dh);
455  return NULL;
456 }
DH_get0_pub_key
const BIGNUM * DH_get0_pub_key(const DH *dh)
Definition: dh.c:112
bn.h
DH_compute_key_hashed
int DH_compute_key_hashed(DH *dh, uint8_t *out, size_t *out_len, size_t max_out_len, const BIGNUM *peers_key, const EVP_MD *digest)
Definition: dh.c:364
dh_st::references
CRYPTO_refcount_t references
Definition: dh.h:326
gen_build_yaml.out
dictionary out
Definition: src/benchmark/gen_build_yaml.py:24
BN_rshift1
#define BN_rshift1
Definition: boringssl_prefix_symbols.h:988
DH_get0_priv_key
const BIGNUM * DH_get0_priv_key(const DH *dh)
Definition: dh.c:114
ctx
Definition: benchmark-async.c:30
BN_clear_free
#define BN_clear_free
Definition: boringssl_prefix_symbols.h:911
env_md_st
Definition: third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/internal.h:67
DH_get0_p
const BIGNUM * DH_get0_p(const DH *dh)
Definition: dh.c:116
OPENSSL_PUT_ERROR
#define OPENSSL_PUT_ERROR(library, reason)
Definition: err.h:423
string.h
OPENSSL_ARRAY_SIZE
#define OPENSSL_ARRAY_SIZE(array)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:179
BN_rand
#define BN_rand
Definition: boringssl_prefix_symbols.h:984
DH_new
DH * DH_new(void)
Definition: dh.c:73
error_ref_leak.err
err
Definition: error_ref_leak.py:35
DH_get0_pqg
void DH_get0_pqg(const DH *dh, const BIGNUM **out_p, const BIGNUM **out_q, const BIGNUM **out_g)
Definition: dh.c:146
dh_st::method_mont_p_lock
CRYPTO_MUTEX method_mont_p_lock
Definition: dh.h:315
BN_free
#define BN_free
Definition: boringssl_prefix_symbols.h:923
bignum_ctx
Definition: ctx.c:91
BN_CTX_get
#define BN_CTX_get
Definition: boringssl_prefix_symbols.h:884
xds_manager.p
p
Definition: xds_manager.py:60
DH_R_INVALID_PUBKEY
#define DH_R_INVALID_PUBKEY
Definition: dh.h:347
BN_num_bytes
#define BN_num_bytes
Definition: boringssl_prefix_symbols.h:976
CRYPTO_MUTEX_init
#define CRYPTO_MUTEX_init
Definition: boringssl_prefix_symbols.h:1124
DH_R_NO_PRIVATE_VALUE
#define DH_R_NO_PRIVATE_VALUE
Definition: dh.h:349
BN_set_word
#define BN_set_word
Definition: boringssl_prefix_symbols.h:992
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
OPENSSL_memset
static void * OPENSSL_memset(void *dst, int c, size_t n)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:835
DH_compute_key_padded
int DH_compute_key_padded(unsigned char *out, const BIGNUM *peers_key, DH *dh)
Definition: dh.c:325
DH_R_MODULUS_TOO_LARGE
#define DH_R_MODULUS_TOO_LARGE
Definition: dh.h:348
OPENSSL_malloc
#define OPENSSL_malloc
Definition: boringssl_prefix_symbols.h:1885
dh_st::pub_key
BIGNUM * pub_key
Definition: dh.h:308
dh.h
dh_st::q
BIGNUM * q
Definition: dh.h:319
DH_get0_g
const BIGNUM * DH_get0_g(const DH *dh)
Definition: dh.c:120
dh_st::priv_key
BIGNUM * priv_key
Definition: dh.h:309
EVP_MD_size
#define EVP_MD_size
Definition: boringssl_prefix_symbols.h:1579
BN_cmp_word
#define BN_cmp_word
Definition: boringssl_prefix_symbols.h:913
DH_get0_key
void DH_get0_key(const DH *dh, const BIGNUM **out_pub_key, const BIGNUM **out_priv_key)
Definition: dh.c:122
BN_RAND_BOTTOM_ANY
#define BN_RAND_BOTTOM_ANY
Definition: bn.h:602
DH_set0_pqg
int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g)
Definition: dh.c:159
BN_sub_word
#define BN_sub_word
Definition: boringssl_prefix_symbols.h:996
dh_st::seed
unsigned char * seed
Definition: dh.h:321
err.h
ERR_R_BN_LIB
#define ERR_R_BN_LIB
Definition: err.h:331
dh_st::priv_length
unsigned priv_length
Definition: dh.h:313
BN_CTX_new
#define BN_CTX_new
Definition: boringssl_prefix_symbols.h:885
dh_st::counter
BIGNUM * counter
Definition: dh.h:323
BN_bn2bin
#define BN_bn2bin
Definition: boringssl_prefix_symbols.h:901
g
struct @717 g
DH_compute_key
int DH_compute_key(unsigned char *out, const BIGNUM *peers_key, DH *dh)
Definition: dh.c:346
DH_up_ref
int DH_up_ref(DH *dh)
Definition: dh.c:403
dh_st::g
BIGNUM * g
Definition: dh.h:307
BN_MONT_CTX_set_locked
#define BN_MONT_CTX_set_locked
Definition: boringssl_prefix_symbols.h:895
BN_RAND_TOP_ONE
#define BN_RAND_TOP_ONE
Definition: bn.h:598
bn_set_static_words
#define bn_set_static_words
Definition: boringssl_prefix_symbols.h:2906
DH_size
int DH_size(const DH *dh)
Definition: dh.c:399
BN_copy
#define BN_copy
Definition: boringssl_prefix_symbols.h:914
BN_num_bits
#define BN_num_bits
Definition: boringssl_prefix_symbols.h:974
DH_get_rfc7919_2048
DH * DH_get_rfc7919_2048(void)
Definition: dh.c:408
CRYPTO_MUTEX_cleanup
#define CRYPTO_MUTEX_cleanup
Definition: boringssl_prefix_symbols.h:1123
digest.h
EVP_Digest
#define EVP_Digest
Definition: boringssl_prefix_symbols.h:1506
dh_st::method_mont_p
BN_MONT_CTX * method_mont_p
Definition: dh.h:316
BN_CTX_start
#define BN_CTX_start
Definition: boringssl_prefix_symbols.h:886
DH_set_length
int DH_set_length(DH *dh, unsigned priv_length)
Definition: dh.c:183
dh_compute_key
static int dh_compute_key(DH *dh, BIGNUM *out_shared_key, const BIGNUM *peers_key, BN_CTX *ctx)
Definition: dh.c:275
bignum_st
Definition: bn.h:957
BN_CTX_free
#define BN_CTX_free
Definition: boringssl_prefix_symbols.h:883
ret
UniquePtr< SSL_SESSION > ret
Definition: ssl_x509.cc:1029
BN_cmp
#define BN_cmp
Definition: boringssl_prefix_symbols.h:912
BN_mod_exp_mont_consttime
#define BN_mod_exp_mont_consttime
Definition: boringssl_prefix_symbols.h:951
DH_free
void DH_free(DH *dh)
Definition: dh.c:89
BN_rand_range_ex
#define BN_rand_range_ex
Definition: boringssl_prefix_symbols.h:986
DH_num_bits
unsigned DH_num_bits(const DH *dh)
Definition: dh.c:401
ok
bool ok
Definition: async_end2end_test.cc:197
OPENSSL_DH_MAX_MODULUS_BITS
#define OPENSSL_DH_MAX_MODULUS_BITS
Definition: dh.c:71
BN_bn2bin_padded
#define BN_bn2bin_padded
Definition: boringssl_prefix_symbols.h:902
BN_MONT_CTX_free
#define BN_MONT_CTX_free
Definition: boringssl_prefix_symbols.h:890
dh_st::p
BIGNUM * p
Definition: dh.h:306
dh_st::j
BIGNUM * j
Definition: dh.h:320
CRYPTO_refcount_inc
#define CRYPTO_refcount_inc
Definition: boringssl_prefix_symbols.h:1191
BN_CTX_end
#define BN_CTX_end
Definition: boringssl_prefix_symbols.h:882
DH_generate_key
int DH_generate_key(DH *dh)
Definition: dh.c:188
DH_set0_key
int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key)
Definition: dh.c:132
dh_st
Definition: dh.h:305
mem.h
thread.h
OPENSSL_free
#define OPENSSL_free
Definition: boringssl_prefix_symbols.h:1869
BN_new
#define BN_new
Definition: boringssl_prefix_symbols.h:971
ERR_R_MALLOC_FAILURE
#define ERR_R_MALLOC_FAILURE
Definition: err.h:371
CRYPTO_refcount_dec_and_test_zero
#define CRYPTO_refcount_dec_and_test_zero
Definition: boringssl_prefix_symbols.h:1190
DH_check_pub_key
#define DH_check_pub_key
Definition: boringssl_prefix_symbols.h:1220
DH_get0_q
const BIGNUM * DH_get0_q(const DH *dh)
Definition: dh.c:118


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:16