diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2014-01-18 14:51:40 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2014-03-28 14:49:04 +0000 |
commit | 2514fa79acba998c2a8d4e5a8288a5b3ae990377 (patch) | |
tree | 28f4391dc3e8fc22197e53b75360800f182d9b19 /crypto/rsa/rsa_lib.c | |
parent | 4563da1d7c53e969e8d092d018795179bb648a7c (diff) |
Add functions returning security bits.
Add functions to return the "bits of security" for various public key
algorithms. Based on SP800-57.
Diffstat (limited to 'crypto/rsa/rsa_lib.c')
-rw-r--r-- | crypto/rsa/rsa_lib.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c index 9e3f7dafcd..ba277cacd8 100644 --- a/crypto/rsa/rsa_lib.c +++ b/crypto/rsa/rsa_lib.c @@ -320,3 +320,8 @@ int RSA_memory_lock(RSA *r) r->bignum_data=p; return(1); } + +int RSA_security_bits(const RSA *rsa) + { + return BN_security_bits(BN_num_bits(rsa->n), -1); + } |