projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add functions returning security bits.
[openssl.git]
/
crypto
/
dh
/
dh_lib.c
diff --git
a/crypto/dh/dh_lib.c
b/crypto/dh/dh_lib.c
index 7aef080e7abb998eac1435000e60ea14c0f1414d..83b3dc50c15a0a288ffcf2e5fa1a18d7dc3f4bb3 100644
(file)
--- a/
crypto/dh/dh_lib.c
+++ b/
crypto/dh/dh_lib.c
@@
-245,3
+245,15
@@
int DH_size(const DH *dh)
{
return(BN_num_bytes(dh->p));
}
{
return(BN_num_bytes(dh->p));
}
+
+int DH_security_bits(const DH *dh)
+ {
+ int N;
+ if (dh->q)
+ N = BN_num_bits(dh->q);
+ else if (dh->length)
+ N = dh->length;
+ else
+ N = -1;
+ return BN_security_bits(BN_num_bits(dh->p), N);
+ }