1e71b7053SJung-uk Kim=pod 2e71b7053SJung-uk Kim 3e71b7053SJung-uk Kim=head1 NAME 4e71b7053SJung-uk Kim 5e71b7053SJung-uk KimDH_size, DH_bits, DH_security_bits - get Diffie-Hellman prime size and 6e71b7053SJung-uk Kimsecurity bits 7e71b7053SJung-uk Kim 8e71b7053SJung-uk Kim=head1 SYNOPSIS 9e71b7053SJung-uk Kim 10e71b7053SJung-uk Kim #include <openssl/dh.h> 11e71b7053SJung-uk Kim 12*b077aed3SPierre ProncheryThe following functions have been deprecated since OpenSSL 3.0, and can be 13*b077aed3SPierre Proncheryhidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value, 14*b077aed3SPierre Proncherysee L<openssl_user_macros(7)>: 15e71b7053SJung-uk Kim 16e71b7053SJung-uk Kim int DH_bits(const DH *dh); 17e71b7053SJung-uk Kim 18*b077aed3SPierre Pronchery int DH_size(const DH *dh); 19*b077aed3SPierre Pronchery 20e71b7053SJung-uk Kim int DH_security_bits(const DH *dh); 21e71b7053SJung-uk Kim 22e71b7053SJung-uk Kim=head1 DESCRIPTION 23e71b7053SJung-uk Kim 24*b077aed3SPierre ProncheryThe functions described on this page are deprecated. 25*b077aed3SPierre ProncheryApplications should instead use L<EVP_PKEY_get_bits(3)>, 26*b077aed3SPierre ProncheryL<EVP_PKEY_get_security_bits(3)> and L<EVP_PKEY_get_size(3)>. 27e71b7053SJung-uk Kim 28e71b7053SJung-uk KimDH_bits() returns the number of significant bits. 29e71b7053SJung-uk Kim 30e71b7053SJung-uk KimB<dh> and B<dh-E<gt>p> must not be B<NULL>. 31e71b7053SJung-uk Kim 32*b077aed3SPierre ProncheryDH_size() returns the Diffie-Hellman prime size in bytes. It can be used 33*b077aed3SPierre Proncheryto determine how much memory must be allocated for the shared secret 34*b077aed3SPierre Proncherycomputed by L<DH_compute_key(3)>. 35*b077aed3SPierre Pronchery 36e71b7053SJung-uk KimDH_security_bits() returns the number of security bits of the given B<dh> 37e71b7053SJung-uk Kimkey. See L<BN_security_bits(3)>. 38e71b7053SJung-uk Kim 39e71b7053SJung-uk Kim=head1 RETURN VALUES 40e71b7053SJung-uk Kim 41*b077aed3SPierre ProncheryDH_bits() returns the number of bits in the key, or -1 if 42*b077aed3SPierre ProncheryB<dh> doesn't hold any key parameters. 43e71b7053SJung-uk Kim 44*b077aed3SPierre ProncheryDH_size() returns the prime size of Diffie-Hellman in bytes, or -1 if 45*b077aed3SPierre ProncheryB<dh> doesn't hold any key parameters. 46e71b7053SJung-uk Kim 47*b077aed3SPierre ProncheryDH_security_bits() returns the number of security bits, or -1 if 48*b077aed3SPierre ProncheryB<dh> doesn't hold any key parameters. 49e71b7053SJung-uk Kim 50e71b7053SJung-uk Kim=head1 SEE ALSO 51e71b7053SJung-uk Kim 52*b077aed3SPierre ProncheryL<EVP_PKEY_get_bits(3)>, 53e71b7053SJung-uk KimL<DH_new(3)>, L<DH_generate_key(3)>, 54e71b7053SJung-uk KimL<BN_num_bits(3)> 55e71b7053SJung-uk Kim 56e71b7053SJung-uk Kim=head1 HISTORY 57e71b7053SJung-uk Kim 58*b077aed3SPierre ProncheryAll functions were deprecated in OpenSSL 3.0. 59e71b7053SJung-uk Kim 60e71b7053SJung-uk Kim=head1 COPYRIGHT 61e71b7053SJung-uk Kim 62*b077aed3SPierre ProncheryCopyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved. 63e71b7053SJung-uk Kim 64*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 65e71b7053SJung-uk Kimthis file except in compliance with the License. You can obtain a copy 66e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at 67e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>. 68e71b7053SJung-uk Kim 69e71b7053SJung-uk Kim=cut 70