Update to cryptopp-5.6.2; lots of local patches go to the attic.

This commit is contained in:
dcoppa 2013-03-14 11:16:02 +00:00
parent 0b44a35c47
commit a0ca574246
18 changed files with 46 additions and 381 deletions

View File

@ -1,13 +1,12 @@
# $OpenBSD: Makefile,v 1.6 2013/03/11 10:50:02 espie Exp $
# $OpenBSD: Makefile,v 1.7 2013/03/14 11:16:02 dcoppa Exp $
COMMENT = C++ library of cryptographic algorithms
CATEGORIES = devel security
HOMEPAGE = http://www.cryptopp.com/
MASTER_SITES = ${HOMEPAGE}
DISTNAME = cryptopp561
PKGNAME = cryptopp-5.6.1
REVISION = 2
DISTNAME = cryptopp562
PKGNAME = cryptopp-5.6.2
EXTRACT_SUFX = .zip
WRKDIST = ${WRKDIR}
@ -30,7 +29,7 @@ MAKE_FLAGS += CXXFLAGS="${CXXFLAGS} -Wno-deprecated \
-DCRYPTOPP_DISABLE_SSSE3 \
-DCRYPTOPP_DISABLE_AESNI \
-DNDEBUG -fPIC" \
LDFLAGS="-pthread" \
LDFLAGS="-lpthread" \
PREFIX=${PREFIX} \
LIBcryptopp_VERSION=${LIBcryptopp_VERSION}
MAKE_FILE = ${WRKDIR}/GNUmakefile

View File

@ -1,5 +1,2 @@
MD5 (cryptopp561.zip) = lsvroJB1YrB34mvP+0g4KA==
RMD160 (cryptopp561.zip) = qKW4DJlcXU3a+6IoyviGZCUhL78=
SHA1 (cryptopp561.zip) = Mdu0VsIfUIZSGMV7fq9MlVoiK6E=
SHA256 (cryptopp561.zip) = mOdNjLF6OAMzVFGayLqcXZim3AC/XR7DxTPC6OyG8mg=
SIZE (cryptopp561.zip) = 1069703
SHA256 (cryptopp562.zip) = XL/S/LSms6qzWQLi4PO1nZFx/uErP8KzY+GAHf7FNXQ=
SIZE (cryptopp562.zip) = 1137964

View File

