DH_size.pod 1.3 KB
Newer Older
1 2 3 4
=pod

=head1 NAME

P
Paul Yang 已提交
5 6
DH_size, DH_bits, DH_security_bits - get Diffie-Hellman prime size and
security bits
7 8 9

=head1 SYNOPSIS

P
Paul Yang 已提交
10
 #include <openssl/dh.h>
11

P
Paul Yang 已提交
12
 int DH_size(const DH *dh);
13

P
Paul Yang 已提交
14 15 16
 int DH_bits(const DH *dh);

 int DH_security_bits(const DH *dh);
17 18 19

=head1 DESCRIPTION

20
DH_size() returns the Diffie-Hellman prime size in bytes. It can be used
21
to determine how much memory must be allocated for the shared secret
P
Paul Yang 已提交
22
computed by L<DH_compute_key(3)>.
23

24 25 26
DH_bits() returns the number of significant bits.

B<dh> and B<dh-E<gt>p> must not be B<NULL>.
27

P
Paul Yang 已提交
28 29 30
DH_security_bits() returns the number of security bits of the given B<dh>
key. See L<BN_security_bits(3)>.

31 32
=head1 RETURN VALUE

P
Paul Yang 已提交
33 34 35 36 37
DH_size() returns the prime size of Diffie-Hellman in bytes.

DH_bits() returns the number of bits in the key.

DH_security_bits() returns the number of security bits.
38 39 40

=head1 SEE ALSO

41
L<DH_new(3)>, L<DH_generate_key(3)>,
R
Rich Salz 已提交
42
L<BN_num_bits(3)>
43 44 45

=head1 HISTORY

46
DH_bits() was added in OpenSSL 1.1.0.
47

R
Rich Salz 已提交
48 49
=head1 COPYRIGHT

P
Paul Yang 已提交
50
Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
R
Rich Salz 已提交
51 52 53 54 55 56 57

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