projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
rsa/rsa_lib.c: make RSA_security_bits multi-prime aware.
[openssl.git]
/
crypto
/
rsa
/
rsa_mp.c
diff --git
a/crypto/rsa/rsa_mp.c
b/crypto/rsa/rsa_mp.c
index d9705648400c92b356d97ecd83c1ffe407d3ddac..8ff4b636256d9e01f4ce7d56b5a78c6c09fe2446 100644
(file)
--- a/
crypto/rsa/rsa_mp.c
+++ b/
crypto/rsa/rsa_mp.c
@@
-93,3
+93,17
@@
int rsa_multip_calc_product(RSA *rsa)
BN_CTX_free(ctx);
return rv;
}
+
+int rsa_multip_cap(int bits)
+{
+ int cap = 5;
+
+ if (bits < 1024)
+ cap = 2;
+ else if (bits < 4096)
+ cap = 3;
+ else if (bits < 8192)
+ cap = 4;
+
+ return cap;
+}