Ticket #78: gcc4.7.diff

File gcc4.7.diff, 3.8 KB (added by warner, at 2012-01-06T20:07:08Z)

patch to fix gcc-4.7.0 compatibility

  • embeddedcryptopp/algebra.cpp

    diff --git a/embeddedcryptopp/algebra.cpp b/embeddedcryptopp/algebra.cpp
    index 78c3947..b8818e6 100644
    a b template <class T> const T& AbstractEuclideanDomain<T>::Gcd(const Element &a, co 
    5858        Element g[3]={b, a};
    5959        unsigned int i0=0, i1=1, i2=2;
    6060
    61         while (!Equal(g[i1], this->Identity()))
     61        while (!this->Equal(g[i1], this->Identity()))
    6262        {
    6363                g[i2] = Mod(g[i0], g[i1]);
    6464                unsigned int t = i0; i0 = i1; i1 = i2; i2 = t;
  • embeddedcryptopp/eccrypto.cpp

    diff --git a/embeddedcryptopp/eccrypto.cpp b/embeddedcryptopp/eccrypto.cpp
    index fd8462f..922104c 100644
    a b template <class EC> void DL_GroupParameters_EC<EC>::Initialize(const OID &oid) 
    435435        StringSource ssG(param.g, true, new HexDecoder);
    436436        Element G;
    437437        bool result = GetCurve().DecodePoint(G, ssG, (size_t)ssG.MaxRetrievable());
    438         SetSubgroupGenerator(G);
     438        this->SetSubgroupGenerator(G);
    439439        assert(result);
    440440
    441441        StringSource ssN(param.n, true, new HexDecoder);
    bool DL_GroupParameters_EC<EC>::ValidateElement(unsigned int level, const Elemen 
    591591        if (level >= 2 && pass)
    592592        {
    593593                const Integer &q = GetSubgroupOrder();
    594                 Element gq = gpc ? gpc->Exponentiate(this->GetGroupPrecomputation(), q) : ExponentiateElement(g, q);
     594                Element gq = gpc ? gpc->Exponentiate(this->GetGroupPrecomputation(), q) : this->ExponentiateElement(g, q);
    595595                pass = pass && IsIdentity(gq);
    596596        }
    597597        return pass;
    void DL_PublicKey_EC<EC>::BERDecodePublicKey(BufferedTransformation &bt, bool pa 
    629629        typename EC::Point P;
    630630        if (!this->GetGroupParameters().GetCurve().DecodePoint(P, bt, size))
    631631                BERDecodeError();
    632         SetPublicElement(P);
     632        this->SetPublicElement(P);
    633633}
    634634
    635635template <class EC>
  • embeddedcryptopp/eccrypto.h

    diff --git a/embeddedcryptopp/eccrypto.h b/embeddedcryptopp/eccrypto.h
    index 8d95780..7ac8d90 100644
    a b public: 
    4343        void Initialize(const EllipticCurve &ec, const Point &G, const Integer &n, const Integer &k = Integer::Zero())
    4444        {
    4545                this->m_groupPrecomputation.SetCurve(ec);
    46                 SetSubgroupGenerator(G);
     46                this->SetSubgroupGenerator(G);
    4747                m_n = n;
    4848                m_k = k;
    4949        }
    public: 
    145145        typedef typename EC::Point Element;
    146146
    147147        void Initialize(const DL_GroupParameters_EC<EC> &params, const Element &Q)
    148                 {this->AccessGroupParameters() = params; SetPublicElement(Q);}
     148                {this->AccessGroupParameters() = params; this->SetPublicElement(Q);}
    149149        void Initialize(const EC &ec, const Element &G, const Integer &n, const Element &Q)
    150                 {this->AccessGroupParameters().Initialize(ec, G, n); SetPublicElement(Q);}
     150                {this->AccessGroupParameters().Initialize(ec, G, n); this->SetPublicElement(Q);}
    151151
    152152        // X509PublicKey
    153153        void BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size);
    public: 
    166166        void Initialize(const EC &ec, const Element &G, const Integer &n, const Integer &x)
    167167                {this->AccessGroupParameters().Initialize(ec, G, n); this->SetPrivateExponent(x);}
    168168        void Initialize(RandomNumberGenerator &rng, const DL_GroupParameters_EC<EC> &params)
    169                 {GenerateRandom(rng, params);}
     169                {this->GenerateRandom(rng, params);}
    170170        void Initialize(RandomNumberGenerator &rng, const EC &ec, const Element &G, const Integer &n)
    171                 {GenerateRandom(rng, DL_GroupParameters_EC<EC>(ec, G, n));}
     171                {this->GenerateRandom(rng, DL_GroupParameters_EC<EC>(ec, G, n));}
    172172
    173173        // PKCS8PrivateKey
    174174        void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size);
  • embeddedcryptopp/secblock.h

    diff --git a/embeddedcryptopp/secblock.h b/embeddedcryptopp/secblock.h
    index d66470e..fb55014 100644
    a b public: 
    9494
    9595        pointer allocate(size_type n, const void * = NULL)
    9696        {
    97                 CheckSize(n);
     97                this->CheckSize(n);
    9898                if (n == 0)
    9999                        return NULL;
    100100