summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/BN_num_bytes.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/BN_num_bytes.3')
-rw-r--r--src/lib/libcrypto/man/BN_num_bytes.316
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/libcrypto/man/BN_num_bytes.3 b/src/lib/libcrypto/man/BN_num_bytes.3
index 5223ff1116..3e96a401a5 100644
--- a/src/lib/libcrypto/man/BN_num_bytes.3
+++ b/src/lib/libcrypto/man/BN_num_bytes.3
@@ -1,11 +1,11 @@
1.\" $OpenBSD: BN_num_bytes.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ 1.\" $OpenBSD: BN_num_bytes.3,v 1.3 2016/11/08 22:19:45 jmc Exp $
2.\" 2.\"
3.Dd $Mdocdate: November 6 2016 $ 3.Dd $Mdocdate: November 8 2016 $
4.Dt BN_NUM_BYTES 3 4.Dt BN_NUM_BYTES 3
5.Os 5.Os
6.Sh NAME 6.Sh NAME
7.Nm BN_num_bits ,
8.Nm BN_num_bytes , 7.Nm BN_num_bytes ,
8.Nm BN_num_bits ,
9.Nm BN_num_bits_word 9.Nm BN_num_bits_word
10.Nd get BIGNUM size 10.Nd get BIGNUM size
11.Sh SYNOPSIS 11.Sh SYNOPSIS
@@ -25,12 +25,12 @@
25.Sh DESCRIPTION 25.Sh DESCRIPTION
26.Fn BN_num_bytes 26.Fn BN_num_bytes
27returns the size of a 27returns the size of a
28.Sy BIGNUM 28.Vt BIGNUM
29in bytes. 29in bytes.
30.Pp 30.Pp
31.Fn BN_num_bits_word 31.Fn BN_num_bits_word
32returns the number of significant bits in a word. 32returns the number of significant bits in a word.
33If we take 0x00000432 as an example, it returns 11, not 16, not 32. 33As an example, 0x00000432 returns 11, not 16 or 32.
34Basically, except for a zero, it returns 34Basically, except for a zero, it returns
35.Pp 35.Pp
36.D1 floor(log2( Ns Fa w ) ) No + 1 . 36.D1 floor(log2( Ns Fa w ) ) No + 1 .
@@ -43,9 +43,7 @@ following the same principle as
43.Pp 43.Pp
44.Fn BN_num_bytes 44.Fn BN_num_bytes
45is a macro. 45is a macro.
46.Sh RETURN VALUES 46.Pp
47The size.
48.Sh NOTES
49Some have tried using 47Some have tried using
50.Fn BN_num_bits 48.Fn BN_num_bits
51on individual numbers in RSA keys, DH keys and DSA keys, and found that 49on individual numbers in RSA keys, DH keys and DSA keys, and found that
@@ -65,6 +63,8 @@ or use
65.Fn BN_num_bytes 63.Fn BN_num_bytes
66and multiply with 8 (although there's no real guarantee that will match 64and multiply with 8 (although there's no real guarantee that will match
67the "key size", just a lot more probability). 65the "key size", just a lot more probability).
66.Sh RETURN VALUES
67The size.
68.Sh SEE ALSO 68.Sh SEE ALSO
69.Xr bn 3 , 69.Xr bn 3 ,
70.Xr DH_size 3 , 70.Xr DH_size 3 ,