From 9a666fa7304ea07aa7055f1d59cb3c31c43f7f48 Mon Sep 17 00:00:00 2001 From: schwarze Date: Sat, 24 Feb 2018 15:18:47 +0000 Subject: [PATCH] In dh.h rev. 1.23 2018/02/20 17:59:31, tb@ provided DH_bits(3). Merge the documentation from OpenSSL, tweaked by me. --- lib/libcrypto/man/DH_size.3 | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/lib/libcrypto/man/DH_size.3 b/lib/libcrypto/man/DH_size.3 index e566e523576..71b55dbfb1f 100644 --- a/lib/libcrypto/man/DH_size.3 +++ b/lib/libcrypto/man/DH_size.3 @@ -1,8 +1,9 @@ -.\" $OpenBSD: DH_size.3,v 1.5 2018/02/17 16:59:48 schwarze Exp $ -.\" OpenSSL 4d524e10 Feb 24 11:55:57 2000 +0000 +.\" $OpenBSD: DH_size.3,v 1.6 2018/02/24 15:18:47 schwarze Exp $ +.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" -.\" This file was written by Ulf Moeller . -.\" Copyright (c) 2000 The OpenSSL Project. All rights reserved. +.\" This file was written by Ulf Moeller +.\" and Kurt Roeckx . +.\" Copyright (c) 2000, 2015 The OpenSSL Project. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -48,31 +49,38 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: February 17 2018 $ +.Dd $Mdocdate: February 24 2018 $ .Dt DH_SIZE 3 .Os .Sh NAME -.Nm DH_size +.Nm DH_size , +.Nm DH_bits .Nd get Diffie-Hellman prime size .Sh SYNOPSIS .In openssl/dh.h .Ft int .Fo DH_size -.Fa "DH *dh" +.Fa "const DH *dh" +.Fc +.Ft int +.Fo DH_size +.Fa "const DH *dh" .Fc .Sh DESCRIPTION -This function returns the Diffie-Hellman size in bytes. +.Fn DH_size +returns the Diffie-Hellman prime size in bytes. It can be used to determine how much memory must be allocated for the shared secret computed by .Xr DH_compute_key 3 . .Pp +.Fn DH_bits +returns the number of significant bits in the key. +.Pp .Fa dh and .Fa dh->p must not be .Dv NULL . -.Sh RETURN VALUES -The size in bytes. .Sh SEE ALSO .Xr BN_num_bytes 3 , .Xr DH_generate_key 3 , @@ -81,3 +89,6 @@ The size in bytes. .Sh HISTORY .Fn DH_size is available in all versions of SSLeay and OpenSSL. +.Pp +.Fn DH_bits +first appeared in OpenSSL 1.1.0. -- 2.20.1