Index: crypto/algebra.cpp =================================================================== RCS file: /cvsroot/mute-net/MUTE/crypto/algebra.cpp,v retrieving revision 1.1 diff -u -r1.1 algebra.cpp --- crypto/algebra.cpp 15 Aug 2003 15:19:02 -0000 1.1 +++ crypto/algebra.cpp 24 Dec 2004 23:04:50 -0000 @@ -54,7 +54,7 @@ Element g[3]={b, a}; unsigned int i0=0, i1=1, i2=2; - while (!Equal(g[i1], Zero())) + while (!Equal(g[i1], this->Zero())) { g[i2] = Mod(g[i0], g[i1]); unsigned int t = i0; i0 = i1; i1 = i2; i2 = t; @@ -63,7 +63,7 @@ return result = g[i0]; } -template const QuotientRing::Element& QuotientRing::MultiplicativeInverse(const Element &a) const +template const typename QuotientRing::Element& QuotientRing::MultiplicativeInverse(const Element &a) const { Element g[3]={m_modulus, a}; #ifdef __BCPLUSPLUS__ @@ -77,7 +77,7 @@ Element y; unsigned int i0=0, i1=1, i2=2; - while (!Equal(g[i1], Zero())) + while (!Equal(g[i1], this->Zero())) { // y = g[i0] / g[i1]; // g[i2] = g[i0] % g[i1]; @@ -101,7 +101,7 @@ { const unsigned expLen = STDMAX(e1.BitCount(), e2.BitCount()); if (expLen==0) - return Zero(); + return this->Zero(); const unsigned w = (expLen <= 46 ? 1 : (expLen <= 260 ? 2 : 3)); const unsigned tableSize = 1<NotNegative()); exponents.push_back(WindowSlider(*expBegin++, InversionIsFast(), 0)); exponents[i].FindNextWindow(); - buckets[i].resize(1<<(exponents[i].windowSize-1), Zero()); + buckets[i].resize(1<<(exponents[i].windowSize-1), this->Zero()); } unsigned int expBitPosition = 0; Index: crypto/eprecomp.cpp =================================================================== RCS file: /cvsroot/mute-net/MUTE/crypto/eprecomp.cpp,v retrieving revision 1.1 diff -u -r1.1 eprecomp.cpp --- crypto/eprecomp.cpp 15 Aug 2003 15:19:02 -0000 1.1 +++ crypto/eprecomp.cpp 24 Dec 2004 23:04:50 -0000 @@ -48,7 +48,7 @@ eb.push_back(BaseAndExponent(m_bases[i], e)); } -template ExponentiationPrecomputation::Element ExponentiationPrecomputation::Exponentiate(const Integer &exponent) const +template typename ExponentiationPrecomputation::Element ExponentiationPrecomputation::Exponentiate(const Integer &exponent) const { std::vector > eb; // array of segments of the exponent and precalculated bases eb.reserve(m_bases.size()); Index: crypto/iterhash.h =================================================================== RCS file: /cvsroot/mute-net/MUTE/crypto/iterhash.h,v retrieving revision 1.1 diff -u -r1.1 iterhash.h --- crypto/iterhash.h 15 Aug 2003 15:19:02 -0000 1.1 +++ crypto/iterhash.h 24 Dec 2004 23:04:50 -0000 @@ -54,19 +54,19 @@ void TruncatedFinal(byte *hash, unsigned int size) { - assert(size <= DigestSize()); + assert(size <= this->DigestSize()); PadLastBlock(BLOCKSIZE - 2*sizeof(HashWordType)); - CorrectEndianess(data, data, BLOCKSIZE - 2*sizeof(HashWordType)); + CorrectEndianess(this->data, this->data, BLOCKSIZE - 2*sizeof(HashWordType)); - data[data.size-2] = HIGHFIRST ? countHi : countLo; - data[data.size-1] = HIGHFIRST ? countLo : countHi; + this->data[this->data.size-2] = HIGHFIRST ? this->countHi : this->countLo; + this->data[this->data.size-1] = HIGHFIRST ? this->countLo : this->countHi; - vTransform(data); - CorrectEndianess(digest, digest, DigestSize()); - memcpy(hash, digest, size); + vTransform(this->data); + CorrectEndianess(this->digest, this->digest, this->DigestSize()); + memcpy(hash, this->digest, size); - Reinit(); // reinit for next use + this->Reinit(); // reinit for next use } protected: @@ -76,8 +76,8 @@ vTransform(input); else { - byteReverse(data.ptr, input, (unsigned int)BLOCKSIZE); - vTransform(data); + byteReverse(this->data.ptr, input, (unsigned int)BLOCKSIZE); + vTransform(this->data); } } Index: crypto/mdc.h =================================================================== RCS file: /cvsroot/mute-net/MUTE/crypto/mdc.h,v retrieving revision 1.1 diff -u -r1.1 mdc.h --- crypto/mdc.h 15 Aug 2003 15:19:02 -0000 1.1 +++ crypto/mdc.h 24 Dec 2004 23:04:50 -0000 @@ -16,23 +16,23 @@ { public: MDC(const byte *userKey, unsigned int = 0) - : key(KEYLENGTH/4) + : key(this->KEYLENGTH/4) { - T::CorrectEndianess(key, (word32 *)userKey, KEYLENGTH); + T::CorrectEndianess(key, (word32 *)userKey, this->KEYLENGTH); } void ProcessBlock(byte *inoutBlock) const { - T::CorrectEndianess((word32 *)inoutBlock, (word32 *)inoutBlock, BLOCKSIZE); + T::CorrectEndianess((word32 *)inoutBlock, (word32 *)inoutBlock, this->BLOCKSIZE); T::Transform((word32 *)inoutBlock, key); - T::CorrectEndianess((word32 *)inoutBlock, (word32 *)inoutBlock, BLOCKSIZE); + T::CorrectEndianess((word32 *)inoutBlock, (word32 *)inoutBlock, this->BLOCKSIZE); } void ProcessBlock(const byte *inBlock, byte *outBlock) const { - T::CorrectEndianess((word32 *)outBlock, (word32 *)inBlock, BLOCKSIZE); + T::CorrectEndianess((word32 *)outBlock, (word32 *)inBlock, this->BLOCKSIZE); T::Transform((word32 *)outBlock, key); - T::CorrectEndianess((word32 *)outBlock, (word32 *)outBlock, BLOCKSIZE); + T::CorrectEndianess((word32 *)outBlock, (word32 *)outBlock, this->BLOCKSIZE); } private: Index: crypto/pubkey.cpp =================================================================== RCS file: /cvsroot/mute-net/MUTE/crypto/pubkey.cpp,v retrieving revision 1.1 diff -u -r1.1 pubkey.cpp --- crypto/pubkey.cpp 15 Aug 2003 15:19:02 -0000 1.1 +++ crypto/pubkey.cpp 24 Dec 2004 23:04:50 -0000 @@ -27,9 +27,9 @@ template unsigned int DecryptorTemplate::Decrypt(const byte *cipherText, byte *plainText) { - SecByteBlock paddedBlock(PaddedBlockByteLength()); - f.CalculateInverse(Integer(cipherText, this->CipherTextLength())).Encode(paddedBlock, paddedBlock.size); - return pad.Unpad(paddedBlock, PaddedBlockBitLength(), plainText); + SecByteBlock paddedBlock(this->PaddedBlockByteLength()); + this->f.CalculateInverse(Integer(cipherText, this->CipherTextLength())).Encode(paddedBlock, paddedBlock.size); + return this->pad.Unpad(paddedBlock, this->PaddedBlockBitLength(), plainText); } template @@ -37,9 +37,9 @@ { assert(plainTextLength <= this->MaxPlainTextLength()); - SecByteBlock paddedBlock(PaddedBlockByteLength()); - pad.Pad(rng, plainText, plainTextLength, paddedBlock, PaddedBlockBitLength()); - f.ApplyFunction(Integer(paddedBlock, paddedBlock.size)).Encode(cipherText, this->CipherTextLength()); + SecByteBlock paddedBlock(this->PaddedBlockByteLength()); + this->pad.Pad(rng, plainText, plainTextLength, paddedBlock, this->PaddedBlockBitLength()); + this->f.ApplyFunction(Integer(paddedBlock, paddedBlock.size)).Encode(cipherText, this->CipherTextLength()); } template @@ -47,18 +47,18 @@ { assert(digestLength <= MaxDigestLength()); - SecByteBlock paddedBlock(PaddedBlockByteLength()); - pad.Pad(rng, digest, digestLength, paddedBlock, PaddedBlockBitLength()); - f.CalculateInverse(Integer(paddedBlock, paddedBlock.size)).Encode(signature, DigestSignatureLength()); + SecByteBlock paddedBlock(this->PaddedBlockByteLength()); + this->pad.Pad(rng, digest, digestLength, paddedBlock, this->PaddedBlockBitLength()); + this->f.CalculateInverse(Integer(paddedBlock, paddedBlock.size)).Encode(signature, DigestSignatureLength()); } template bool DigestVerifierTemplate::VerifyDigest(const byte *digest, unsigned int digestLen, const byte *signature) const { - SecByteBlock paddedBlock(PaddedBlockByteLength()); - f.ApplyFunction(Integer(signature, DigestSignatureLength())).Encode(paddedBlock, paddedBlock.size); + SecByteBlock paddedBlock(this->PaddedBlockByteLength()); + this->f.ApplyFunction(Integer(signature, DigestSignatureLength())).Encode(paddedBlock, paddedBlock.size); SecByteBlock recoveredDigest(MaxDigestLength()); - unsigned int recoveredDigestLen = pad.Unpad(paddedBlock, PaddedBlockBitLength(), recoveredDigest); + unsigned int recoveredDigestLen = this->pad.Unpad(paddedBlock, this->PaddedBlockBitLength(), recoveredDigest); return digestLen == recoveredDigestLen && memcmp(digest, recoveredDigest, digestLen) == 0; } Index: crypto/pubkey.h =================================================================== RCS file: /cvsroot/mute-net/MUTE/crypto/pubkey.h,v retrieving revision 1.1 diff -u -r1.1 pubkey.h --- crypto/pubkey.h 15 Aug 2003 15:19:02 -0000 1.1 +++ crypto/pubkey.h 24 Dec 2004 23:04:50 -0000 @@ -114,9 +114,9 @@ PublicKeyBaseTemplate(const F &f) : f(f) {} PublicKeyBaseTemplate(BufferedTransformation &bt) : f(bt) {} virtual ~PublicKeyBaseTemplate() {} - void DEREncode(BufferedTransformation &bt) const {f.DEREncode(bt);} + void DEREncode(BufferedTransformation &bt) const {this->f.DEREncode(bt);} - const F & GetTrapdoorFunction() const {return f;} + const F & GetTrapdoorFunction() const {return this->f;} protected: // a hack to avoid having to write constructors for non-concrete derived classes @@ -135,13 +135,13 @@ { public: unsigned int MaxPlainTextLength() const {return pad.MaxUnpaddedLength(PaddedBlockBitLength());} - unsigned int CipherTextLength() const {return f.MaxImage().ByteCount();} + unsigned int CipherTextLength() const {return this->f.MaxImage().ByteCount();} P pad; protected: CryptoSystemBaseTemplate() {} - unsigned int PaddedBlockBitLength() const {return f.PreimageBound().BitCount()-1;} + unsigned int PaddedBlockBitLength() const {return this->f.PreimageBound().BitCount()-1;} }; //! . @@ -199,13 +199,13 @@ { public: unsigned int MaxDigestLength() const {return pad.MaxUnpaddedLength(PaddedBlockBitLength());} - unsigned int DigestSignatureLength() const {return f.MaxPreimage().ByteCount();} + unsigned int DigestSignatureLength() const {return this->f.MaxPreimage().ByteCount();} P pad; protected: DigestSignatureSystemBaseTemplate() {} - unsigned int PaddedBlockBitLength() const {return f.ImageBound().BitCount()-1;} + unsigned int PaddedBlockBitLength() const {return this->f.ImageBound().BitCount()-1;} }; //! . @@ -239,7 +239,7 @@ class SignatureSystemBaseTemplate : virtual public PK_SignatureSystem, virtual public S { public: - unsigned int SignatureLength() const {return DigestSignatureLength();} + unsigned int SignatureLength() const {return this->DigestSignatureLength();} HashModule * NewMessageAccumulator() const {return new H;} protected: @@ -274,11 +274,11 @@ void SignerTemplate::Sign(RandomNumberGenerator &rng, HashModule *messageAccumulator, byte *signature) const { std::auto_ptr ma(messageAccumulator); - if (ma->DigestSize() > MaxDigestLength()) + if (ma->DigestSize() > this->MaxDigestLength()) throw KeyTooShort(); SecByteBlock digest(ma->DigestSize()); ma->Final(digest); - SignDigest(rng, digest, digest.size, signature); + this->SignDigest(rng, digest, digest.size, signature); } template @@ -287,7 +287,7 @@ std::auto_ptr ma(messageAccumulator); SecByteBlock digest(ma->DigestSize()); ma->Final(digest); - return VerifyDigest(digest, digest.size, sig); + return this->VerifyDigest(digest, digest.size, sig); } // ******************************************************** @@ -308,13 +308,13 @@ class SignatureSystemWithRecoveryBaseTemplate : virtual public PK_SignatureSystemWithRecovery, virtual public PublicKeyBaseTemplate { public: - unsigned int SignatureLength() const {return f.MaxPreimage().ByteCount();} + unsigned int SignatureLength() const {return this->f.MaxPreimage().ByteCount();} HashModule * NewMessageAccumulator() const {return new H(PaddedBlockBitLength());} unsigned int MaximumRecoverableLength() const {return H::MaximumRecoverableLength(PaddedBlockBitLength());} bool AllowLeftoverMessage() const {return H::AllowLeftoverMessage();} protected: - unsigned int PaddedBlockBitLength() const {return f.ImageBound().BitCount()-1;} + unsigned int PaddedBlockBitLength() const {return this->f.ImageBound().BitCount()-1;} }; //! . @@ -342,26 +342,26 @@ std::auto_ptr ma(static_cast(messageAccumulator)); if (ma->MaximumRecoverableLength() == 0) throw KeyTooShort(); - SecByteBlock representative(PaddedBlockByteLength()); + SecByteBlock representative(this->PaddedBlockByteLength()); ma->Encode(rng, representative); - f.CalculateInverse(Integer(representative, representative.size)).Encode(signature, SignatureLength()); + this->f.CalculateInverse(Integer(representative, representative.size)).Encode(signature, this->SignatureLength()); } template bool VerifierWithRecoveryTemplate::Verify(HashModule *messageAccumulator, const byte *signature) const { std::auto_ptr ma(static_cast(messageAccumulator)); - SecByteBlock representative(PaddedBlockByteLength()); - f.ApplyFunction(Integer(signature, SignatureLength())).Encode(representative, representative.size); + SecByteBlock representative(this->PaddedBlockByteLength()); + this->f.ApplyFunction(Integer(signature, SignatureLength())).Encode(representative, representative.size); return ma->Verify(representative); } template HashModule * VerifierWithRecoveryTemplate::NewLeftoverMessageAccumulator(const byte *signature) const { - SecByteBlock representative(PaddedBlockByteLength()); - f.ApplyFunction(Integer(signature, SignatureLength())).Encode(representative, representative.size); - return new H(representative, PaddedBlockBitLength()); + SecByteBlock representative(this->PaddedBlockByteLength()); + this->f.ApplyFunction(Integer(signature, this->SignatureLength())).Encode(representative, representative.size); + return new H(representative, this->PaddedBlockBitLength()); } template