@ -1,23 +1,27 @@
$OpenBSD: patch-GNUmakefile,v 1.2 2011/06/24 07:55:17 dcoppa Exp $
--- GNUmakefile.orig Sun Sep 23 21:03:14 2007
+++ GNUmakefile Sun Jun 15 10:30:30 2008
$OpenBSD: patch-GNUmakefile,v 1.3 2013/03/14 11:16:02 dcoppa Exp $
--- GNUmakefile.orig Thu Mar 14 11:33:28 2013
+++ GNUmakefile Thu Mar 14 11:41:45 2013
@@ -1,4 +1,9 @@
+ifndef CXXFLAGS
CXXFLAGS = -DNDEBUG -g -O2
+endif
+ifndef LDFLAGS
+LDFLAGS = -pthread
+LDFLAGS = -lpthread
+endif
#CXXFLAGS = -g
# -O3 fails to link on Cygwin GCC version 4.5.3
# -fPIC is supported. Please report any breakage of -fPIC as a bug.
# CXXFLAGS += -fPIC
@@ -9,112 +14,12 @@ ARFLAGS = -cr # ar needs the dash on OpenBSD
@@ -9,118 +14,12 @@ ARFLAGS = -cr # ar needs the dash on OpenBSD
RANLIB = ranlib
CP = cp
MKDIR = mkdir
-EGREP = egrep
-UNAME = $(shell uname)
-ISX86 = $(shell uname -m | $(EGREP) -c "i.86|x86|i86|amd64")
-IS_SUN_CC = $(shell $(CXX) -V 2>&1 | $(EGREP) -c "CC: Sun")
-IS_LINUX = $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -c "linux")
-IS_MINGW = $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -c "mingw")
-CLANG_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "clang version")
# Default prefix for make install
ifeq ($(PREFIX),)
@ -33,11 +37,9 @@ $OpenBSD: patch-GNUmakefile,v 1.2 2011/06/24 07:55:17 dcoppa Exp $
-GCC42_OR_LATER = $(shell $(CXX) -v 2>&1 | $(EGREP) -c "^gcc version (4.[2-9]|[5-9])")
-INTEL_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -c "\(ICC\)")
-ICC111_OR_LATER = $(shell $(CXX) --version 2>&1 | $(EGREP) -c "\(ICC\) ([2-9][0-9]|1[2-9]|11\.[1-9])")
-IS_SUN_CC = $(shell $(CXX) -V 2>&1 | $(EGREP) -c "CC: Sun")
-GAS210_OR_LATER = $(shell echo "" | $(AS) -v 2>&1 | $(EGREP) -c "GNU assembler version (2\.[1-9][0-9]|[3-9])")
-GAS217_OR_LATER = $(shell echo "" | $(AS) -v 2>&1 | $(EGREP) -c "GNU assembler version (2\.1[7-9]|2\.[2-9]|[3-9])")
-GAS219_OR_LATER = $(shell echo "" | $(AS) -v 2>&1 | $(EGREP) -c "GNU assembler version (2\.19|2\.[2-9]|[3-9])")
-ISMINGW = $(shell $(CXX) --version 2>&1 | $(EGREP) -c "mingw")
-GAS210_OR_LATER = $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.[1-9][0-9]|[3-9])")
-GAS217_OR_LATER = $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.1[7-9]|2\.[2-9]|[3-9])")
-GAS219_OR_LATER = $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.19|2\.[2-9]|[3-9])")
-
-ifneq ($(GCC42_OR_LATER),0)
-ifeq ($(UNAME),Darwin)
@ -71,10 +73,6 @@ $OpenBSD: patch-GNUmakefile,v 1.2 2011/06/24 07:55:17 dcoppa Exp $
-endif
-endif
-
-ifeq ($(ISMINGW),1)
-LDLIBS += -lws2_32
-endif
-
-endif # ISX86
-
-ifeq ($(UNAME),) # for DJGPP, where uname doesn't exist
@ -83,7 +81,11 @@ $OpenBSD: patch-GNUmakefile,v 1.2 2011/06/24 07:55:17 dcoppa Exp $
-CXXFLAGS += -pipe
-endif
-
-ifeq ($(UNAME),Linux)
-ifeq ($(IS_MINGW),1)
-LDLIBS += -lws2_32
-endif
-
-ifeq ($(IS_LINUX),1)
-LDFLAGS += -pthread
-ifneq ($(shell uname -i | $(EGREP) -c "(_64|d64)"),0)
-M32OR64 = -m64
@ -107,6 +109,10 @@ $OpenBSD: patch-GNUmakefile,v 1.2 2011/06/24 07:55:17 dcoppa Exp $
-M32OR64 = -m$(shell isainfo -b)
-endif
-
-ifneq ($(CLANG_COMPILER),0)
-CXXFLAGS += -Wno-tautological-compare
-endif
-
-ifneq ($(IS_SUN_CC),0) # override flags for CC Sun C++ compiler
-CXXFLAGS = -DNDEBUG -O -g0 -native -template=no%extdef $(M32OR64)
-LDFLAGS =
@ -124,11 +130,13 @@ $OpenBSD: patch-GNUmakefile,v 1.2 2011/06/24 07:55:17 dcoppa Exp $
SRCS = $(wildcard *.cpp)
ifeq ($(SRCS),) # workaround wildcard function bug in GNU Make 3.77
SRCS = $(shell echo *.cpp)
@@ -131,10 +36,12 @@ LIBIMPORTOBJS = $(LIBOBJS:.o=.import.o)
@@ -137,12 +36,12 @@ LIBIMPORTOBJS = $(LIBOBJS:.o=.import.o)
TESTIMPORTOBJS = $(TESTOBJS:.o=.import.o)
DLLTESTOBJS = dlltest.dllonly.o
-all: cryptest.exe
-static: libcryptopp.a
-dynamic: libcryptopp.so
+SHARED_LIB = libcryptopp.so.${LIBcryptopp_VERSION}
+all: libcryptopp.a ${SHARED_LIB}
@ -138,8 +146,8 @@ $OpenBSD: patch-GNUmakefile,v 1.2 2011/06/24 07:55:17 dcoppa Exp $
+ LD_LIBRARY_PATH=${WRKDIST} ./cryptest.exe v
clean:
$(RM) cryptest.exe libcryptopp.a $(LIBOBJS) $(TESTOBJS) cryptopp.dll libcryptopp.dll.a libcryptopp.import.a cryptest.import.exe dlltest.exe $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTIMPORTOBJS) $(DLLTESTOBJS)
@@ -153,8 +60,11 @@ libcryptopp.a: $(LIBOBJS)
-$(RM) cryptest.exe libcryptopp.a libcryptopp.so $(LIBOBJS) $(TESTOBJS) cryptopp.dll libcryptopp.dll.a libcryptopp.import.a cryptest.import.exe dlltest.exe $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTI MPORTOBJS) $(DLLTESTOBJS)
@@ -167,8 +66,11 @@ libcryptopp.a: $(LIBOBJS)
libcryptopp.so: $(LIBOBJS)
$(CXX) -shared -o $@ $(LIBOBJS)
@ -147,7 +155,7 @@ $OpenBSD: patch-GNUmakefile,v 1.2 2011/06/24 07:55:17 dcoppa Exp $
+ $(CXX) -shared -o $@ $(CXXFLAGS) $(LIBOBJS) $(LDFLAGS)
+
cryptest.exe: libcryptopp.a $(TESTOBJS)
- $(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) -L. -lcryptopp $(LDFLAGS) $(LDLIBS)
- $(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) ./libcryptopp.a $(LDFLAGS) $(LDLIBS)
+ $(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) -L${WRKDIST} -lcryptopp $(LDFLAGS) $(LDLIBS)
nolib: $(OBJS) # makes it faster to test changes

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-algebra_cpp,v 1.1 2012/02/29 12:46:30 dcoppa Exp $
--- algebra.cpp.orig Fri Aug 6 18:44:32 2010
+++ algebra.cpp Wed Feb 29 10:09:08 2012
@@ -58,7 +58,7 @@ template <class T> const T& AbstractEuclideanDomain<T>
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;

