pull/1011/head
Christoph Weiss 9 years ago committed by fiesh
parent 19d0acd474
commit 8e8959829d

@ -1196,6 +1196,10 @@ local-pkg-list: $(LOCAL_PKG_LIST)</pre>
<td class="package">cppunit</td>
<td class="website"><a href="http://www.freedesktop.org/wiki/Software/cppunit/">CppUnit</a></td>
</tr>
<tr>
<td class="package">cryptopp</td>
<td class="website"><a href="https://www.cryptopp.com/">Crypto++ Library</a></td>
</tr>
<tr>
<td class="package">crystalhd</td>
<td class="website"><a href="http://www.broadcom.com/support/crystal_hd/">Broadcom Crystal HD Headers</a></td>

@ -0,0 +1,18 @@
This file is part of MXE.
See index.html for further information.
Fix broken Makefile, add relevant object files and don't use -DCRYPTOPP_EXPORTS
diff -ur a/GNUmakefile b/GNUmakefile
--- a/GNUmakefile 2015-11-22 22:17:59.000000000 +0100
+++ b/GNUmakefile 2015-11-29 13:04:15.587252779 +0100
@@ -255,8 +255,7 @@
LIBOBJS := $(filter-out $(TESTOBJS),$(OBJS))
# List cryptlib.cpp first in an attempt to tame C++ static initialization problems
-DLLSRCS := cryptlib.cpp algebra.cpp algparam.cpp asn.cpp basecode.cpp cbcmac.cpp channels.cpp des.cpp dessp.cpp dh.cpp dll.cpp dsa.cpp ec2n.cpp eccrypto.cpp ecp.cpp eprecomp.cpp files.cpp filters.cpp fips140.cpp fipstest.cpp gf2n.cpp gfpcrypt.cpp hex.cpp hmac.cpp integer.cpp iterhash.cpp misc.cpp modes.cpp modexppc.cpp mqueue.cpp nbtheory.cpp oaep.cpp osrng.cpp pch.cpp pkcspad.cpp pubkey.cpp queue.cpp randpool.cpp rdtables.cpp rijndael.cpp rng.cpp rsa.cpp sha.cpp simple.cpp skipjack.cpp strciphr.cpp trdlocal.cpp
-DLLOBJS := $(DLLSRCS:.cpp=.export.o)
+DLLOBJS := cryptlib.o cpu.o hex.o serpent.o randpool.o sharkbox.o blowfish.o files.o seal.o gzip.o fips140.o eprecomp.o dsa.o dll.o md2.o fipstest.o rc5.o mars.o osrng.o queue.o xtrcrypt.o gf256.o vmac.o authenc.o default.o idea.o squaretb.o pkcspad.o emsa2.o sha.o network.o eax.o tea.o square.o dessp.o crc.o elgamal.o zlib.o ida.o dh2.o camellia.o strciphr.o ecp.o marss.o adler32.o wait.o iterhash.o safer.o base32.o rc2.o polynomi.o oaep.o gf2n.o zinflate.o shark.o xtr.o shacal2.o cmac.o eccrypto.o rdrand.o ripemd.o gcm.o pubkey.o basecode.o trdlocal.o salsa.o esign.o luc.o hrtimer.o ttmac.o cbcmac.o mqv.o dh.o md4.o whrlpool.o rw.o cast.o asn.o tiger.o rng.o pssr.o misc.o mqueue.o algparam.o base64.o zdeflate.o channels.o ccm.o des.o blumshub.o ec2n.o casts.o gfpcrypt.o gost.o algebra.o rijndael.o modes.o sha3.o panama.o nbtheory.o md5.o socketft.o twofish.o tigertab.o tftables.o rsa.o rdtables.o sosemanuk.o 3way.o gf2_32.o rabin.o bfinit.o filters.o integer.o seed.o rc6.o wake.o skipjack.o arc4.o hmac.o winpipes.o
# Import lib testing
LIBIMPORTOBJS := $(LIBOBJS:.o=.import.o)

