On 09/04/2012 11:45 AM, Jan Rękorajski wrote:
> On Tue, 04 Sep 2012, Łukasz Michalski wrote:
>
>> Witam,
>>
>> Budowa cryptopp 5.5.2 za pomocą gcc 4.7.1 kończy się tak:
>>
>> /bin/sh ./libtool --tag=CXX --mode=compile i686-pld-linux-g++
>> -DHAVE_CONFIG_H -I. -D_FORTIFY_SOURCE=2 -O2 -pipe
>> -fno-strict-aliasing -fwrapv -march=i686 -mtune=pentium4 -gdwarf-4
>> -fno-debug-types-section -g2 -DCRYPTOPP_DISABLE_X86ASM -MT algparam.lo
>> -MD -MP -MF .deps/algparam.Tpo -c -o algparam.lo algparam.cpp
>> libtool: compile: i686-pld-linux-g++ -DHAVE_CONFIG_H -I.
>> -D_FORTIFY_SOURCE=2 -O2 -pipe -fno-strict-aliasing -fwrapv -march=i686
>> -mtune=pentium4 -gdwarf-4 -fno-debug-types-section -g2
>> -DCRYPTOPP_DISABLE_X86ASM -MT algparam.lo -MD -MP -MF .deps/algparam.Tpo
>> -c algparam.cpp -fPIC -DPIC -o .libs/algparam.o
>> In file included from algparam.h:6:0,
>> from algparam.cpp:7:
>> secblock.h: In instantiation of 'CryptoPP::AllocatorWithCleanup<T,
>> T_Align16>::pointer CryptoPP::AllocatorWithCleanup<T,
>> T_Align16>::allocate(CryptoPP::AllocatorWithCleanup<T,
>> T_Align16>::size_type, const void*) [with T = unsigned char; bool
>> T_Align16 = false; CryptoPP::AllocatorWithCleanup<T, T_Align16>::pointer
>> = unsigned char*; CryptoPP::AllocatorWithCleanup<T,
>> T_Align16>::size_type = unsigned int]':
>> secblock.h:283:19: required from 'CryptoPP::SecBlock<T,
>> A>::SecBlock(CryptoPP::SecBlock<T, A>::size_type) [with T = unsigned
>> char; A = CryptoPP::AllocatorWithCleanup<unsigned char>;
>> CryptoPP::SecBlock<T, A>::size_type = unsigned int]'
>> algparam.h:17:2: required from here
>> secblock.h:97:3: error: 'CheckSize' was not declared in this scope, and
>> no declarations were found by argument-dependent lookup at the point of
>> instantiation [-fpermissive]
>> secblock.h:97:3: note: declarations in dependent base
>> 'CryptoPP::AllocatorBase<unsigned char>' are not found by unqualified lookup
>> secblock.h:97:3: note: use 'this->CheckSize' instead
>> make[1]: *** [algparam.lo] Error 1
>>
>> Próbowałem 5.6.1 - też się nie buduje, nawet z tym:
>> http://sourceforge.net/apps/trac/cryptopp/attachment/ticket/14/gcc4.7.diff
>>
>> Jak wersja z repo została zbudowana? Starszym kompilatorem? Czy są
>> gdzieś jakieś patche o których nie wiem?
>
> Patrząc po datach to było kompilowane bardzo starym gcc (Built: 2008/07/27
> 23:19).
> Próbowałeś dodać -fpermissive do CXXFLAGS jak sugeruje komunikat błędu?
>
Nie, poddałem się. Powyższy patch dla 5.6.1 pomaga, ale dodałem jeszcze
swój. Crypttest i tak się nie linkuje za pomocą configure zrobionego
przez PLD z dynamiczną wersją.
Ponieważ we własnym projekcie i tak dla windowsa buduję lokalną wersję
ze źródeł to na razie pod linuxem zrobiłem tak samo.
Załączone patche pozwalają na zbudowanie 5.6.1 za pomocą oryginalnego
GNUmakefile (biblioteka statyczna).
pozdrawiam,
Łukasz
diff --git a/embeddedcryptopp/algebra.cpp b/embeddedcryptopp/algebra.cpp
index 78c3947..b8818e6 100644
--- a/embeddedcryptopp/algebra.cpp
+++ b/embeddedcryptopp/algebra.cpp
@@ -58,7 +58,7 @@ template <class T> const T& AbstractEuclideanDomain<T>::Gcd(const Element &a, co
Element g[3]={b, a};
unsigned int i0=0, i1=1, i2=2;
- while (!Equal(g[i1], this->Identity()))
+ while (!this->Equal(g[i1], this->Identity()))
{
g[i2] = Mod(g[i0], g[i1]);
unsigned int t = i0; i0 = i1; i1 = i2; i2 = t;
diff --git a/embeddedcryptopp/eccrypto.cpp b/embeddedcryptopp/eccrypto.cpp
index fd8462f..922104c 100644
--- a/embeddedcryptopp/eccrypto.cpp
+++ b/embeddedcryptopp/eccrypto.cpp
@@ -435,7 +435,7 @@ template <class EC> void DL_GroupParameters_EC<EC>::Initialize(const OID &oid)
StringSource ssG(param.g, true, new HexDecoder);
Element G;
bool result = GetCurve().DecodePoint(G, ssG, (size_t)ssG.MaxRetrievable());
- SetSubgroupGenerator(G);
+ this->SetSubgroupGenerator(G);
assert(result);
StringSource ssN(param.n, true, new HexDecoder);
@@ -591,7 +591,7 @@ bool DL_GroupParameters_EC<EC>::ValidateElement(unsigned int level, const Elemen
if (level >= 2 && pass)
{
const Integer &q = GetSubgroupOrder();
- Element gq = gpc ? gpc->Exponentiate(this->GetGroupPrecomputation(), q) : ExponentiateElement(g, q);
+ Element gq = gpc ? gpc->Exponentiate(this->GetGroupPrecomputation(), q) : this->ExponentiateElement(g, q);
pass = pass && IsIdentity(gq);
}
return pass;
@@ -629,7 +629,7 @@ void DL_PublicKey_EC<EC>::BERDecodePublicKey(BufferedTransformation &bt, bool pa
typename EC::Point P;
if (!this->GetGroupParameters().GetCurve().DecodePoint(P, bt, size))
BERDecodeError();
- SetPublicElement(P);
+ this->SetPublicElement(P);
}
template <class EC>
diff --git a/embeddedcryptopp/eccrypto.h b/embeddedcryptopp/eccrypto.h
index 8d95780..7ac8d90 100644
--- a/embeddedcryptopp/eccrypto.h
+++ b/embeddedcryptopp/eccrypto.h
@@ -43,7 +43,7 @@ public:
void Initialize(const EllipticCurve &ec, const Point &G, const Integer &n, const Integer &k = Integer::Zero())
{
this->m_groupPrecomputation.SetCurve(ec);
- SetSubgroupGenerator(G);
+ this->SetSubgroupGenerator(G);
m_n = n;
m_k = k;
}
@@ -145,9 +145,9 @@ public:
typedef typename EC::Point Element;
void Initialize(const DL_GroupParameters_EC<EC> ¶ms, const Element &Q)
- {this->AccessGroupParameters() = params; SetPublicElement(Q);}
+ {this->AccessGroupParameters() = params; this->SetPublicElement(Q);}
void Initialize(const EC &ec, const Element &G, const Integer &n, const Element &Q)
- {this->AccessGroupParameters().Initialize(ec, G, n); SetPublicElement(Q);}
+ {this->AccessGroupParameters().Initialize(ec, G, n); this->SetPublicElement(Q);}
// X509PublicKey
void BERDecodePublicKey(BufferedTransformation &bt, bool parametersPresent, size_t size);
@@ -166,9 +166,9 @@ public:
void Initialize(const EC &ec, const Element &G, const Integer &n, const Integer &x)
{this->AccessGroupParameters().Initialize(ec, G, n); this->SetPrivateExponent(x);}
void Initialize(RandomNumberGenerator &rng, const DL_GroupParameters_EC<EC> ¶ms)
- {GenerateRandom(rng, params);}
+ {this->GenerateRandom(rng, params);}
void Initialize(RandomNumberGenerator &rng, const EC &ec, const Element &G, const Integer &n)
- {GenerateRandom(rng, DL_GroupParameters_EC<EC>(ec, G, n));}
+ {this->GenerateRandom(rng, DL_GroupParameters_EC<EC>(ec, G, n));}
// PKCS8PrivateKey
void BERDecodePrivateKey(BufferedTransformation &bt, bool parametersPresent, size_t size);
diff --git a/embeddedcryptopp/secblock.h b/embeddedcryptopp/secblock.h
index d66470e..fb55014 100644
--- a/embeddedcryptopp/secblock.h
+++ b/embeddedcryptopp/secblock.h
@@ -94,7 +94,7 @@ public:
pointer allocate(size_type n, const void * = NULL)
{
- CheckSize(n);
+ this->CheckSize(n);
if (n == 0)
return NULL;
--- cryptopp-5.6.1/panama.cpp 2010-08-09 14:22:42.000000000 +0200
+++ cryptopp-5.6.1.patched/panama.cpp 2012-09-04 09:52:00.000000000 +0200
@@ -422,7 +422,7 @@
{
this->ThrowIfInvalidTruncatedSize(size);
- PadLastBlock(this->BLOCKSIZE, 0x01);
+ this->PadLastBlock(this->BLOCKSIZE, 0x01);
HashEndianCorrectedBlock(this->m_data);
_______________________________________________
pld-devel-pl mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-devel-pl