Subject: NetBSD 3.1 OpenSSL Padlock support
To: None <netbsd-users@netbsd.org, port-i386@netbsd.org>
From: Daniel de Kok <danieldk@pobox.com>
List: netbsd-users
Date: 01/09/2007 19:36:06
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
--0-1446624538-1168367766=:2812
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Hi all,
Yesterday I bought a VIA Nehemiah box, partly because of its AES logic. It
seems that OpenSSL with Padlock support has been imported in netbsd-4
and head, but I am running NetBSD 3.1 on this machine.
The attached (trivial) patch adds Padlock support from OpenSSL 0.9.8d to
OpenSSL in NetBSD 3.1. Maybe it's useful to others too :). The benchmarks
give nice results:
---
$ openssl engine padlock
(padlock) VIA PadLock (no-RNG, ACE)
$ openssl speed -evp aes-256-cbc
To get the most accurate results, try to run this
program when this computer is idle.
Doing aes-256-cbc for 3s on 16 size blocks: 883423 aes-256-cbc's in 2.97s
Doing aes-256-cbc for 3s on 64 size blocks: 234067 aes-256-cbc's in 2.98s
Doing aes-256-cbc for 3s on 256 size blocks: 59549 aes-256-cbc's in 2.98s
Doing aes-256-cbc for 3s on 1024 size blocks: 14949 aes-256-cbc's in 2.98s
Doing aes-256-cbc for 3s on 8192 size blocks: 1871 aes-256-cbc's in 2.98s
OpenSSL 0.9.7d 17 Mar 2004
built on: NetBSD 3.1
options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,risc2,16,long)
aes(partial) blow
fish(ptr2)
compiler: gcc version 3.3.3 (NetBSD nb3 20040520)
available timing options: USE_TOD HZ=100 [sysconf value]
timing function used: getrusage
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192
bytes
aes-256-cbc 4755.78k 5028.69k 5116.56k 5137.66k
5144.63k
$ openssl speed -evp aes-256-cbc -engine padlock
engine "padlock" set.
To get the most accurate results, try to run this
program when this computer is idle.
Doing aes-256-cbc for 3s on 16 size blocks: 6041611 aes-256-cbc's in 2.97s
Doing aes-256-cbc for 3s on 64 size blocks: 4866167 aes-256-cbc's in 2.95s
Doing aes-256-cbc for 3s on 256 size blocks: 2794934 aes-256-cbc's in
2.98s
Doing aes-256-cbc for 3s on 1024 size blocks: 1032627 aes-256-cbc's in
2.98s
Doing aes-256-cbc for 3s on 8192 size blocks: 149950 aes-256-cbc's in
2.98s
OpenSSL 0.9.7d 17 Mar 2004
built on: NetBSD 3.1
options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,risc2,16,long)
aes(partial) blow
fish(ptr2)
compiler: gcc version 3.3.3 (NetBSD nb3 20040520)
available timing options: USE_TOD HZ=100 [sysconf value]
timing function used: getrusage
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192
bytes
aes-256-cbc 32526.16k 105648.51k 240187.07k 354907.52k
412312.13k
---
(The RNG code is disabled by default in the upstream code, see the code
comments for more information.)
-- Daniel
--0-1446624538-1168367766=:2812
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=netbsd31-openssl-padlock.c
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.NEB.4.64.0701091936060.2812@liza.taickim.net>
Content-Description:
Content-Disposition: attachment; filename=netbsd31-openssl-padlock.c
SW5kZXg6IGxpYi9saWJjcnlwdG8vZW5naW5lLmluYw0KPT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PQ0KUkNTIGZpbGU6IC9jdnNyb290L3NyYy9saWIvbGliY3J5
cHRvL2VuZ2luZS5pbmMsdg0KcmV0cmlldmluZyByZXZpc2lvbiAxLjENCmRp
ZmYgLXUgLXIxLjEgZW5naW5lLmluYw0KLS0tIGxpYi9saWJjcnlwdG8vZW5n
aW5lLmluYwkyNCBKdWwgMjAwMyAxNDoxNjozMiAtMDAwMAkxLjENCisrKyBs
aWIvbGliY3J5cHRvL2VuZ2luZS5pbmMJOSBKYW4gMjAwNyAxMDoxNTozMyAt
MDAwMA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