aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/rsa/rsa.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-04 17:38:59 +0000
committerlloyd <[email protected]>2010-03-04 17:38:59 +0000
commit788e524d35d01d90c56c825dbf63a96c3c42a32c (patch)
tree0147300f6b0f6dd2fd1f16e4e8b5b4e55c35c473 /src/pubkey/rsa/rsa.h
parente63bcc23c6121245c143b7b026127ebf0be55c22 (diff)
New IF constructors, simplifies RSA/RW
Diffstat (limited to 'src/pubkey/rsa/rsa.h')
-rw-r--r--src/pubkey/rsa/rsa.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/pubkey/rsa/rsa.h b/src/pubkey/rsa/rsa.h
index c1210d22a..ce79e2440 100644
--- a/src/pubkey/rsa/rsa.h
+++ b/src/pubkey/rsa/rsa.h
@@ -39,7 +39,12 @@ class BOTAN_DLL RSA_PublicKey : public PK_Encrypting_Key,
* @arg n the modulus
* @arg e the exponent
*/
- RSA_PublicKey(const BigInt& n, const BigInt& e);
+ RSA_PublicKey(const BigInt& n, const BigInt& e) :
+ IF_Scheme_PublicKey(n, e)
+ {
+ core = IF_Core(e, n);
+ }
+
protected:
RSA_PublicKey() {}
BigInt public_op(const BigInt&) const;
@@ -71,19 +76,21 @@ class BOTAN_DLL RSA_PrivateKey : public RSA_PublicKey,
/**
* Construct a private key from the specified parameters.
- * @param rng the random number generator to use
- * @param prime1 the first prime
- * @param prime2 the second prime
- * @param exp the exponent
- * @param d_exp if specified, this has to be d with
+ * @param rng a random number generator
+ * @param p the first prime
+ * @param q the second prime
+ * @param e the exponent
+ * @param d if specified, this has to be d with
* exp * d = 1 mod (p - 1, q - 1). Leave it as 0 if you wish to
* the constructor to calculate it.
* @param n if specified, this must be n = p * q. Leave it as 0
* if you wish to the constructor to calculate it.
*/
RSA_PrivateKey(RandomNumberGenerator& rng,
- const BigInt& p, const BigInt& q, const BigInt& e,
- const BigInt& d = 0, const BigInt& n = 0);
+ const BigInt& p, const BigInt& q,
+ const BigInt& e, const BigInt& d = 0,
+ const BigInt& n = 0) :
+ IF_Scheme_PrivateKey(rng, p, q, e, d, n) {}
/**
* Create a new private key with the specified bit length