aboutsummaryrefslogtreecommitdiff
path: root/src/common/crypto.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-06-03 11:36:21 -0400
committerNick Mathewson <nickm@torproject.org>2011-06-03 11:36:21 -0400
commit12f9c91c06edf09d8acf40b08aece22b77258dbc (patch)
treeaf0ba8d5fe9ed5f420bf1d62ef4ef124725a4861 /src/common/crypto.c
parent50e4c98a5acb6d10203cc943a336abb7715414cf (diff)
parent7aa20b20bffcbc4c9b4e3eb1c874616e1cab119f (diff)
downloadtor-12f9c91c06edf09d8acf40b08aece22b77258dbc.tar
tor-12f9c91c06edf09d8acf40b08aece22b77258dbc.tar.gz
Merge remote-tracking branch 'origin/maint-0.2.2'
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r--src/common/crypto.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 684ede06a..424a6f417 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -777,6 +777,17 @@ crypto_pk_keysize(crypto_pk_env_t *env)
return (size_t) RSA_size(env->key);
}
+/** Return the size of the public key modulus of <b>env</b>, in bits. */
+int
+crypto_pk_num_bits(crypto_pk_env_t *env)
+{
+ tor_assert(env);
+ tor_assert(env->key);
+ tor_assert(env->key->n);
+
+ return BN_num_bits(env->key->n);
+}
+
/** Increase the reference count of <b>env</b>, and return it.
*/
crypto_pk_env_t *