Skip to content

Commit

Permalink
Add RFC7919 documentation.
Browse files Browse the repository at this point in the history
Reviewed-by: Andy Polyakov <[email protected]>
(Merged from openssl#4485)
  • Loading branch information
snhenson committed Oct 12, 2017
1 parent dcb7e48 commit 5368bf0
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
39 changes: 39 additions & 0 deletions doc/man3/DH_new_by_nid.pod
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
=pod

=head1 NAME

DH_new_by_nid, DH_get_nid - get or find DH named parameters

=head1 SYNOPSIS

#include <openssl/dh.h>
DH *DH_new_by_nid(int nid);
int *DH_get_nid(const DH *dh);

=head1 DESCRIPTION

DH_new_by_nid() creates and returns a DH structure containing named parameters
B<nid>. Currently B<nid> must be B<NID_ffdhe2048>, B<NID_ffdhe3072>,
B<NID_ffdhe4096>, B<NID_ffdhe6144> or B<NID_ffdhe8192>.

DH_get_nid() determines if the parameters contained in B<dh> match
any named set. It returns the NID corresponding to the matching parameters or
B<NID_undef> if there is no match.

=head1 RETURN VALUES

DH_new_by_nid() returns a set of DH parameters or B<NULL> if an error occurred.

DH_get_nid() returns the NID of the matching set of parameters or
B<NID_undef> if there is no match.

=head1 COPYRIGHT

Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the OpenSSL license (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.

=cut
12 changes: 12 additions & 0 deletions doc/man3/EVP_PKEY_CTX_ctrl.pod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ EVP_PKEY_CTX_set_rsa_pss_saltlen, EVP_PKEY_CTX_set_rsa_keygen_bits,
EVP_PKEY_CTX_set_rsa_keygen_pubexp, EVP_PKEY_CTX_set_dsa_paramgen_bits,
EVP_PKEY_CTX_set_dh_paramgen_prime_len,
EVP_PKEY_CTX_set_dh_paramgen_generator,
EVP_PKEY_CTX_set_dh_pad, EVP_PKEY_CTX_set_dh_nid,
EVP_PKEY_CTX_set_ec_paramgen_curve_nid,
EVP_PKEY_CTX_set_ec_param_enc - algorithm specific control operations

Expand Down Expand Up @@ -35,6 +36,8 @@ EVP_PKEY_CTX_set_ec_param_enc - algorithm specific control operations
#include <openssl/dh.h>
int EVP_PKEY_CTX_set_dh_paramgen_prime_len(EVP_PKEY_CTX *ctx, int len);
int EVP_PKEY_CTX_set_dh_paramgen_generator(EVP_PKEY_CTX *ctx, int gen);
int EVP_PKEY_CTX_set_dh_pad(EVP_PKEY_CTX *ctx, int pad);
int EVP_PKEY_CTX_set_dh_nid(EVP_PKEY_CTX *ctx, int nid);

#include <openssl/ec.h>
int EVP_PKEY_CTX_set_ec_paramgen_curve_nid(EVP_PKEY_CTX *ctx, int nid);
Expand Down Expand Up @@ -111,6 +114,15 @@ then 1024 is used.
The EVP_PKEY_CTX_set_dh_paramgen_generator() macro sets DH generator to B<gen>
for DH parameter generation. If not specified 2 is used.

The EVP_PKEY_CTX_set_dh_pad() macro sets the DH padding mode. If B<pad> is
1 the shared secret is padded with zeroes up to the size of the DH prime B<p>.
If B<pad> is zero (the default) then no padding is performed.

EVP_PKEY_CTX_set_dh_nid() sets the DH parameters to values corresponding to
B<nid>. The B<nid> parameter must be B<NID_ffdhe2048>, B<NID_ffdhe3072>,
B<NID_ffdhe4096>, B<NID_ffdhe6144> or B<NID_ffdhe8192>. This macro can be
called during parameter or key generation.

The EVP_PKEY_CTX_set_ec_paramgen_curve_nid() sets the EC curve for EC parameter
generation to B<nid>. For EC parameter generation this macro must be called
or an error occurs because there is no default curve.
Expand Down
2 changes: 2 additions & 0 deletions util/private.num
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ EVP_PKEY_CTX_set1_hkdf_salt define
EVP_PKEY_CTX_set1_tls1_prf_secret define
EVP_PKEY_CTX_set_dh_paramgen_generator define
EVP_PKEY_CTX_set_dh_paramgen_prime_len define
EVP_PKEY_CTX_set_dh_pad define
EVP_PKEY_CTX_set_dh_nid define
EVP_PKEY_CTX_set_dsa_paramgen_bits define
EVP_PKEY_CTX_set_ec_param_enc define
EVP_PKEY_CTX_set_ec_paramgen_curve_nid define
Expand Down

0 comments on commit 5368bf0

Please sign in to comment.