From 1c7dbb21d19702872379421e6ae44a15caf67da2 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 5 Mar 2010 01:09:28 +0000 Subject: 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 --- src/pubkey/rsa/rsa.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/pubkey/rsa/rsa.h') 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 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 -- cgit v1.2.3