diff options
author | lloyd <[email protected]> | 2010-10-12 19:59:26 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-12 19:59:26 +0000 |
commit | 39306575081f043d1c79ade43797d3595fd5aeec (patch) | |
tree | 926b8833f6cbde9f929b2b6156fd27b5d69f5266 /src/pubkey/rsa | |
parent | a85f136550c08fc878e3983866af0e6460e980da (diff) |
Use size_t instead of u32bit in all of pubkey
Diffstat (limited to 'src/pubkey/rsa')
-rw-r--r-- | src/pubkey/rsa/rsa.cpp | 6 | ||||
-rw-r--r-- | src/pubkey/rsa/rsa.h | 14 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/pubkey/rsa/rsa.cpp b/src/pubkey/rsa/rsa.cpp index 54c8fed0b..40c3968af 100644 --- a/src/pubkey/rsa/rsa.cpp +++ b/src/pubkey/rsa/rsa.cpp @@ -18,7 +18,7 @@ namespace Botan { * Create a RSA private key */ RSA_PrivateKey::RSA_PrivateKey(RandomNumberGenerator& rng, - u32bit bits, u32bit exp) + size_t bits, size_t exp) { if(bits < 512) throw Invalid_Argument(algo_name() + ": Can't make a key that is only " + @@ -87,7 +87,7 @@ BigInt RSA_Private_Operation::private_op(const BigInt& m) const } SecureVector<byte> -RSA_Private_Operation::sign(const byte msg[], u32bit msg_len, +RSA_Private_Operation::sign(const byte msg[], size_t msg_len, RandomNumberGenerator&) { /* We don't check signatures against powermod_e_n here because @@ -104,7 +104,7 @@ RSA_Private_Operation::sign(const byte msg[], u32bit msg_len, * RSA Decryption Operation */ SecureVector<byte> -RSA_Private_Operation::decrypt(const byte msg[], u32bit msg_len) +RSA_Private_Operation::decrypt(const byte msg[], size_t msg_len) { BigInt m(msg, msg_len); BigInt x = blinder.unblind(private_op(blinder.blind(m))); diff --git a/src/pubkey/rsa/rsa.h b/src/pubkey/rsa/rsa.h index f7700e08c..dddecdbed 100644 --- a/src/pubkey/rsa/rsa.h +++ b/src/pubkey/rsa/rsa.h @@ -80,7 +80,7 @@ class BOTAN_DLL RSA_PrivateKey : public RSA_PublicKey, * @param exp the public exponent to be used */ RSA_PrivateKey(RandomNumberGenerator& rng, - u32bit bits, u32bit exp = 65537); + size_t bits, size_t exp = 65537); }; /** @@ -92,12 +92,12 @@ class BOTAN_DLL RSA_Private_Operation : public PK_Ops::Signature, public: RSA_Private_Operation(const RSA_PrivateKey& rsa); - u32bit max_input_bits() const { return (n.bits() - 1); } + size_t max_input_bits() const { return (n.bits() - 1); } - SecureVector<byte> sign(const byte msg[], u32bit msg_len, + SecureVector<byte> sign(const byte msg[], size_t msg_len, RandomNumberGenerator& rng); - SecureVector<byte> decrypt(const byte msg[], u32bit msg_len); + SecureVector<byte> decrypt(const byte msg[], size_t msg_len); private: BigInt private_op(const BigInt& m) const; @@ -121,17 +121,17 @@ class BOTAN_DLL RSA_Public_Operation : public PK_Ops::Verification, n(rsa.get_n()), powermod_e_n(rsa.get_e(), rsa.get_n()) {} - u32bit max_input_bits() const { return (n.bits() - 1); } + size_t max_input_bits() const { return (n.bits() - 1); } bool with_recovery() const { return true; } - SecureVector<byte> encrypt(const byte msg[], u32bit msg_len, + SecureVector<byte> encrypt(const byte msg[], size_t msg_len, RandomNumberGenerator&) { BigInt m(msg, msg_len); return BigInt::encode_1363(public_op(m), n.bytes()); } - SecureVector<byte> verify_mr(const byte msg[], u32bit msg_len) + SecureVector<byte> verify_mr(const byte msg[], size_t msg_len) { BigInt m(msg, msg_len); return BigInt::encode(public_op(m)); |