aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/rsa/rsa.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-04 17:44:07 +0000
committerlloyd <[email protected]>2010-03-04 17:44:07 +0000
commit19853ce387c62b220b90019674251b334b823823 (patch)
tree5137d8be0eb07a3d56e1740add1b8aad33d4f904 /src/pubkey/rsa/rsa.cpp
parent788e524d35d01d90c56c825dbf63a96c3c42a32c (diff)
Remove IF_Scheme_PrivateKey::PKCS8_load_hook
Diffstat (limited to 'src/pubkey/rsa/rsa.cpp')
-rw-r--r--src/pubkey/rsa/rsa.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/pubkey/rsa/rsa.cpp b/src/pubkey/rsa/rsa.cpp
index c606e5c53..b181cb9cc 100644
--- a/src/pubkey/rsa/rsa.cpp
+++ b/src/pubkey/rsa/rsa.cpp
@@ -57,12 +57,19 @@ RSA_PrivateKey::RSA_PrivateKey(RandomNumberGenerator& rng,
e = exp;
p = random_prime(rng, (bits + 1) / 2, e);
q = random_prime(rng, bits - p.bits(), e);
- d = inverse_mod(e, lcm(p - 1, q - 1));
-
- PKCS8_load_hook(rng, true);
+ n = p * q;
if(n.bits() != bits)
throw Self_Test_Failure(algo_name() + " private key generation failed");
+
+ d = inverse_mod(e, lcm(p - 1, q - 1));
+ d1 = d % (p - 1);
+ d2 = d % (q - 1);
+ c = inverse_mod(q, p);
+
+ core = IF_Core(rng, e, n, d, p, q, d1, d2, c);
+
+ gen_check(rng);
}
/*