View File

@ -1,24 +0,0 @@
$OpenBSD: patch-bench2_cpp,v 1.1 2011/06/24 07:55:18 dcoppa Exp $
Re-enable accidentally disabled benchmarks (upstream rev 527).
--- bench2.cpp.orig Fri Aug 6 18:46:24 2010
+++ bench2.cpp Mon Jun 13 12:30:03 2011
@@ -232,7 +232,7 @@ extern double g_hertz;
void BenchmarkAll2(double t, double hertz)
{
g_hertz = hertz;
-#if 0
+
cout << "<TABLE border=1><COLGROUP><COL align=left><COL align=right><COL align=right>" << endl;
cout << "<THEAD><TR><TH>Operation<TH>Milliseconds/Operation" << (g_hertz ? "<TH>Megacycles/Operation" : "") << endl;
@@ -275,7 +275,7 @@ void BenchmarkAll2(double t, double hertz)
BenchMarkKeyAgreement<LUC_DH>("TestData/lucd1024.dat", "LUCDIF 1024", t);
BenchMarkKeyAgreement<MQV>("TestData/mqv1024.dat", "MQV 1024", t);
BenchMarkKeyAgreement<MQV>("TestData/mqv2048.dat", "MQV 2048", t);
-#endif
+
cout << "\n<TBODY style=\"background: white\">";
{
ECIES<ECP>::Decryptor cpriv(GlobalRNG(), ASN1::secp256k1());

View File

@ -1,15 +0,0 @@
$OpenBSD: patch-blowfish_h,v 1.1 2011/06/24 07:55:18 dcoppa Exp $
Fix Blowfish minimum keylength to be 4 bytes (upstream rev 528).
--- blowfish.h.orig Fri Aug 6 18:44:34 2010
+++ blowfish.h Wed Jun 8 16:42:01 2011
@@ -9,7 +9,7 @@
NAMESPACE_BEGIN(CryptoPP)
//! _
-struct Blowfish_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 56>, public FixedRounds<16>
+struct Blowfish_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 4, 56>, public FixedRounds<16>
{
static const char *StaticAlgorithmName() {return "Blowfish";}
};

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-config_h,v 1.2 2011/06/24 07:55:18 dcoppa Exp $
--- config.h.orig Mon Aug 9 14:22:42 2010
+++ config.h Fri Jun 17 15:48:19 2011
@@ -268,7 +268,7 @@ NAMESPACE_END
$OpenBSD: patch-config_h,v 1.3 2013/03/14 11:16:02 dcoppa Exp $
--- config.h.orig Wed Feb 20 15:30:54 2013
+++ config.h Thu Mar 14 10:42:03 2013
@@ -263,7 +263,7 @@ NAMESPACE_END
// SSSE3 was actually introduced in GNU as 2.17, which was released 6/23/2006, but we can't tell what version of binutils is installed.
// GCC 4.1.2 was released on 2/13/2007, so we'll use that as a proxy for the binutils version.
@ -10,7 +10,7 @@ $OpenBSD: patch-config_h,v 1.2 2011/06/24 07:55:18 dcoppa Exp $
#define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 1
#else
#define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0
@@ -289,13 +289,13 @@ NAMESPACE_END
@@ -284,13 +284,13 @@ NAMESPACE_END
#define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 0
#endif

View File

@ -1,30 +0,0 @@
$OpenBSD: patch-eccrypto_cpp,v 1.1 2012/02/29 12:46:30 dcoppa Exp $
--- eccrypto.cpp.orig Fri Aug 6 18:44:28 2010
+++ eccrypto.cpp Wed Feb 29 10:09:08 2012
@@ -435,7 +435,7 @@ template <class EC> void DL_GroupParameters_EC<EC>::In
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(unsign
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(BufferedT
typename EC::Point P;
if (!this->GetGroupParameters().GetCurve().DecodePoint(P, bt, size))
BERDecodeError();
- SetPublicElement(P);
+ this->SetPublicElement(P);
}
template <class EC>

View File

@ -1,36 +0,0 @@
$OpenBSD: patch-eccrypto_h,v 1.1 2012/02/29 12:46:30 dcoppa Exp $
--- eccrypto.h.orig Fri Aug 6 18:46:24 2010
+++ eccrypto.h Wed Feb 29 10:09:08 2012
@@ -43,7 +43,7 @@ class DL_GroupParameters_EC : public DL_GroupParameter
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 @@ class DL_PublicKey_EC : public DL_PublicKeyImpl<DL_Gro
typedef typename EC::Point Element;
void Initialize(const DL_GroupParameters_EC<EC> &params, 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 @@ class DL_PrivateKey_EC : public DL_PrivateKeyImpl<DL_G
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> &params)
- {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);

View File

@ -1,11 +0,0 @@
$OpenBSD: patch-factory_h,v 1.1 2012/02/29 12:46:30 dcoppa Exp $
--- factory.h.orig Fri Aug 6 18:44:32 2010
+++ factory.h Wed Feb 29 10:09:08 2012
@@ -12,6 +12,7 @@ template <class AbstractClass>
class ObjectFactory
{
public:
+ virtual ~ObjectFactory () {}
virtual AbstractClass * CreateObject() const =0;
};

View File

@ -1,12 +1,12 @@
$OpenBSD: patch-misc_h,v 1.3 2012/02/29 12:46:30 dcoppa Exp $
$OpenBSD: patch-misc_h,v 1.4 2013/03/14 11:16:02 dcoppa Exp $
--- misc.h.orig Fri Aug 6 18:46:18 2010
+++ misc.h Wed Feb 29 10:09:08 2012
@@ -141,7 +141,7 @@ const T & Singleton<T, F, instance>::Ref(CRYPTOPP_NOIN
// ************** misc functions ***************
-#if (!__STDC_WANT_SECURE_LIB__)
+#if (!defined(__STDC_WANT_SECURE_LIB__) || !__STDC_WANT_SECURE_LIB__)
-#if (!__STDC_WANT_SECURE_LIB__ && !defined(_MEMORY_S_DEFINED))
+#if ((!defined(__STDC_WANT_SECURE_LIB__) || !__STDC_WANT_SECURE_LIB__) && !defined(_MEMORY_S_DEFINED))
inline void memcpy_s(void *dest, size_t sizeInBytes, const void *src, size_t count)
{
if (count > sizeInBytes)
@ -37,22 +37,6 @@ $OpenBSD: patch-misc_h,v 1.3 2012/02/29 12:46:30 dcoppa Exp $
template<> inline void SecureWipeBuffer(byte *buf, size_t n)
{
@@ -580,13 +580,13 @@ CRYPTOPP_DLL void CRYPTOPP_API UnalignedDeallocate(voi
template <class T> inline T rotlFixed(T x, unsigned int y)
{
assert(y < sizeof(T)*8);
- return T((x<<y) | (x>>(sizeof(T)*8-y)));
+ return y ? T((x<<y) | (x>>(sizeof(T)*8-y))) : x;
}
template <class T> inline T rotrFixed(T x, unsigned int y)
{
assert(y < sizeof(T)*8);
- return T((x>>y) | (x<<(sizeof(T)*8-y)));
+ return y ? T((x>>y) | (x<<(sizeof(T)*8-y))) : x;
}
template <class T> inline T rotlVariable(T x, unsigned int y)
@@ -651,7 +651,7 @@ template<> inline word32 rotrMod<word32>(word32 x, uns
#endif // #ifdef _MSC_VER

View File

@ -1,85 +0,0 @@
$OpenBSD: patch-panama_cpp,v 1.1 2011/06/24 07:55:18 dcoppa Exp $
Fix for Panama cipher validation failure (upstream rev 526).
Bug report is about armel, but it has been proven to also prevent
a sigbus crash on sparc64.
--- panama.cpp.orig Mon Aug 9 14:22:42 2010
+++ panama.cpp Wed Jun 8 16:42:01 2011
@@ -313,7 +313,7 @@ void CRYPTOPP_NOINLINE Panama_SSE2_Pull(size_t count,
#ifndef CRYPTOPP_GENERATE_X64_MASM
template <class B>
-void Panama<B>::Iterate(size_t count, const word32 *p, word32 *z, const word32 *y)
+void Panama<B>::Iterate(size_t count, const word32 *p, byte *output, const byte *input, KeystreamOperation operation)
{
word32 bstart = m_state[17];
word32 *const aPtr = m_state;
@@ -329,9 +329,6 @@ void Panama<B>::Iterate(size_t count, const word32 *p,
// b: 0 4 | 1 5 | 2 6 | 3 7
#define b(i, j) b##i[(j)*2%8 + (j)/4]
-// output
-#define OA(i) z[i] = ConditionalByteReverse(B::ToEnum(), a(i+9))
-#define OX(i) z[i] = y[i] ^ ConditionalByteReverse(B::ToEnum(), a(i+9))
// buffer update
#define US(i) {word32 t=b(0,i); b(0,i)=ConditionalByteReverse(B::ToEnum(), p[i])^t; b(25,(i+6)%8)^=t;}
#define UL(i) {word32 t=b(0,i); b(0,i)=a(i+1)^t; b(25,(i+6)%8)^=t;}
@@ -345,18 +342,20 @@ void Panama<B>::Iterate(size_t count, const word32 *p,
while (count--)
{
- if (z)
+ if (output)
{
- if (y)
- {
- OX(0); OX(1); OX(2); OX(3); OX(4); OX(5); OX(6); OX(7);
- y += 8;
- }
- else
- {
- OA(0); OA(1); OA(2); OA(3); OA(4); OA(5); OA(6); OA(7);
- }
- z += 8;
+#define PANAMA_OUTPUT(x) \
+ CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 0, a(0+9));\
+ CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 1, a(1+9));\
+ CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 2, a(2+9));\
+ CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 3, a(3+9));\
+ CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 4, a(4+9));\
+ CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 5, a(5+9));\
+ CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 6, a(6+9));\
+ CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, B::ToEnum(), 7, a(7+9));
+
+ typedef word32 WordType;
+ CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(PANAMA_OUTPUT, 4*8);
}
word32 *const b16 = (word32 *)(bPtr+((bstart+16*32) & 31*32));
@@ -422,14 +421,14 @@ void PanamaHash<B>::TruncatedFinal(byte *hash, size_t
{
this->ThrowIfInvalidTruncatedSize(size);
- PadLastBlock(this->BLOCKSIZE, 0x01);
+ this->PadLastBlock(this->BLOCKSIZE, 0x01);
HashEndianCorrectedBlock(this->m_data);
this->Iterate(32); // pull
FixedSizeSecBlock<word32, 8> buf;
- this->Iterate(1, NULL, buf, NULL);
+ this->Iterate(1, NULL, buf.BytePtr(), NULL);
memcpy(hash, buf, size);
@@ -491,7 +490,7 @@ void PanamaCipherPolicy<B>::OperateKeystream(Keystream
Panama_SSE2_Pull(iterationCount, this->m_state, (word32 *)output, (const word32 *)input);
else
#endif
- this->Iterate(iterationCount, NULL, (word32 *)output, (const word32 *)input);
+ this->Iterate(iterationCount, NULL, output, input, operation);
}
template class Panama<BigEndian>;

View File

@ -1,17 +0,0 @@
$OpenBSD: patch-panama_h,v 1.1 2011/06/24 07:55:18 dcoppa Exp $
Fix for Panama cipher validation failure (upstream rev 526).
Bug report is about armel, but it has been proven to also prevent
a sigbus crash on sparc64.
--- panama.h.orig Fri Aug 6 18:44:34 2010
+++ panama.h Wed Jun 8 16:42:01 2011
@@ -12,7 +12,7 @@ class CRYPTOPP_NO_VTABLE Panama
{
public:
void Reset();
- void Iterate(size_t count, const word32 *p=NULL, word32 *z=NULL, const word32 *y=NULL);
+ void Iterate(size_t count, const word32 *p=NULL, byte *output=NULL, const byte *input=NULL, KeystreamOperation operation=WRITE_KEYSTREAM);
protected:
typedef word32 Stage[8];

View File

@ -1,38 +0,0 @@
$OpenBSD: patch-rijndael_cpp,v 1.1 2011/06/24 07:55:18 dcoppa Exp $
Fix an infinite recursion on amd64 (upstream rev 523).
Fix use of uninitialised value in
CryptoPP::Rijndael_Enc_AdvancedProcessBlocks (upstream rev 525).
--- rijndael.cpp.orig Fri Aug 6 18:46:22 2010
+++ rijndael.cpp Wed Jun 8 16:42:01 2011
@@ -349,7 +349,11 @@ void Rijndael::Base::UncheckedSetKey(const byte *userK
void Rijndael::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
{
#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) || CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE
+#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)
if (HasSSE2())
+#else
+ if (HasAESNI())
+#endif
{
Rijndael::Enc::AdvancedProcessBlocks(inBlock, xorBlock, outBlock, 16, 0);
return;
@@ -522,7 +526,7 @@ CRYPTOPP_NAKED void CRYPTOPP_FASTCALL Rijndael_Enc_Adv
#if CRYPTOPP_BOOL_X86
#define L_REG esp
-#define L_INDEX(i) (L_REG+512+i)
+#define L_INDEX(i) (L_REG+768+i)
#define L_INXORBLOCKS L_INBLOCKS+4
#define L_OUTXORBLOCKS L_INBLOCKS+8
#define L_OUTBLOCKS L_INBLOCKS+12
@@ -621,7 +625,7 @@ CRYPTOPP_NAKED void CRYPTOPP_FASTCALL Rijndael_Enc_Adv
#if CRYPTOPP_BOOL_X86
AS2( mov [ecx+16*12+16*4], esp) // save esp to L_SP
- AS2( lea esp, [ecx-512])
+ AS2( lea esp, [ecx-768])
#endif
// copy subkeys to stack

View File

@ -1,45 +0,0 @@
$OpenBSD: patch-salsa_cpp,v 1.1 2012/02/29 12:46:30 dcoppa Exp $
--- salsa.cpp.orig Fri Aug 6 18:44:28 2010
+++ salsa.cpp Wed Feb 29 10:09:08 2012
@@ -122,17 +122,17 @@ void Salsa20_Policy::OperateKeystream(KeystreamOperati
if (HasSSE2())
{
#if CRYPTOPP_BOOL_X64
- #define REG_output %4
- #define REG_input %1
+ #define REG_output %1
+ #define REG_input %0
#define REG_iterationCount %2
- #define REG_state %3
- #define REG_rounds %0
+ #define REG_state %4 /* constant */
+ #define REG_rounds %3 /* constant */
#define REG_roundsLeft eax
#define REG_temp32 edx
#define REG_temp rdx
- #define SSE2_WORKSPACE %5
+ #define SSE2_WORKSPACE %5 /* constant */
- FixedSizeAlignedSecBlock<byte, 32*16> workspace;
+ CRYPTOPP_ALIGN_DATA(16) byte workspace[16*32];
#else
#define REG_output edi
#define REG_input eax
@@ -457,12 +457,13 @@ void Salsa20_Policy::OperateKeystream(KeystreamOperati
#ifdef __GNUC__
AS_POP_IF86( bx)
".att_syntax prefix;"
- :
#if CRYPTOPP_BOOL_X64
- : "r" (m_rounds), "r" (input), "r" (iterationCount), "r" (m_state.data()), "r" (output), "r" (workspace.m_ptr)
- : "%eax", "%edx", "memory", "cc", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15"
+ : "+r" (input), "+r" (output), "+r" (iterationCount)
+ : "r" (m_rounds), "r" (m_state.m_ptr), "r" (workspace)
+ : "%eax", "%rdx", "memory", "cc", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15"
#else
- : "d" (m_rounds), "a" (input), "c" (iterationCount), "S" (m_state.data()), "D" (output)
+ : "+a" (input), "+D" (output), "+c" (iterationCount)
+ : "d" (m_rounds), "S" (m_state.m_ptr)
: "memory", "cc"
#endif
);

View File

@ -1,15 +1,6 @@
$OpenBSD: patch-secblock_h,v 1.3 2012/02/29 12:46:30 dcoppa Exp $
$OpenBSD: patch-secblock_h,v 1.4 2013/03/14 11:16:02 dcoppa Exp $
--- secblock.h.orig Fri Aug 6 18:46:20 2010
+++ secblock.h Wed Feb 29 10:10:22 2012
@@ -88,7 +88,7 @@ class AllocatorWithCleanup : public AllocatorBase<T> (
pointer allocate(size_type n, const void * = NULL)
{
- CheckSize(n);
+ this->CheckSize(n);
if (n == 0)
return NULL;
@@ -120,7 +120,7 @@ class AllocatorWithCleanup : public AllocatorBase<T> (
// VS.NET STL enforces the policy of "All STL-compliant allocators have to provide a
// template class member called rebind".

View File

@ -1,2 +0,0 @@
@comment $OpenBSD: PFRAG.shared,v 1.1.1.1 2008/08/26 14:57:58 espie Exp $
@lib lib/libcryptopp.so.${LIBcryptopp_VERSION}

View File

@ -1,5 +1,4 @@
@comment $OpenBSD: PLIST,v 1.2 2011/06/24 07:55:18 dcoppa Exp $
%%SHARED%%
@comment $OpenBSD: PLIST,v 1.3 2013/03/14 11:16:02 dcoppa Exp $
include/cryptopp/
include/cryptopp/3way.h
include/cryptopp/adler32.h
@ -107,6 +106,7 @@ include/cryptopp/seed.h
include/cryptopp/serpent.h
include/cryptopp/serpentp.h
include/cryptopp/sha.h
include/cryptopp/sha3.h
include/cryptopp/shacal2.h
include/cryptopp/shark.h
include/cryptopp/simple.h
@ -136,3 +136,4 @@ include/cryptopp/zdeflate.h
include/cryptopp/zinflate.h
include/cryptopp/zlib.h
lib/libcryptopp.a
@lib lib/libcryptopp.so.${LIBcryptopp_VERSION}