From 4a9afbb99bb73e43bcb3a30379d6a2dd59dae76a Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 9 Mar 2010 02:39:31 +0000 Subject: Deconstify PK_Ops. It's quite reasonable that some op will want to precompute only as needed, or will want to access some other expensive resource or etc. Change how the secret for generating blinding is done in cases where a PRNG isn't available. Use the operations public op to hide the secret, for instance the seed for a DH blinding variable is 2^x mod p. Make use of being able to mutate internal structures in the RW signer, since that does have access to a PRNG, so use it to initialize the blinder on first call to sign(). --- src/pubkey/rsa/rsa.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/pubkey/rsa/rsa.h') diff --git a/src/pubkey/rsa/rsa.h b/src/pubkey/rsa/rsa.h index 36f9277ef..72cd80fef 100644 --- a/src/pubkey/rsa/rsa.h +++ b/src/pubkey/rsa/rsa.h @@ -96,9 +96,9 @@ class BOTAN_DLL RSA_Private_Operation : public PK_Ops::Signature, u32bit max_input_bits() const { return (n.bits() - 1); } SecureVector sign(const byte msg[], u32bit msg_len, - RandomNumberGenerator& rng) const; + RandomNumberGenerator& rng); - SecureVector decrypt(const byte msg[], u32bit msg_len) const; + SecureVector decrypt(const byte msg[], u32bit msg_len); private: BigInt private_op(const BigInt& m) const; @@ -123,13 +123,13 @@ class BOTAN_DLL RSA_Public_Operation : public PK_Ops::Verification, bool with_recovery() const { return true; } SecureVector encrypt(const byte msg[], u32bit msg_len, - RandomNumberGenerator&) const + RandomNumberGenerator&) { BigInt m(msg, msg_len); return BigInt::encode_1363(public_op(m), n.bytes()); } - SecureVector verify_mr(const byte msg[], u32bit msg_len) const + SecureVector verify_mr(const byte msg[], u32bit msg_len) { BigInt m(msg, msg_len); return BigInt::encode(public_op(m)); -- cgit v1.2.3