From owner-freebsd-security@FreeBSD.ORG Sat Apr 22 13:08:13 2006 Return-Path: X-Original-To: freebsd-security@freebsd.org Delivered-To: freebsd-security@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B5D0216A408; Sat, 22 Apr 2006 13:08:13 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 54EE943D5A; Sat, 22 Apr 2006 13:08:07 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from localhost (localhost [127.0.0.1]) by pi.codefab.com (Postfix) with ESMTP id 1C8685E75; Sat, 22 Apr 2006 09:08:07 -0400 (EDT) X-Virus-Scanned: amavisd-new at codefab.com Received: from pi.codefab.com ([127.0.0.1]) by localhost (pi.codefab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ER+i3A86+Yuq; Sat, 22 Apr 2006 09:08:05 -0400 (EDT) Received: from [192.168.1.3] (pool-68-160-235-217.ny325.east.verizon.net [68.160.235.217]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pi.codefab.com (Postfix) with ESMTP id F0EA65C9C; Sat, 22 Apr 2006 09:08:04 -0400 (EDT) Message-ID: <444A2ABF.6030903@mac.com> Date: Sat, 22 Apr 2006 09:08:15 -0400 From: Chuck Swiger User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: Winston Tsai References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-security@freebsd.org, freebsd-drivers@freebsd.org Subject: Re: Crypto hw acceleration for openssl X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-drivers@freebsd.org List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Apr 2006 13:08:14 -0000 Hi, Winston-- Winston Tsai wrote: [ ...followups set to just one group... ] > Openssl speed des-cbc > And got the following result: > 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes > 43251.97k 44919.41k 45342.43k 45506.13k 45579.98k > Then I did kldunload hifn; kldunload cryptodev and ran the same test > again, and got > 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes > 43108.10k 44917.96k 45460.88k 45532.15k 45566.26k > > Version of FreeBSD is 5.3-RELEASE. I believe both crypto and cryptodev > drivers are supported since v5.0. You might need to try "openssl speed des-cbc -engine cryptodev" in order to have OpenSSL actually try to use the HiFN crypto card. You might also have to fiddle with openssl itself, since the openssl binary that ships with the system seems to prefer to use the CPU even when you tell it to use hardware via the /dev/crypto interface. [1] Possibly "cd /usr/ports/security/openssl && make install" might give you another openssl binary to try that would work better. Given the domain of your email address, you might have better insight about how to improve FreeBSD's support of HiFN hardware :-), and we would be happy to adapt any such improvements. -- -Chuck [1]: I've heard rumors to the effect that the setup costs for accessing the crypto hardware acceleration are fairly high and that using hardware crypto is a win mostly only for big operations like 1024-bit RSA or DSA key operations, that ~1GHz CPUs or faster tend to handle session-level crypto (ie, your 48-/56-/128-bit DES or 3DES, or now perhaps 128/256-bit AES) faster by themselves.