On Fri, 6 Apr 2012 02:02:56 +0200
Christian Weisgerber na...@mips.inka.de wrote:
Extracting encrypted rar files is noticeably slower than unencrypted
ones. Rar uses the standard AES-128-CBC algorithm for encryption,
so I had the idea of using OpenSSL's optimized implementation instead
of the generic one included with unrar.
Running unrar t on a 1.5 GB test archive, I see a substantial
speedup on my amd64:
included AES: 1m43.74s real 1m28.22s user 0m2.35s system
OpenSSL AES: 0m35.30s real 0m19.54s user 0m2.00s system
Do we want his? If so, it could stand additional testing.
sure if it speeds up on extract!
can you please check the updated version with your test file?
thanks
Index: Makefile
===
RCS file: /cvs/ports/archivers/unrar/Makefile,v
retrieving revision 1.53
diff -u -p -r1.53 Makefile
--- Makefile8 Sep 2011 11:13:30 - 1.53
+++ Makefile6 Apr 2012 17:04:20 -
@@ -11,7 +11,7 @@ COMMENT= extract, list, and test RAR arc
PKGNAME= unrar-4.00
EPOCH= 1
-DISTNAME= unrarsrc-4.0.7
+DISTNAME= unrarsrc-4.1.4
CATEGORIES=archivers
HOMEPAGE= http://www.rarlab.com/
@@ -24,7 +24,7 @@ PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM=Yes
PERMIT_DISTFILES_FTP= Yes
-WANTLIB= c m stdc++
+WANTLIB= c crypto m stdc++
MASTER_SITES= ${HOMEPAGE}rar/
Index: distinfo
===
RCS file: /cvs/ports/archivers/unrar/distinfo,v
retrieving revision 1.21
diff -u -p -r1.21 distinfo
--- distinfo18 Mar 2011 20:14:58 - 1.21
+++ distinfo6 Apr 2012 17:04:20 -
@@ -1,5 +1,5 @@
-MD5 (unrarsrc-4.0.7.tar.gz) = QbCpvKlFtK4mCEIa/Y9gbg==
-RMD160 (unrarsrc-4.0.7.tar.gz) = Bin4YA6d2ymPWfwFuVab1AcDrK8=
-SHA1 (unrarsrc-4.0.7.tar.gz) = 5Miw1HJ4R189+3foSX9YGOyj1KA=
-SHA256 (unrarsrc-4.0.7.tar.gz) = 6sntdJOHDKf2eyPpIIrvHbcBw4ESOsRi6X9wN3ejMHE=
-SIZE (unrarsrc-4.0.7.tar.gz) = 152853
+MD5 (unrarsrc-4.1.4.tar.gz) = gIySpmGCCmN8oTMM9AwY5A==
+RMD160 (unrarsrc-4.1.4.tar.gz) = C7IAwB9mUUK3WBsbQO8QR9yhPFc=
+SHA1 (unrarsrc-4.1.4.tar.gz) = rkseLJnpZSfEqX+YDapUdJn0Kg8=
+SHA256 (unrarsrc-4.1.4.tar.gz) = cF2TKF/NO5wR9o5S2WOV2UK/PCAXLc7hTw148f7lc2E=
+SIZE (unrarsrc-4.1.4.tar.gz) = 157135
Index: patches/patch-makefile_unix
===
RCS file: /cvs/ports/archivers/unrar/patches/patch-makefile_unix,v
retrieving revision 1.13
diff -u -p -r1.13 patch-makefile_unix
--- patches/patch-makefile_unix 18 Mar 2011 20:14:58 - 1.13
+++ patches/patch-makefile_unix 6 Apr 2012 17:04:20 -
@@ -1,12 +1,28 @@
$OpenBSD: patch-makefile_unix,v 1.13 2011/03/18 20:14:58 naddy Exp $
makefile.unix.orig Wed Mar 9 17:40:47 2011
-+++ makefile.unix Wed Mar 9 17:41:01 2011
-@@ -107,6 +107,8 @@ OBJECTS=rar.o strlist.o strfn.o pathfn.o savepos.o sma
+--- makefile.unix.orig Mon May 30 11:47:49 2011
makefile.unix Fri Apr 6 06:58:41 2012
+@@ -6,11 +6,12 @@
+ #
+
+ # Linux using GCC
+-CXX=g++
+-CXXFLAGS=-O2
+-DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
++#CXX=g++
++#CXXFLAGS=-O2
++DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DOPENSSL
+ STRIP=strip
+ DESTDIR=/usr
++LIBS=-lcrypto
+
+ # Linux using LCC
+ #CXX=lcc
+@@ -106,6 +107,8 @@ OBJECTS=rar.o strlist.o strfn.o pathfn.o savepos.o sma
+ archive.o arcread.o unicode.o system.o isnt.o crypt.o crc.o rawread.o
encname.o \
resource.o match.o timefn.o rdwrfn.o consio.o options.o ulinks.o
errhnd.o rarvm.o \
rijndael.o getbits.o sha1.o extinfo.o extract.o volume.o list.o find.o
unpack.o cmddata.o
-
-+.SUFFIXES: .cpp
+
++.SUFFIXES: .cpp
+
.cpp.o:
$(COMPILE) -D$(WHAT) -c $
-
Index: patches/patch-os_hpp
===
RCS file: /cvs/ports/archivers/unrar/patches/patch-os_hpp,v
retrieving revision 1.6
diff -u -p -r1.6 patch-os_hpp
--- patches/patch-os_hpp30 Dec 2010 07:51:31 - 1.6
+++ patches/patch-os_hpp6 Apr 2012 17:04:20 -
@@ -1,7 +1,18 @@
$OpenBSD: patch-os_hpp,v 1.6 2010/12/30 07:51:31 benoit Exp $
os.hpp.origFri Nov 26 08:20:01 2010
-+++ os.hpp Mon Dec 6 07:49:22 2010
-@@ -262,12 +262,12 @@
+--- os.hpp.origMon Jan 9 07:46:08 2012
os.hpp Fri Apr 6 06:52:00 2012
+@@ -193,6 +193,10 @@
+ #include utime.h
+ #include locale.h
+
++#ifdef OPENSSL
++#include openssl/evp.h
++#endif
++
+ #ifdef S_IFLNK
+ #define SAVE_LINKS
+ #endif
+@@ -263,12 +267,12 @@
#endif
#endif
Index: patches/patch-rijndael_cpp
===
RCS file: patches/patch-rijndael_cpp
diff -N patches/patch-rijndael_cpp
--- /dev/null 1 Jan 1970 00:00:00 -
+++ patches/patch-rijndael_cpp 6 Apr 2012 17:04:20 -
@@ -0,0 +1,80 @@
+$OpenBSD$
+--- rijndael.cpp.orig Wed Mar 2 08:43:12 2011