diff options
Diffstat (limited to 'extra/yassl/taocrypt/include')
-rw-r--r-- | extra/yassl/taocrypt/include/algebra.hpp | 3 | ||||
-rw-r--r-- | extra/yassl/taocrypt/include/des.hpp | 1 | ||||
-rw-r--r-- | extra/yassl/taocrypt/include/hash.hpp | 1 | ||||
-rw-r--r-- | extra/yassl/taocrypt/include/hmac.hpp | 4 | ||||
-rw-r--r-- | extra/yassl/taocrypt/include/modarith.hpp | 4 | ||||
-rw-r--r-- | extra/yassl/taocrypt/include/modes.hpp | 4 | ||||
-rw-r--r-- | extra/yassl/taocrypt/include/rsa.hpp | 34 |
7 files changed, 30 insertions, 21 deletions
diff --git a/extra/yassl/taocrypt/include/algebra.hpp b/extra/yassl/taocrypt/include/algebra.hpp index 535ce2599c4..d03123851f2 100644 --- a/extra/yassl/taocrypt/include/algebra.hpp +++ b/extra/yassl/taocrypt/include/algebra.hpp @@ -47,6 +47,7 @@ class TAOCRYPT_NO_VTABLE AbstractGroup : public virtual_base public: typedef Integer Element; + AbstractGroup() {} virtual ~AbstractGroup() {} virtual bool Equal(const Element &a, const Element &b) const =0; @@ -100,6 +101,7 @@ private: class MultiplicativeGroupT : public AbstractGroup { public: + MultiplicativeGroupT() {} const AbstractRing& GetRing() const {return *m_pRing;} @@ -151,6 +153,7 @@ class TAOCRYPT_NO_VTABLE AbstractEuclideanDomain : public AbstractRing { public: + AbstractEuclideanDomain() {} typedef Integer Element; virtual void DivisionAlgorithm(Element &r, Element &q, const Element &a, diff --git a/extra/yassl/taocrypt/include/des.hpp b/extra/yassl/taocrypt/include/des.hpp index 48bb1e9119d..35bbe3f30bf 100644 --- a/extra/yassl/taocrypt/include/des.hpp +++ b/extra/yassl/taocrypt/include/des.hpp @@ -42,6 +42,7 @@ enum { DES_BLOCK_SIZE = 8, DES_KEY_SIZE = 32 }; class BasicDES { public: + BasicDES() {} void SetKey(const byte*, word32, CipherDir dir); void RawProcessBlock(word32&, word32&) const; protected: diff --git a/extra/yassl/taocrypt/include/hash.hpp b/extra/yassl/taocrypt/include/hash.hpp index e3030088e0e..6885e0f35b5 100644 --- a/extra/yassl/taocrypt/include/hash.hpp +++ b/extra/yassl/taocrypt/include/hash.hpp @@ -38,6 +38,7 @@ namespace TaoCrypt { // HASH class HASH : public virtual_base { public: + HASH() {} virtual ~HASH() {} virtual void Update(const byte*, word32) = 0; diff --git a/extra/yassl/taocrypt/include/hmac.hpp b/extra/yassl/taocrypt/include/hmac.hpp index b710c3aa499..7ea4cabbd47 100644 --- a/extra/yassl/taocrypt/include/hmac.hpp +++ b/extra/yassl/taocrypt/include/hmac.hpp @@ -116,11 +116,11 @@ void HMAC<T>::KeyInnerHash() // Update template <class T> -void HMAC<T>::Update(const byte* msg, word32 length) +void HMAC<T>::Update(const byte* msg_arg, word32 length) { if (!innerHashKeyed_) KeyInnerHash(); - mac_.Update(msg, length); + mac_.Update(msg_arg, length); } diff --git a/extra/yassl/taocrypt/include/modarith.hpp b/extra/yassl/taocrypt/include/modarith.hpp index 47b91560657..425ab22dba0 100644 --- a/extra/yassl/taocrypt/include/modarith.hpp +++ b/extra/yassl/taocrypt/include/modarith.hpp @@ -44,8 +44,8 @@ public: typedef int RandomizationParameter; typedef Integer Element; - ModularArithmetic(const Integer &modulus = Integer::One()) - : modulus(modulus), result((word)0, modulus.reg_.size()) {} + ModularArithmetic(const Integer &modulus_arg = Integer::One()) + : modulus(modulus_arg), result((word)0, modulus_arg.reg_.size()) {} ModularArithmetic(const ModularArithmetic &ma) : AbstractRing(), diff --git a/extra/yassl/taocrypt/include/modes.hpp b/extra/yassl/taocrypt/include/modes.hpp index 65b7318661e..c46ecb3b4ca 100644 --- a/extra/yassl/taocrypt/include/modes.hpp +++ b/extra/yassl/taocrypt/include/modes.hpp @@ -48,8 +48,8 @@ public: { cipher_.Process(c, p, sz); } void SetKey(const byte* k, word32 sz) { cipher_.SetKey(k, sz, DIR); } - void SetKey(const byte* k, word32 sz, const byte* iv) - { cipher_.SetKey(k, sz, DIR); cipher_.SetIV(iv); } + void SetKey(const byte* k, word32 sz, const byte* iv_arg) + { cipher_.SetKey(k, sz, DIR); cipher_.SetIV(iv_arg); } private: T cipher_; diff --git a/extra/yassl/taocrypt/include/rsa.hpp b/extra/yassl/taocrypt/include/rsa.hpp index 1b531b9d0c0..b11142fc85d 100644 --- a/extra/yassl/taocrypt/include/rsa.hpp +++ b/extra/yassl/taocrypt/include/rsa.hpp @@ -138,6 +138,7 @@ private: // block type 2 padding class RSA_BlockType2 { public: + RSA_BlockType2() {} void Pad(const byte*, word32, byte*, word32, RandomNumberGenerator&) const; word32 UnPad(const byte*, word32, byte*) const; @@ -147,6 +148,7 @@ public: // block type 1 padding class RSA_BlockType1 { public: + RSA_BlockType1() {} void Pad(const byte*, word32, byte*, word32, RandomNumberGenerator&) const; word32 UnPad(const byte*, word32, byte*) const; @@ -181,25 +183,27 @@ public: // Public Encrypt template<class Pad> -void RSA_Encryptor<Pad>::Encrypt(const byte* plain, word32 sz, byte* cipher, - RandomNumberGenerator& rng) +void RSA_Encryptor<Pad>::Encrypt(const byte* plain_arg, word32 sz, + byte* cipher_arg, + RandomNumberGenerator& rng_arg) { PK_Lengths lengths(key_.GetModulus()); assert(sz <= lengths.FixedMaxPlaintextLength()); ByteBlock paddedBlock(lengths.PaddedBlockByteLength()); - padding_.Pad(plain, sz, paddedBlock.get_buffer(), - lengths.PaddedBlockBitLength(), rng); + padding_.Pad(plain_arg, sz, paddedBlock.get_buffer(), + lengths.PaddedBlockBitLength(), rng_arg); key_.ApplyFunction(Integer(paddedBlock.get_buffer(), paddedBlock.size())). - Encode(cipher, lengths.FixedCiphertextLength()); + Encode(cipher_arg, lengths.FixedCiphertextLength()); } // Private Decrypt template<class Pad> -word32 RSA_Decryptor<Pad>::Decrypt(const byte* cipher, word32 sz, byte* plain, - RandomNumberGenerator& rng) +word32 RSA_Decryptor<Pad>::Decrypt(const byte* cipher_arg, word32 sz, + byte* plain_arg, + RandomNumberGenerator& rng_arg) { PK_Lengths lengths(key_.GetModulus()); assert(sz == lengths.FixedCiphertextLength()); @@ -208,29 +212,29 @@ word32 RSA_Decryptor<Pad>::Decrypt(const byte* cipher, word32 sz, byte* plain, return 0; ByteBlock paddedBlock(lengths.PaddedBlockByteLength()); - Integer x = key_.CalculateInverse(rng, Integer(cipher, + Integer x = key_.CalculateInverse(rng_arg, Integer(cipher_arg, lengths.FixedCiphertextLength()).Ref()); if (x.ByteCount() > paddedBlock.size()) x = Integer::Zero(); // don't return false, prevents timing attack x.Encode(paddedBlock.get_buffer(), paddedBlock.size()); return padding_.UnPad(paddedBlock.get_buffer(), - lengths.PaddedBlockBitLength(), plain); + lengths.PaddedBlockBitLength(), plain_arg); } // Private SSL type (block 1) Encrypt template<class Pad> void RSA_Decryptor<Pad>::SSL_Sign(const byte* message, word32 sz, byte* sig, - RandomNumberGenerator& rng) + RandomNumberGenerator& rng_arg) { RSA_PublicKey inverse; inverse.Initialize(key_.GetModulus(), key_.GetPrivateExponent()); RSA_Encryptor<RSA_BlockType1> enc(inverse); // SSL Type - enc.Encrypt(message, sz, sig, rng); + enc.Encrypt(message, sz, sig, rng_arg); } -word32 SSL_Decrypt(const RSA_PublicKey& key, const byte* sig, byte* plain); +word32 SSL_Decrypt(const RSA_PublicKey& key, const byte* sig, byte* plain_arg); // Public SSL type (block 1) Decrypt @@ -238,10 +242,10 @@ template<class Pad> bool RSA_Encryptor<Pad>::SSL_Verify(const byte* message, word32 sz, const byte* sig) { - ByteBlock plain(PK_Lengths(key_.GetModulus()).FixedMaxPlaintextLength()); - SSL_Decrypt(key_, sig, plain.get_buffer()); + ByteBlock local_plain(PK_Lengths(key_.GetModulus()).FixedMaxPlaintextLength()); + SSL_Decrypt(key_, sig, local_plain.get_buffer()); - if ( (memcmp(plain.get_buffer(), message, sz)) == 0) + if ( (memcmp(local_plain.get_buffer(), message, sz)) == 0) return true; return false; } |