Return-Path: Received: from mail.saout.de ([127.0.0.1]) by localhost (mail.saout.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yvUDBhp6KNwY for ; Thu, 14 Mar 2013 21:50:40 +0100 (CET) Received: from smtp3-g21.free.fr (smtp3-g21.free.fr [IPv6:2a01:e0c:1:1599::12]) by mail.saout.de (Postfix) with ESMTP for ; Thu, 14 Mar 2013 21:50:40 +0100 (CET) Received: from molly.corsac.net (unknown [78.192.68.46]) by smtp3-g21.free.fr (Postfix) with ESMTP id 27DCCA6294 for ; Thu, 14 Mar 2013 21:50:35 +0100 (CET) Message-ID: <1363294223.16876.36.camel@scapa> From: Yves-Alexis Perez Date: Thu, 14 Mar 2013 21:50:23 +0100 In-Reply-To: <20130314131457.GA5307@citd.de> References: <40727.130.226.154.66.1362921572.squirrel@lavabit.com> <20130310192312.GA9676@tansi.org> <20130314131457.GA5307@citd.de> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-X81smIXGPp/K9LD8UkHQ" Mime-Version: 1.0 Subject: Re: [dm-crypt] hardware encryption List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Matthias Schniedermeyer Cc: lxnf98mm@gmail.com, dm-crypt@saout.de --=-X81smIXGPp/K9LD8UkHQ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On jeu., 2013-03-14 at 14:14 +0100, Matthias Schniedermeyer wrote: > Given that openssl doesn't support AES-NI i'm not surprized. Where did you get that impression? >=20 > Last time i looked AES-NI support in openssl was "in Limbo" and it > may=20 > still take quite some time(years) until there is a release which=20 > officially supports AES-NI. This is despite first patches beeing made=20 > available before there was silicon, so openssl is quite a few years=20 > behind. Actually, OpenSSL supports AES-NI since 1.0.1 (see http://www.openssl.org/news/changelog.html) >=20 > I'm using an unofficial "something" (Can't remember what it is excatly > )=20 > so that openssl can utelize AES-NI which in turn enables AES-NI usage=20 > for SSH, so i can use it for scp or rsync over SSH. > The difference is quite noticable, altough in LANs i just use > ARCFOUR.=20 > No patching necesarry to saturate Gigabit. :-) >=20 > When i tested it some time back over loopback both AES-128-CBC(*) > (with=20 > AES-NI) and ARCFOUR peaked at about 400MB/s(IIRC), so no problem > doing=20 > the 110MB/s needed to saturate Gigabit. It all really depends on block size. But on my (Core i7 L640) laptop, there's really no reason to use rc4 anymore. CBC is not the best example, aes-128-cbc is indeed accelerated by AES-NI instructions but you really go fast with a mode using PCLMULQDQD like XTS: type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes rc4 255340.98k 469098.47k 599298.65k 658621.73k 679368.02k aes-128 cbc 85363.96k 91553.34k 93105.32k 93570.31k 93784.75k aes-128-xts 272573.48k 849359.06k 1540640.28k 1956586.50k 2111556.27k It's even stronger when you use authenticated ciphers like GCM if you compare it against enc+mac. You can't openssl speed on those but using 1k blocs: for cipher in aes-128-cbc-hmac-sha1 aes-128-gcm rc4-hmac-md5; do echo $cipher; dd if=3D/dev/zero bs=3D1k count=3D1M | openssl enc -${cipher} -pas= s pass:foo > /dev/null; done=20 aes-128-cbc-hmac-sha1 1048576+0 records in 1048576+0 records out 1073741824 bytes (1,1 GB) copied, 3,27757 s, 328 MB/s aes-128-gcm 1048576+0 records in 1048576+0 records out 1073741824 bytes (1,1 GB) copied, 1,90992 s, 562 MB/s rc4-hmac-md5 1048576+0 records in 1048576+0 records out 1073741824 bytes (1,1 GB) copied, 3,40679 s, 315 MB/s It's a bit out of scope for this list, but that means using dm-crypt aes-xts-plain64 on an AES-NI CPU really makes sense. On those boxes it might be even faster to use aes-256-xts than aes-128-cbc. Regards, --=20 Yves-Alexis --=-X81smIXGPp/K9LD8UkHQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQEcBAABCAAGBQJRQjgPAAoJEG3bU/KmdcClJyIH/im4vH0dwM9LN/l0izTgnOe0 zhfcObNehAx8Vn/GN/1CiPlXHQubvT9VP4UpJAZfWc6OwQ9G8jwF3tx8p02cSb57 fES9+Oj5sxMuCssubK7oMHM27I+yIYvbLubOv6hH6Lhd8ebMOVdxuVsI0lKIXss9 sQPrTNRpviHJdTZ0p5J05K0NdcsKgv085NyfswDUE+wMNggc9PNJAduEU6SiFk5F +a0OnVOwDkbERe17ftrcAL0PrjmxB8MAmMBqtFRWP1pPBspebGezITNl+jNAhV3B Dsq3wYpliq3PeUrh2m5/KOZvdY8caiDNR6v9OsR9249/Lr8DaukmtA/PSolLqrY= =9El+ -----END PGP SIGNATURE----- --=-X81smIXGPp/K9LD8UkHQ--