mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 09:53:10 +00:00
cryptopp: fix via minor update
This commit is contained in:
parent
937fa72d4f
commit
e6b245a3ee
@ -1,20 +1,16 @@
|
|||||||
{ fetchurl, stdenv, unzip, libtool }:
|
{ fetchurl, stdenv, unzip, libtool }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "crypto++-5.6.1";
|
name = "crypto++-5.6.2";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://sourceforge/cryptopp/cryptopp561.zip";
|
url = "mirror://sourceforge/cryptopp/cryptopp562.zip";
|
||||||
sha256 = "0s7jhvnfihikqp1iwpdz03fad62xkjxci6jiahrh6f3sn664vrwq";
|
sha256 = "0x1mqpz1v071cfrw4grbw7z734cxnpry1qh2b6rsmcx6nkyd5gsw";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
patches = stdenv.lib.optional (stdenv.system != "i686-cygwin") ./dll.patch;
|
||||||
./pic.patch
|
|
||||||
./salsa-gcc4.6.patch
|
|
||||||
] ++ stdenv.lib.optional (stdenv.system != "i686-cygwin") ./dll.patch;
|
|
||||||
|
|
||||||
|
buildInputs = [ unzip libtool ];
|
||||||
buildInputs = [ unzip ];
|
|
||||||
|
|
||||||
# Unpack the thing in a subdirectory.
|
# Unpack the thing in a subdirectory.
|
||||||
unpackPhase = ''
|
unpackPhase = ''
|
||||||
@ -37,7 +33,7 @@ stdenv.mkDerivation rec {
|
|||||||
# I add what 'enableParallelBuilding' would add to the make call,
|
# I add what 'enableParallelBuilding' would add to the make call,
|
||||||
# if we were using the generic build phase.
|
# if we were using the generic build phase.
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
make PREFIX="$out" all libcryptopp.so -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES
|
make PREFIX="$out" all -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# TODO: Installing cryptotest.exe doesn't seem to be necessary. We run
|
# TODO: Installing cryptotest.exe doesn't seem to be necessary. We run
|
||||||
@ -53,7 +49,7 @@ stdenv.mkDerivation rec {
|
|||||||
meta = {
|
meta = {
|
||||||
description = "Crypto++, a free C++ class library of cryptographic schemes";
|
description = "Crypto++, a free C++ class library of cryptographic schemes";
|
||||||
homepage = http://cryptopp.com/;
|
homepage = http://cryptopp.com/;
|
||||||
license = "Public Domain";
|
license = "Boost 1.0";
|
||||||
maintainers = [ stdenv.lib.maintainers.ludo ];
|
maintainers = [ stdenv.lib.maintainers.ludo ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
Build position-independent code, for shared libraries. Fix $(DLLSRCS)
|
|
||||||
while we're at it (it lacks `pssr.cpp', for instance).
|
|
||||||
|
|
||||||
--- a/GNUmakefile 2009-03-15 02:48:02.000000000 +0100
|
|
||||||
+++ b/GNUmakefile 2009-08-11 00:13:43.000000000 +0200
|
|
||||||
@@ -104,6 +104,7 @@ TESTOBJS = bench.o bench2.o test.o valid
|
|
||||||
LIBOBJS = $(filter-out $(TESTOBJS),$(OBJS))
|
|
||||||
|
|
||||||
DLLSRCS = algebra.cpp algparam.cpp asn.cpp basecode.cpp cbcmac.cpp channels.cpp cryptlib.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
|
|
||||||
+DLLSRCS = $(SRCS)
|
|
||||||
DLLOBJS = $(DLLSRCS:.cpp=.export.o)
|
|
||||||
LIBIMPORTOBJS = $(LIBOBJS:.o=.import.o)
|
|
||||||
TESTIMPORTOBJS = $(TESTOBJS:.o=.import.o)
|
|
||||||
@@ -162,7 +162,7 @@ endif
|
|
||||||
$(CXX) $(CXXFLAGS) -DCRYPTOPP_IMPORTS -c $< -o $@
|
|
||||||
|
|
||||||
%.export.o : %.cpp
|
|
||||||
- $(CXX) $(CXXFLAGS) -DCRYPTOPP_EXPORTS -c $< -o $@
|
|
||||||
+ $(CXX) $(CXXFLAGS) -fPIC -DCRYPTOPP_EXPORTS -c $< -o $@
|
|
||||||
|
|
||||||
%.o : %.cpp
|
|
||||||
$(CXX) $(CXXFLAGS) -c $<
|
|
@ -1,62 +0,0 @@
|
|||||||
From fbccde3578feddb16f07be981da1d0f26209fd04 Mon Sep 17 00:00:00 2001
|
|
||||||
From: weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>
|
|
||||||
Date: Sun, 5 Jun 2011 21:07:11 +0000
|
|
||||||
Subject: [PATCH 1/4] fix Salsa validation failure when compiling with GCC 4.6
|
|
||||||
(https://sourceforge.net/apps/trac/cryptopp/ticket/12)
|
|
||||||
|
|
||||||
git-svn-id: https://cryptopp.svn.sourceforge.net/svnroot/cryptopp/trunk@529 57ff6487-cd31-0410-9ec3-f628ee90f5f0
|
|
||||||
---
|
|
||||||
c5/salsa.cpp | 21 +++++++++++----------
|
|
||||||
1 file changed, 11 insertions(+), 10 deletions(-)
|
|
||||||
|
|
||||||
# NOTE: remove the c5 path component
|
|
||||||
|
|
||||||
diff --git a/salsa.cpp b/salsa.cpp
|
|
||||||
index bd216ee..bdc5d75 100755
|
|
||||||
--- a/salsa.cpp
|
|
||||||
+++ b/salsa.cpp
|
|
||||||
@@ -122,17 +122,17 @@ void Salsa20_Policy::OperateKeystream(KeystreamOperation operation, byte *output
|
|
||||||
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(KeystreamOperation operation, byte *output
|
|
||||||
#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
|
|
||||||
);
|
|
||||||
--
|
|
||||||
1.7.9.2
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user