From 0297cf548558a20e36acac3057728ad9a9aac234 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 15 Aug 2013 09:03:58 +0200 Subject: Updated CryptoPP to 5.6.2 --- CryptoPP/algebra.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'CryptoPP/algebra.cpp') diff --git a/CryptoPP/algebra.cpp b/CryptoPP/algebra.cpp index b8818e6af..958e63701 100644 --- a/CryptoPP/algebra.cpp +++ b/CryptoPP/algebra.cpp @@ -14,42 +14,42 @@ NAMESPACE_BEGIN(CryptoPP) template const T& AbstractGroup::Double(const Element &a) const { - return Add(a, a); + return this->Add(a, a); } template const T& AbstractGroup::Subtract(const Element &a, const Element &b) const { // make copy of a in case Inverse() overwrites it Element a1(a); - return Add(a1, Inverse(b)); + return this->Add(a1, Inverse(b)); } template T& AbstractGroup::Accumulate(Element &a, const Element &b) const { - return a = Add(a, b); + return a = this->Add(a, b); } template T& AbstractGroup::Reduce(Element &a, const Element &b) const { - return a = Subtract(a, b); + return a = this->Subtract(a, b); } template const T& AbstractRing::Square(const Element &a) const { - return Multiply(a, a); + return this->Multiply(a, a); } template const T& AbstractRing::Divide(const Element &a, const Element &b) const { // make copy of a in case MultiplicativeInverse() overwrites it Element a1(a); - return Multiply(a1, MultiplicativeInverse(b)); + return this->Multiply(a1, this->MultiplicativeInverse(b)); } template const T& AbstractEuclideanDomain::Mod(const Element &a, const Element &b) const { Element q; - DivisionAlgorithm(result, q, a, b); + this->DivisionAlgorithm(result, q, a, b); return result; } @@ -60,7 +60,7 @@ template const T& AbstractEuclideanDomain::Gcd(const Element &a, co while (!this->Equal(g[i1], this->Identity())) { - g[i2] = Mod(g[i0], g[i1]); + g[i2] = this->Mod(g[i0], g[i1]); unsigned int t = i0; i0 = i1; i1 = i2; i2 = t; } @@ -74,7 +74,7 @@ template const typename QuotientRing::Element& QuotientRing::Mul Element y; unsigned int i0=0, i1=1, i2=2; - while (!Equal(g[i1], Identity())) + while (!this->Equal(g[i1], this->Identity())) { // y = g[i0] / g[i1]; // g[i2] = g[i0] % g[i1]; @@ -90,7 +90,7 @@ template const typename QuotientRing::Element& QuotientRing::Mul template T AbstractGroup::ScalarMultiply(const Element &base, const Integer &exponent) const { Element result; - SimultaneousMultiply(&result, base, &exponent, 1); + this->SimultaneousMultiply(&result, base, &exponent, 1); return result; } @@ -98,7 +98,7 @@ template T AbstractGroup::CascadeScalarMultiply(const Element &x, c { const unsigned expLen = STDMAX(e1.BitCount(), e2.BitCount()); if (expLen==0) - return Identity(); + return this->Identity(); const unsigned w = (expLen <= 46 ? 1 : (expLen <= 260 ? 2 : 3)); const unsigned tableSize = 1< T AbstractGroup::CascadeScalarMultiply(const Element &x, c powerTable[1] = x; powerTable[tableSize] = y; if (w==1) - powerTable[3] = Add(x,y); + powerTable[3] = this->Add(x,y); else { - powerTable[2] = Double(x); - powerTable[2*tableSize] = Double(y); + powerTable[2] = this->Double(x); + powerTable[2*tableSize] = this->Double(y); unsigned i, j; @@ -157,12 +157,12 @@ template T AbstractGroup::CascadeScalarMultiply(const Element &x, c else { while (squaresBefore--) - result = Double(result); + result = this->Double(result); if (power1 || power2) Accumulate(result, powerTable[(power2<Double(result); power1 = power2 = 0; } } -- cgit v1.2.3