[BUGS] OpenSSL speedup on those low end Via C3 chips

Edward Irvine eirvine at tpg.com.au
Wed Nov 7 22:36:49 EST 2007


Hi Folks,

Those low cost, low end VIA C3 chips come with a simple built in  
crypto engine called "padlock". Presumably this is because they see  
routers as one of their target markets. I have been astonished at the  
apparent speed of this encryption engine under FreeBSD.

Compiled a kernel with:

CPUTYPE=c3-2 			# In /etc/make.conf
device padlock		# In kernel config file
device crypto			# In kernel config file
device cryptodev		# In kernel config file


dmesg gives this..

FreeBSD 6.3-PRERELEASE #5: Tue Nov  6 20:43:54 EST 2007
     root at xxx.xxx.xxx:/usr/obj/usr/src/sys/FBSD-01
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: VIA C3 Nehemiah+RNG+AES (666.55-MHz 686-class CPU)
   Origin = "CentaurHauls"  Id = 0x698  Stepping = 8
    
Features=0x381b83f<FPU,VME,DE,PSE,TSC,MSR,SEP,MTRR,PGE,CMOV,PAT,MMX,FXSR 
,SSE>
real memory  = 1040121856 (991 MB)
avail memory = 1004576768 (958 MB)
kbd1 at kbdmux0
PadLock: HW support loaded for AES-CBC.
....

And then run a speed test:

[user at xxx.xxx.xxx ~]$ openssl speed  -evp aes-128-cbc -engine cryptodev
engine "cryptodev" set.
To get the most accurate results, try to run this
program when this computer is idle.
Doing aes-128-cbc for 3s on 16 size blocks: 43843 aes-128-cbc's in 0.05s
Doing aes-128-cbc for 3s on 64 size blocks: 43409 aes-128-cbc's in 0.04s
Doing aes-128-cbc for 3s on 256 size blocks: 42798 aes-128-cbc's in  
0.05s
Doing aes-128-cbc for 3s on 1024 size blocks: 41086 aes-128-cbc's in  
0.01s
Doing aes-128-cbc for 3s on 8192 size blocks: 23249 aes-128-cbc's in  
0.03s
OpenSSL 0.9.7e-p1 25 Oct 2004
built on: Tue Nov  6 23:45:51 EST 2007
options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) aes 
(partial) blowfish(idx)
compiler: cc
available timing options: USE_TOD HZ=128 [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-128-cbc      14837.51k    70870.03k   199466.36k  5435667.18k   
6065857.95k
                                                                     
^^^^^^^^^^^

Is that 6 Giga-bytes/sec? i.e. 60 Giga-bits/sec of 128 bit AES  
encryption? Am I reading this right?

Eddie

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.barnet.com.au/pipermail/bugs/attachments/20071107/57a78001/attachment-0001.html 


More information about the BUGS mailing list