@ -0,0 +1,46 @@
#include <cryptopp/cryptlib.h>
#include <cryptopp/osrng.h>
#include <cryptopp/secblock.h>
#include <cryptopp/sha.h>
#include <cryptopp/sha3.h>
#include <cryptopp/base64.h>
#include <cryptopp/filters.h>
#include <cryptopp/gcm.h>
#include <cryptopp/rsa.h>
#include <cryptopp/pssr.h>
int main() {
{
CryptoPP::SHA512 sha2;
unsigned char digest[CryptoPP::SHA512::DIGESTSIZE];
sha2.Final(digest);
}
{
std::string data;
const CryptoPP::SecByteBlock key;
const CryptoPP::SecByteBlock iv;
CryptoPP::SecByteBlock ret(0, CryptoPP::AES::MAX_KEYLENGTH);
CryptoPP::StringSource(data, true, new CryptoPP::HashFilter(*(new CryptoPP::SHA3_512), new CryptoPP::ArraySink(ret, CryptoPP::AES::MAX_KEYLENGTH)));
CryptoPP::GCM< CryptoPP::AES, CryptoPP::GCM_64K_Tables >::Encryption pwenc;
pwenc.SetKeyWithIV(key.data(), key.size(), iv.data(), iv.size());
std::string cipher;
CryptoPP::StringSource(data, true, new CryptoPP::AuthenticatedEncryptionFilter(pwenc, new CryptoPP::StringSink(cipher), false, 16));
}
{
const CryptoPP::SecByteBlock key;
const CryptoPP::SecByteBlock iv;
CryptoPP::GCM< CryptoPP::AES, CryptoPP::GCM_64K_Tables >::Decryption pwdec;
pwdec.SetKeyWithIV(key.data(), key.size(), iv.data(), iv.size());
}
{
CryptoPP::SecByteBlock ret(0, CryptoPP::AES::BLOCKSIZE);
std::string str;
CryptoPP::StringSource(str, true, new CryptoPP::Base64Decoder(new CryptoPP::ArraySink(ret, CryptoPP::AES::BLOCKSIZE)));
}
return 0;
}

@ -0,0 +1,37 @@
# This file is part of MXE.
# See index.html for further information.
PKG := cryptopp
$(PKG)_IGNORE :=
$(PKG)_VERSION := 5.6.3
$(PKG)_CHECKSUM := 9390670a14170dd0f48a6b6b06f74269ef4b056d4718a1a329f6f6069dc957c9
$(PKG)_SUBDIR :=
$(PKG)_VERSIONF := $(shell echo $($(PKG)_VERSION) | tr -d .)
$(PKG)_FILE := $(PKG)$($(PKG)_VERSIONF).zip
$(PKG)_URL := $(SOURCEFORGE_MIRROR)/cryptopp/$($(PKG)_FILE)
$(PKG)_URL_2 := https://www.cryptopp.com/$($(PKG)_FILE)
$(PKG)_DEPS := gcc
define $(PKG)_UPDATE
$(WGET) -q -O- 'https://www.cryptopp.com/' | \
$(SED) -n 's,<TITLE>Crypto++ Library \([0-9]\.[0-9]\.[0-9]\).*,\1,p'
endef
define $(PKG)_BUILD
cp '$(1)'config.recommend '$(1)'config.h
$(MAKE) -C '$(1)' -j '$(JOBS)' -f GNUmakefile \
CC=$(TARGET)-gcc \
CXX=$(TARGET)-g++ \
RANLIB=$(TARGET)-ranlib \
AR=$(TARGET)-ar \
LD=$(TARGET)-ld \
CXXFLAGS='-DNDEBUG -O3 -mtune=native -pipe' \
$(if $(BUILD_STATIC),libcryptopp.a,cryptopp.dll)
$(INSTALL) -d '$(PREFIX)'/$(TARGET)/include/cryptopp
$(INSTALL) '$(1)'*.h '$(PREFIX)'/$(TARGET)/include/cryptopp
$(INSTALL) '$(1)'$(if $(BUILD_STATIC),libcryptopp.a,libcryptopp.dll.a) '$(PREFIX)'/$(TARGET)/lib
$(if $(BUILD_STATIC),,$(INSTALL) '$(1)'cryptopp.dll '$(PREFIX)'/$(TARGET)/bin)
$(TARGET)-g++ -w $(2).cpp -o '$(PREFIX)'/$(TARGET)/bin/test-cryptopp.exe -lcryptopp
endef
Loading…
Cancel
Save