diff options
author | lloyd <[email protected]> | 2010-03-05 01:09:28 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-03-05 01:09:28 +0000 |
commit | 1c7dbb21d19702872379421e6ae44a15caf67da2 (patch) | |
tree | bd4ee9e01f8cfd9631655d0e0b0991d49c0a7e8e /src/pubkey/rsa/rsa.h | |
parent | 78b5b103291ee668185dc71d138a50e8e7e54808 (diff) |
Add signature generation operation classes. Remove sign() from
PK_Signing_Key, though for the moment the class remains because there
are a few pieces of code that use it to detect if signatures are
supported, or for passing to functions in look_pk
Diffstat (limited to 'src/pubkey/rsa/rsa.h')
-rw-r--r-- | src/pubkey/rsa/rsa.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/pubkey/rsa/rsa.h b/src/pubkey/rsa/rsa.h index 0d5a4ad2e..aa2f8124f 100644 --- a/src/pubkey/rsa/rsa.h +++ b/src/pubkey/rsa/rsa.h @@ -101,6 +101,23 @@ class BOTAN_DLL RSA_PrivateKey : public RSA_PublicKey, BigInt private_op(const byte[], u32bit) const; }; +class BOTAN_DLL RSA_Signature_Operation : public PK_Ops::Signature_Operation + { + public: + RSA_Signature_Operation(const RSA_PrivateKey& rsa); + + u32bit max_input_bits() const { return (n_bits - 1); } + + SecureVector<byte> sign(const byte msg[], u32bit msg_len, + RandomNumberGenerator& rng); + private: + const BigInt& q; + const BigInt& c; + Fixed_Exponent_Power_Mod powermod_d1_p, powermod_d2_q; + Modular_Reducer mod_p; + u32bit n_bits; + }; + } #endif |